Package org.rumbledb.items
Class DurationItem
java.lang.Object
org.rumbledb.items.AbstractAtomicItem
org.rumbledb.items.DurationItem
- All Implemented Interfaces:
Serializable,Item
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDurationItem(String value) DurationItem(Duration value) DurationItem(Period value) -
Method Summary
Modifier and TypeMethodDescriptioncopy(boolean mutable) Makes a copy.intgetDay()Return only day of the item, if it's DateTime or Duration It will not convert months and years into days.Returns the day-time (seconds) component of a duration item, i.e., the value of the duration excluding its months component.Returns the duration value of the item, if it is a duration.Returns the dynamic type of the item (only for error message purposes).booleanReturns the effective boolean value of the item, if atomic.longReturns 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 EpochMillisintgetHour()Return only hour of the item, if it's DateTime, Time or DurationintReturn only minutes of the item, if it's DateTime, Time or Duration It will not convert hours into minutesintgetMonth()Return only month of the item, if it's DateTime or Duration It will not convert years into monthsintReturn 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.doubleReturn 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.intgetYear()Return year of the item, if it's DateTime or DurationbooleanisAtomic()Tests whether the item is an atomic item.booleanTests whether the item is an atomic item of type duration.static StringnormalizeDuration(Period period, Duration duration) static PeriodnormalizeMonthsToYears(Period period) Methods inherited from class org.rumbledb.items.AbstractAtomicItem
equals, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.rumbledb.api.Item
addOrReplaceNamespace, addParentToDescendants, appendItem, appendSequence, atomizedValue, attributes, baseUri, castToDecimalValue, castToDoubleValue, castToFloatValue, castToIntegerValue, castToIntValue, children, clearSchemaType, declaredNamespaceNodes, documentUri, generateNativeQuery, getBinaryValue, getBodyIterator, getBooleanValue, getCollection, getContent, getDateTimeValue, getDecimalValue, getDFVariablesInClosure, getDoubleValue, getEstimator, getFloatValue, getIdentifier, getIntegerValue, getIntValue, getItemAt, getItemByKey, getItemByKey, getItemKeys, getItemMembers, getItemValues, getLocalVariablesInClosure, getModuleDynamicContext, getMutabilityLevel, getNotationValue, getOffset, getParameterNames, getPathIn, getQNameValue, getRDDVariablesInClosure, getSchemaTypeAnnotation, getSequenceAt, getSequenceByKey, getSequenceByKey, getSequenceMembers, getSequenceValues, getSignature, getSize, getSparkSQLType, getSparkSQLValue, getSparkSQLValue, getStringKeys, getTableLocation, getTextValue, getTimeValue, getTopLevelID, getTopLevelOrder, getTransformer, getVariantValue, getXmlDocumentPosition, hasDateTime, hasKey, hasKey, hasTimeZone, isAnyURI, isArray, isArrayOfItems, isAttributeNode, isBase64Binary, isBinary, isBoolean, isBuiltinFunction, isCommentNode, isDate, isDateTime, isDayTimeDuration, isDecimal, isDocumentNode, isDouble, isElementNode, isEstimator, isFloat, isFunction, isGDay, isGMonth, isGMonthDay, isGYear, isGYearMonth, isHexBinary, isId, isIdrefs, isInt, isInteger, isMap, isNamespaceNode, isNaN, isNode, isNotation, isNull, isNumeric, isObject, isPeriod, isProcessingInstructionNode, isQName, isString, isTextNode, isTime, isTransformer, isUntypedAtomic, isYearMonthDuration, namespaceNodes, nilled, nodeKind, nodeName, parent, physicalEquals, putItemAt, putItemByKey, putItemByKey, putItemsAt, putLazyItemByKey, putSequenceAt, putSequenceByKey, putSequenceByKey, putSequencesAt, removeItemAt, removeItemByKey, removeItemByKey, removeSequenceAt, serialize, serializeAsJSON, setCollection, setMutabilityLevel, setParent, setPathIn, setSchemaType, setSchemaType, setTableLocation, setTopLevelID, setTopLevelOrder, setXmlDocumentPosition, setXmlSchemaIdentityProperties, setXmlSchemaNilled, typedValue, typeName, unparsedEntityPublicId, unparsedEntitySystemId
-
Field Details
-
periodComparator
-
-
Constructor Details
-
DurationItem
-
DurationItem
-
DurationItem
-
-
Method Details
-
copy
Description copied from interface:ItemMakes a copy.- Parameters:
mutable- whether the copy should be mutable (if supported by the item).- Returns:
- a copy
-
getDurationValue
Description copied from interface:ItemReturns the duration value of the item, if it is a duration.- Returns:
- the duration value as a Duration.
-
getPeriodValue
Description copied from interface:ItemReturns the period value of the item, if it is a duration.- Returns:
- the period value as a Period.
-
getDayTimeDurationComponent
Description copied from interface:ItemReturns the day-time (seconds) component of a duration item, i.e., the value of the duration excluding its months component. Unlike getDurationValue(), this is not anchored to any reference date, since days, hours, minutes and seconds have a fixed length and can be converted to a Duration unambiguously.- Returns:
- the day-time component as a Duration.
-
getStringValue
Description copied from interface:ItemReturns the string value of the item, if it is an atomic item.- Returns:
- the string value.
-
isAtomic
public boolean isAtomic()Description copied from interface:ItemTests whether the item is an atomic item.- Returns:
- true if it is an atomic item, false otherwise.
-
isDuration
public boolean isDuration()Description copied from interface:ItemTests whether the item is an atomic item of type duration.- Returns:
- true if it is an atomic item of type duration, false otherwise.
-
getEffectiveBooleanValue
public boolean getEffectiveBooleanValue()Description copied from interface:ItemReturns the effective boolean value of the item, if atomic.- Returns:
- the effective boolean value.
-
getDynamicType
Description copied from interface:ItemReturns the dynamic type of the item (only for error message purposes).- Returns:
- the dynamic type as an item type.
-
getEpochMillis
public long getEpochMillis()Description copied from interface:ItemReturns 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- Returns:
- the EpochMillis
-
normalizeDuration
-
normalizeMonthsToYears
-
getYear
public int getYear()Description copied from interface:ItemReturn year of the item, if it's DateTime or Duration- Returns:
- year
-
getMonth
public int getMonth()Description copied from interface:ItemReturn only month of the item, if it's DateTime or Duration It will not convert years into months- Returns:
- only month
-
getDay
public int getDay()Description copied from interface:ItemReturn only day of the item, if it's DateTime or Duration It will not convert months and years into days.- Returns:
- only day
-
getHour
public int getHour()Description copied from interface:ItemReturn only hour of the item, if it's DateTime, Time or Duration- Returns:
- only hour
-
getMinute
public int getMinute()Description copied from interface:ItemReturn only minutes of the item, if it's DateTime, Time or Duration It will not convert hours into minutes- Returns:
- only minute
-
getSecond
public double getSecond()Description copied from interface:ItemReturn only seconds of the item, if it's DateTime, Time or Duration It will not convert hours and minutes into seconds- Returns:
- only seconds
-
getNanosecond
public int getNanosecond()Description copied from interface:ItemReturn 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- Returns:
- only nanoseconds
-