Package org.rumbledb.items
Class DurationItem
java.lang.Object
org.rumbledb.items.DurationItem
- All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable
,Serializable
,Item
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests for logical equality.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 duration value of the item, if it is a duration.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
getHour()
Return only hour of the item, if it's DateTime, Time or Durationint
Return only minutes of the item, if it's DateTime, Time or Duration It will not convert hours into minutesint
getMonth()
Return only month of the item, if it's DateTime or Duration It will not convert years into monthsint
Return the only nanoseconds of the item, if it's DateTime, Time or Duration It will not convert hours, minutes and seconds into nanoseconds It exists only if the value in seconds will have decimal values, otherwise it will return 0Returns the period value of the item, if it is a duration.double
Return only seconds of the item, if it's DateTime, Time or Duration It will not convert hours and minutes into secondsReturns the string value of the item, if it is an atomic item.int
getYear()
Return year of the item, if it's DateTime or Durationint
hashCode()
Computes a hash code.boolean
isAtomic()
Tests whether the item is an atomic item.boolean
Tests whether the item is an atomic item of type duration.static String
normalizeDuration
(Period period, Duration duration) static Period
normalizeMonthsToYears
(Period period) 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, getDateTimeValue, getDecimalValue, getDFVariablesInClosure, getDoubleValue, getEstimator, getFloatValue, getIdentifier, getIntegerValue, getIntValue, getItemAt, getItemByKey, getItems, getKeys, getLocalVariablesInClosure, getModuleDynamicContext, getMutabilityLevel, getOffset, getParameterNames, getPathIn, getRDDVariablesInClosure, getSignature, getSize, getSparkSQLType, getSparkSQLValue, getSparkSQLValue, getTableLocation, getTextValue, getTimeValue, getTopLevelID, getTopLevelOrder, getTransformer, getValues, getVariantValue, getXmlDocumentPosition, hasDateTime, hasTimeZone, isAnyURI, isArray, isAttributeNode, isBase64Binary, isBinary, isBoolean, isDate, isDateTime, isDayTimeDuration, isDecimal, isDocumentNode, isDouble, 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
-
Field Details
-
periodComparator
-
-
Constructor Details
-
DurationItem
public DurationItem() -
DurationItem
-
DurationItem
-
-
Method Details
-
equals
Description copied from interface:Item
Tests for logical equality. The semantics are that of the eq operator. -
getDurationValue
Description copied from interface:Item
Returns the duration value of the item, if it is a duration.- Specified by:
getDurationValue
in interfaceItem
- Returns:
- the duration value as a Duration.
-
getPeriodValue
Description copied from interface:Item
Returns the period value of the item, if it is a duration.- Specified by:
getPeriodValue
in interfaceItem
- Returns:
- the period value as a Period.
-
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.
-
isAtomic
public boolean isAtomic()Description copied from interface:Item
Tests whether the item is an atomic item. -
isDuration
public boolean isDuration()Description copied from interface:Item
Tests whether the item is an atomic item of type duration.- Specified by:
isDuration
in interfaceItem
- Returns:
- true if it is an atomic item of type duration, 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 interfaceItem
- Returns:
- the effective boolean value.
-
hashCode
public int hashCode()Description copied from interface:Item
Computes a hash code. -
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.
-
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
-
normalizeDuration
-
normalizeMonthsToYears
-
getYear
public int getYear()Description copied from interface:Item
Return year of the item, if it's DateTime or Duration -
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 -
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. -
getHour
public int getHour()Description copied from interface:Item
Return only hour of the item, if it's DateTime, Time or Duration -
getMinute
public int getMinute()Description copied from interface:Item
Return only minutes of the item, if it's DateTime, Time or Duration It will not convert hours into minutes -
getSecond
public double getSecond()Description copied from interface:Item
Return only seconds of the item, if it's DateTime, Time or Duration It will not convert hours and minutes into seconds -
getNanosecond
public int getNanosecond()Description copied from interface:Item
Return the only nanoseconds of the item, if it's DateTime, Time or Duration It will not convert hours, minutes and seconds into nanoseconds It exists only if the value in seconds will have decimal values, otherwise it will return 0- Specified by:
getNanosecond
in interfaceItem
- Returns:
- only nanoseconds
-