Package org.rumbledb.items
Class DateItem
java.lang.Object
org.rumbledb.items.DateItem
- All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable
,Serializable
,Item
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests for logical equality.Returns the dateTime value of the item, if it is an atomic item of type dateTimeItem or dateItem or timeItem.int
getDay()
Return only day of the item, if it's DateTime or Duration It will not convert months and years into days.Returns the dynamic type of the item (only for error message purposes).boolean
Returns the effective boolean value of the item, if atomic.long
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 EpochMillisint
getMonth()
Return only month of the item, if it's DateTime or Duration It will not convert years into monthsint
Offset is an integer between −840 and 840 inclusiveReturns the SparkSQL type of the item for use in a query.Returns the string value of the item, if it is an atomic item.Returns the Object containing the converted value of the item for a DataFrame.int
getYear()
Return year of the item, if it's DateTime or Durationboolean
Tests whether the item contains a representation of date or time (or both).int
hashCode()
Computes a hash code.boolean
boolean
isAtomic()
Tests whether the item is an atomic item.boolean
isDate()
Tests whether the item is an atomic item of type date.void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) void
write
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.rumbledb.api.Item
addParentToDescendants, append, atomizedValue, attributes, castToDecimalValue, castToDoubleValue, castToFloatValue, castToIntegerValue, castToIntValue, children, generateNativeQuery, getBinaryValue, getBodyIterator, getBooleanValue, getContent, getDecimalValue, getDFVariablesInClosure, getDoubleValue, getDurationValue, getEstimator, getFloatValue, getHour, getIdentifier, getIntegerValue, getIntValue, getItemAt, getItemByKey, getItems, getKeys, getLocalVariablesInClosure, getMinute, getModuleDynamicContext, getMutabilityLevel, getNanosecond, getParameterNames, getPathIn, getPeriodValue, getRDDVariablesInClosure, getSecond, getSignature, getSize, getSparkSQLValue, getSparkSQLValue, getTableLocation, getTextValue, getTimeValue, getTopLevelID, getTopLevelOrder, getTransformer, getValues, getXmlDocumentPosition, isAnyURI, isArray, isAttributeNode, isBase64Binary, isBinary, isBoolean, isDateTime, isDayTimeDuration, isDecimal, isDocumentNode, isDouble, isDuration, isElementNode, isEstimator, isFloat, isFunction, isGDay, isGMonth, isGMonthDay, isGYear, isGYearMonth, isHexBinary, isInt, isInteger, isNaN, isNode, isNull, isNumeric, isObject, isPeriod, isString, isTextNode, isTime, isTransformer, isYearMonthDuration, nodeName, parent, physicalEquals, putItem, putItemAt, putItemByKey, putItemsAt, putLazyItemByKey, removeItemAt, removeItemByKey, serialize, serializeAsJSON, setMutabilityLevel, setParent, setPathIn, setTableLocation, setTopLevelID, setTopLevelOrder, setXmlDocumentPosition
-
Constructor Details
-
DateItem
public DateItem()
-
-
Method Details
-
equals
Description copied from interface:Item
Tests for logical equality. The semantics are that of the eq operator. -
getStringValue
Description copied from interface:Item
Returns the string value of the item, if it is an atomic item.- Specified by:
getStringValue
in interfaceItem
- Returns:
- the string value.
-
isDate
public boolean isDate()Description copied from interface:Item
Tests whether the item is an atomic item of type date. -
getEffectiveBooleanValue
public boolean getEffectiveBooleanValue()Description copied from interface:Item
Returns the effective boolean value of the item, if atomic.- Specified by:
getEffectiveBooleanValue
in interfaceItem
- Returns:
- the effective boolean value.
-
hashCode
public int hashCode()Description copied from interface:Item
Computes a hash code. -
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 interfaceItem
- 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 interfacecom.esotericsoftware.kryo.KryoSerializable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
read
in interfacecom.esotericsoftware.kryo.KryoSerializable
-
getDynamicType
Description copied from interface:Item
Returns the dynamic type of the item (only for error message purposes).- Specified by:
getDynamicType
in interfaceItem
- 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. -
getSparkSQLType
Description copied from interface:Item
Returns the SparkSQL type of the item for use in a query.- Specified by:
getSparkSQLType
in interfaceItem
- 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 -
getYear
public int getYear()Description copied from interface:Item
Return year of the item, if it's DateTime or Duration -
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. -
getOffset
public int getOffset()Description copied from interface:Item
Offset is an integer between −840 and 840 inclusive -
hasTimeZone
public boolean hasTimeZone()- Specified by:
hasTimeZone
in interfaceItem
- Returns:
- true if the Item has a timeZone, false otherwise
-
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 interfaceItem
- Returns:
- the dateTime value as a OffsetDateTime.
-
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 interfaceItem
- 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 interfaceItem
- Returns:
- the EpochMillis
-