Class DecimalItem

java.lang.Object
org.rumbledb.items.DecimalItem
All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable, Serializable, Item

public class DecimalItem extends Object implements Item
See Also:
  • Constructor Details

    • DecimalItem

      public DecimalItem()
    • DecimalItem

      public DecimalItem(BigDecimal decimal)
  • Method Details

    • equals

      public boolean equals(Object otherItem)
      Description copied from interface: Item
      Tests for logical equality. The semantics are that of the eq operator.
      Specified by:
      equals in interface Item
      Overrides:
      equals in class Object
      Parameters:
      otherItem - another item.
      Returns:
      true it is equal to other, false otherwise.
    • getValue

      public BigDecimal getValue()
    • getDecimalValue

      public BigDecimal getDecimalValue()
      Description copied from interface: Item
      Returns the decimal value of the item, if it is a decimal.
      Specified by:
      getDecimalValue in interface Item
      Returns:
      the decimal value as a BigDecimal.
    • getVariantValue

      public Object getVariantValue()
      Description copied from interface: Item
      Returns the Object containing the converted value of the item for a DataFrame. For use to build Variant columns.
      Specified by:
      getVariantValue in interface Item
      Returns:
      Object representing the converted value of the item.
    • getStringValue

      public String getStringValue()
      Description copied from interface: Item
      Returns the string value of the item, if it is an atomic item.
      Specified by:
      getStringValue in interface Item
      Returns:
      the string value.
    • getEffectiveBooleanValue

      public boolean getEffectiveBooleanValue()
      Description copied from interface: Item
      Returns the effective boolean value of the item, if atomic.
      Specified by:
      getEffectiveBooleanValue in interface Item
      Returns:
      the effective boolean value.
    • castToDoubleValue

      public double castToDoubleValue()
      Description copied from interface: Item
      Casts the item to a double value (must be a numeric).
      Specified by:
      castToDoubleValue in interface Item
      Returns:
      the double value.
    • castToFloatValue

      public float castToFloatValue()
      Description copied from interface: Item
      Casts the item to a float value (must be a numeric).
      Specified by:
      castToFloatValue in interface Item
      Returns:
      the float value.
    • castToDecimalValue

      public BigDecimal castToDecimalValue()
      Description copied from interface: Item
      Casts the item to a decimal value (must be a numeric).
      Specified by:
      castToDecimalValue in interface Item
      Returns:
      the BigDecimal value.
    • castToIntValue

      public int castToIntValue()
      Description copied from interface: Item
      Casts the item to an integer value (must be a numeric).
      Specified by:
      castToIntValue in interface Item
      Returns:
      the int value.
    • castToIntegerValue

      public BigInteger castToIntegerValue()
      Description copied from interface: Item
      Casts the item to a big integer value (must be a numeric).
      Specified by:
      castToIntegerValue in interface Item
      Returns:
      the BigInteger value.
    • isDecimal

      public boolean isDecimal()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type decimal.
      Specified by:
      isDecimal in interface Item
      Returns:
      true if it is an atomic item of type decimal, false otherwise.
    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
      Specified by:
      write in interface com.esotericsoftware.kryo.KryoSerializable
    • read

      public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
      Specified by:
      read in interface com.esotericsoftware.kryo.KryoSerializable
    • hashCode

      public int hashCode()
      Description copied from interface: Item
      Computes a hash code.
      Specified by:
      hashCode in interface Item
      Overrides:
      hashCode in class Object
      Returns:
      a hash code as an int.
    • getDynamicType

      public ItemType getDynamicType()
      Description copied from interface: Item
      Returns the dynamic type of the item (only for error message purposes).
      Specified by:
      getDynamicType in interface Item
      Returns:
      the dynamic type as an item type.
    • generateNativeQuery

      public NativeClauseContext generateNativeQuery(NativeClauseContext context)
      Description copied from interface: Item
      Get sparkSql string for the item
      Specified by:
      generateNativeQuery in interface Item
      Parameters:
      context - input context
      Returns:
      String representing the item in a sparksql query or null if it is not supported for the item
    • isNumeric

      public boolean isNumeric()
      Description copied from interface: Item
      Tests whether the item is a number (decimal or double).
      Specified by:
      isNumeric in interface Item
      Returns:
      true if it is a number, false otherwise.
    • isAtomic

      public boolean isAtomic()
      Description copied from interface: Item
      Tests whether the item is an atomic item.
      Specified by:
      isAtomic in interface Item
      Returns:
      true if it is an atomic item, false otherwise.
    • getSparkSQLValue

      public String getSparkSQLValue()
      Description copied from interface: Item
      Returns the SparkSQL value of the item for use in a query.
      Specified by:
      getSparkSQLValue in interface Item
      Returns:
      String representing the SparkSQL value of the item.
    • getSparkSQLValue

      public String getSparkSQLValue(ItemType itemType)
      Description copied from interface: Item
      Returns the SparkSQL value of the item for use in a query.
      Specified by:
      getSparkSQLValue in interface Item
      Returns:
      String representing the SparkSQL value of the item.
    • getSparkSQLType

      public String getSparkSQLType()
      Description copied from interface: Item
      Returns the SparkSQL type of the item for use in a query.
      Specified by:
      getSparkSQLType in interface Item
      Returns:
      String representing the SparkSQL type of the item.