Class DateItem

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

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

    • DateItem

      public DateItem()
  • 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.
    • 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.
    • isDate

      public boolean isDate()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type date.
      Specified by:
      isDate in interface Item
      Returns:
      true if it is an atomic item of type date, false otherwise.
    • 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.
    • 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.
    • hasDateTime

      public boolean hasDateTime()
      Description copied from interface: Item
      Tests whether the item contains a representation of date or time (or both).
      Specified by:
      hasDateTime in interface Item
      Returns:
      true if it is an atomic item of type time, date or dateTime, 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
    • 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.
    • 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.
    • 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.
    • getMonth

      public int getMonth()
      Description copied from interface: Item
      Return only month of the item, if it's DateTime or Duration It will not convert years into months
      Specified by:
      getMonth in interface Item
      Returns:
      only month
    • getYear

      public int getYear()
      Description copied from interface: Item
      Return year of the item, if it's DateTime or Duration
      Specified by:
      getYear in interface Item
      Returns:
      year
    • getDay

      public int getDay()
      Description copied from interface: Item
      Return only day of the item, if it's DateTime or Duration It will not convert months and years into days.
      Specified by:
      getDay in interface Item
      Returns:
      only day
    • getOffset

      public int getOffset()
      Description copied from interface: Item
      Offset is an integer between −840 and 840 inclusive
      Specified by:
      getOffset in interface Item
      Returns:
      offset in minutes
    • hasTimeZone

      public boolean hasTimeZone()
      Specified by:
      hasTimeZone in interface Item
      Returns:
      true if the Item has a timeZone, false otherwise
    • getDateTimeValue

      public OffsetDateTime getDateTimeValue()
      Description copied from interface: Item
      Returns the dateTime value of the item, if it is an atomic item of type dateTimeItem or dateItem or timeItem.
      Specified by:
      getDateTimeValue in interface Item
      Returns:
      the dateTime value as a OffsetDateTime.
    • 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.
    • getEpochMillis

      public long getEpochMillis()
      Description copied from interface: Item
      Returns the EpochMillis of the item, if it's DateTime or Duration It will collect all the parts of the item and compress it into the EpochMillis
      Specified by:
      getEpochMillis in interface Item
      Returns:
      the EpochMillis