Package org.rumbledb.items
Class AnnotatedItem
java.lang.Object
org.rumbledb.items.AnnotatedItem
- All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable,Serializable,Item
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidMethod sets the parent item for all descendents of the current item.voidAppends an item to the item, if it is an array.voidappendItem(Item item) Appends an item to the item, if it is an array.voidappendSequence(List<Item> sequence) Appends a sequence to the item, if it is an array.XDM 3.1 Section 5.12 string-value Accessor.XDM 3.1 Section 5.1 attributes Accessor.baseUri()XDM 3.1 Section 5.2 base-uri Accessor.Casts the item to a decimal value (must be a numeric).doubleCasts the item to a double value (must be a numeric).floatCasts the item to a float value (must be a numeric).Casts the item to a big integer value (must be a numeric).intCasts the item to an integer value (must be a numeric).children()XDM 3.1 Section 5.3 children Accessor.Helper accessor for XML element nodes: returns namespace nodes for the namespace bindings declared directly on the element.XDM 3.1 Section 5.4 document-uri Accessor.booleanTests for logical equality.generateNativeQuery(NativeClauseContext context) Get sparkSql string for the itembyte[]Returns the byte[] value of the item, if it is an atomic item of type hexBinary or Base64Binary.Returns the body iterator, if it is a function item.booleanReturns the boolean value of the item, if it is a boolean.Returns the collection to which the item belongs, if any.booleanTests whether the item is an XML Text node.Returns the dateTime value of the item, if it is an atomic item of type dateTimeItem or dateItem or timeItem.intgetDay()Return only day of the item, if it's DateTime or Duration It will not convert months and years into days.Returns the decimal value of the item, if it is a decimal.Returns the DataFrame variable bindings, if it is a function item.doubleReturns the double value of the item, if it is a double.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 EpochMillisorg.apache.spark.ml.Estimator<?>floatReturns the float value of the item, if it is a float.intgetHour()Return only hour of the item, if it's DateTime, Time or DurationReturns the identifier (name and arity) of the function, if it is a function item.Returns the integer value of the item as a bit integer, if it is an integer.intReturns the int value of the item, if it is an int.getItemAt(int position) Returns the member of the item at the specified position if it is an array.getItemByKey(String key) Returns the value item associated with a specific key, if it is a map.getItemByKey(Item key) Returns the value item associated with a specific key, if it is an object.Returns the (possibly non-string) atomic keys of the item, if it is a map-like object.Returns the members of the item, if it is an array.getItems()Returns the members of the item if it is an array.Returns the values of the item, if it is a map.getKeys()Returns the string keys of the item, if it is a map.Returns the local variable bindings, if it is a function item.intReturn only minutes of the item, if it's DateTime, Time or Duration It will not convert hours into minutesReturns the module dynamic context, if it is a function item.intgetMonth()Return only month of the item, if it's DateTime or Duration It will not convert years into monthsintReturns the mutability level of the item.intReturn 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 0intOffset is an integer between −840 and 840 inclusiveReturns the names of the parameters of the function, if it is a function item.Returns the path from the top level object of a DeltaFile for the item.Returns the period value of the item, if it is a duration.Returns the expanded name of this item when it is an xs:QName.Returns the RDD variable bindings, if it is a function item.doubleReturn only seconds of the item, if it's DateTime, Time or Duration It will not convert hours and minutes into secondsgetSequenceAt(int position) Returns the member of the item at the specified position if it is an array.getSequenceByKey(String key) Returns the value sequence associated with a string key, if it is a map.getSequenceByKey(Item key) Returns the value sequence associated with a key, if it is a map-like object.Returns the member sequences of the item, if it is an array.Returns the value sequences of the item, if it is a map.Returns the signature of the function, if it is a function item.intgetSize()Returns the size of the item, if it is an array.Returns the SparkSQL type of the item for use in a query.Returns the SparkSQL value of the item for use in a query.getSparkSQLValue(ItemType itemType) Returns the SparkSQL value of the item for use in a query.Returns the string keys of the item, if it is a map.Returns the string value of the item, if it is an atomic item.Returns the location of the DeltaFile for the item.Returns the string value of the text item, if it is a text item.Returns the time value of the item, if it is an atomic item of type or timeItem.longReturns the top level ID of the item.doubleReturns the top level order (sequence number) identifierorg.apache.spark.ml.TransformerReturns the values of the item, if it is a map.Returns the Object containing the converted value of the item for a DataFrame.Get the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniquenessintgetYear()Return year of the item, if it's DateTime or DurationbooleanTests whether the item contains a representation of date or time (or both).inthashCode()Computes a hash code.booleanbooleanisAnyURI()Tests whether the item is an atomic item of type anyURI.booleanisArray()Tests whether the item is an array.booleanTests whether the item is an array of items.booleanisAtomic()Tests whether the item is an atomic item.booleanTests whether the item is an XML Attribute node.booleanTests whether the item is an atomic item of type base64Binary.booleanisBinary()Tests whether the item is an atomic item of type base64Binary or hexBinary.booleanTests whether the item is an atomic item of type default boolean.booleanbooleanisDate()Tests whether the item is an atomic item of type date.booleanTests whether the item is an atomic item of type dateTime.booleanTests whether the item is an atomic item of type dayTimeDuration.booleanTests whether the item is an atomic item of type decimal.booleanTests whether the item is an XML Document node.booleanisDouble()Tests whether the item is an atomic item of type double.booleanTests whether the item is an atomic item of type duration.booleanTests whether the item is an XML Element node.booleanbooleanisFloat()Tests whether the item is an atomic item of type float.booleanTests whether the item is a function.booleanisGDay()Tests whether the item is an atomic item of type gDay.booleanisGMonth()Tests whether the item is an atomic item of type gMonth.booleanTests whether the item is an atomic item of type gMonthDay.booleanisGYear()Tests whether the item is an atomic item of type gYear.booleanTests whether the item is an atomic item of type gMonthDay.booleanTests whether the item is an atomic item of type hexBinary.booleanisId()XDM 3.1 Section 5.5 is-id Accessor.booleanisIdrefs()XDM 3.1 Section 5.6 is-idrefs Accessor.booleanisInt()Tests whether the item is an atomic item of type int.booleanTests whether the item is an atomic item of type integer.booleanisMap()Tests whether the item is a map.booleanTests whether the item is an XML Namespace node.booleanisNaN()Checks doubles and floats for NaN.booleanisNode()Tests whether the item is an XML node.booleanisNull()Tests whether the item is the null item.booleanTests whether the item is a number (decimal or double).booleanisObject()Tests whether the item is an object.booleanisPeriod()Tests whether the item is an atomic item of type period.booleanTests whether the item is an XML Processing Instruction node.booleanisQName()Tests whether the item is an atomic item of type xs:QName (expanded QName, seeName).booleanisString()Tests whether the item is an atomic item of type string.booleanbooleanisTime()Tests whether the item is an atomic item of type time.booleanbooleanTests whether the item is an atomic item of type xs:untypedAtomic.booleanTests whether the item is an atomic item of type yearMonthDuration.XDM 3.1 Section 5.7 namespace-nodes Accessor.nilled()XDM 3.1 Section 5.8 nilled Accessor.nodeKind()XDM 3.1 Section 5.9 node-kind Accessor.nodeName()XDM 3.1 Section 5.10 node-name Accessor.parent()XDM 3.1 Section 5.11 parent Accessor.booleanphysicalEquals(Object other) Tests for physical equality.voidPuts an item at the given index, if it is an array.voidputItemByKey(String key, Item value) Adds a key-value pair, if it is a map.voidputItemByKey(Item key, Item value) Adds a key-value pair, if it is a map.voidputItemsAt(List<Item> items, int i) Add all items in items at index i, if it is an array.voidputLazyItemByKey(String key, RuntimeIterator iterator, DynamicContext context, boolean isArray) Adds a key-value pair, if it is a lazy object item.voidputSequenceAt(List<Item> sequence, int index) Puts a sequence at the given index, if it is an array.voidputSequenceByKey(String key, List<Item> valueSequence) Adds a key-sequence pair, if it is a map.voidputSequenceByKey(Item key, List<Item> valueSequence) Adds a key-sequence pair, if it is a map.voidputSequencesAt(List<List<Item>> sequences, int index) Puts sequences at the given index, if it is an array.voidread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) voidremoveItemAt(int index) Removes the item at the given index, if it is an array.voidremoveItemByKey(String key) Removes a key-value pair, if it is a map.voidremoveItemByKey(Item key) Removes a key-value pair, if it is a map.voidremoveSequenceAt(int index) Removes the sequence at the given index, if it is an array.voidsetCollection(Collection collection) Sets the collection to which the item belongs.voidsetMutabilityLevel(int mutabilityLevel) Sets the mutability level of the item to a supplied value.voidvoidSets the path from the top level object of a DeltaFile for the item to a supplied value.voidsetTableLocation(String location) Sets the location of the DeltaFile for the item to a supplied value.voidsetTopLevelID(long topLevelID) Sets the top level ID of the item to a supplied value.voidsetTopLevelOrder(double topLevelOrder) Sets the top level order parameter (rowOrder)intsetXmlDocumentPosition(String path, int current) Set the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniquenessXDM 3.1 Section 5.14 typed-value Accessor.typeName()XDM 3.1 Section 5.13 type-name Accessor.unparsedEntityPublicId(String name) XDM 3.1 Section 5.15 unparsed-entity-public-id Accessor.unparsedEntitySystemId(String name) XDM 3.1 Section 5.16 unparsed-entity-system-id Accessor.voidwrite(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, waitMethods inherited from interface org.rumbledb.api.Item
isBuiltinFunction
-
Constructor Details
-
AnnotatedItem
public AnnotatedItem() -
AnnotatedItem
-
-
Method Details
-
equals
Description copied from interface:ItemTests for logical equality. The semantics are that of the eq operator. -
hashCode
public int hashCode()Description copied from interface:ItemComputes a hash code. -
write
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) - Specified by:
writein interfacecom.esotericsoftware.kryo.KryoSerializable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
readin interfacecom.esotericsoftware.kryo.KryoSerializable
-
isFunction
public boolean isFunction()Description copied from interface:ItemTests whether the item is a function.- Specified by:
isFunctionin interfaceItem- Returns:
- true if it is a function, false otherwise
-
isAtomic
public boolean isAtomic()Description copied from interface:ItemTests whether the item is an atomic item. -
isString
public boolean isString()Description copied from interface:ItemTests whether the item is an atomic item of type string. -
isUntypedAtomic
public boolean isUntypedAtomic()Description copied from interface:ItemTests whether the item is an atomic item of type xs:untypedAtomic.- Specified by:
isUntypedAtomicin interfaceItem- Returns:
- true if it is an atomic item of type xs:untypedAtomic, false otherwise.
-
isBoolean
public boolean isBoolean()Description copied from interface:ItemTests whether the item is an atomic item of type default boolean. -
isNull
public boolean isNull()Description copied from interface:ItemTests whether the item is the null item. -
isNumeric
public boolean isNumeric()Description copied from interface:ItemTests whether the item is a number (decimal or double). -
isDecimal
public boolean isDecimal()Description copied from interface:ItemTests whether the item is an atomic item of type decimal. -
isInteger
public boolean isInteger()Description copied from interface:ItemTests whether the item is an atomic item of type integer. -
isInt
public boolean isInt()Description copied from interface:ItemTests whether the item is an atomic item of type int. -
isDouble
public boolean isDouble()Description copied from interface:ItemTests whether the item is an atomic item of type double. -
isFloat
public boolean isFloat()Description copied from interface:ItemTests whether the item is an atomic item of type float. -
isDuration
public boolean isDuration()Description copied from interface:ItemTests whether the item is an atomic item of type duration.- Specified by:
isDurationin interfaceItem- Returns:
- true if it is an atomic item of type duration, false otherwise.
-
isPeriod
public boolean isPeriod()Description copied from interface:ItemTests whether the item is an atomic item of type period. -
isYearMonthDuration
public boolean isYearMonthDuration()Description copied from interface:ItemTests whether the item is an atomic item of type yearMonthDuration.- Specified by:
isYearMonthDurationin interfaceItem- Returns:
- true if it is an atomic item of type yearMonthDuration, false otherwise.
-
isDayTimeDuration
public boolean isDayTimeDuration()Description copied from interface:ItemTests whether the item is an atomic item of type dayTimeDuration.- Specified by:
isDayTimeDurationin interfaceItem- Returns:
- true if it is an atomic item of type dayTimeDuration, false otherwise.
-
isDateTime
public boolean isDateTime()Description copied from interface:ItemTests whether the item is an atomic item of type dateTime.- Specified by:
isDateTimein interfaceItem- Returns:
- true if it is an atomic item of type dateTime, false otherwise.
-
isDate
public boolean isDate()Description copied from interface:ItemTests whether the item is an atomic item of type date. -
isTime
public boolean isTime()Description copied from interface:ItemTests whether the item is an atomic item of type time. -
isGDay
public boolean isGDay()Description copied from interface:ItemTests whether the item is an atomic item of type gDay. -
isGMonth
public boolean isGMonth()Description copied from interface:ItemTests whether the item is an atomic item of type gMonth. -
isGYear
public boolean isGYear()Description copied from interface:ItemTests whether the item is an atomic item of type gYear. -
isGMonthDay
public boolean isGMonthDay()Description copied from interface:ItemTests whether the item is an atomic item of type gMonthDay.- Specified by:
isGMonthDayin interfaceItem- Returns:
- true if it is an atomic item of type gMonthDay, false otherwise.
-
isGYearMonth
public boolean isGYearMonth()Description copied from interface:ItemTests whether the item is an atomic item of type gMonthDay.- Specified by:
isGYearMonthin interfaceItem- Returns:
- true if it is an atomic item of type gMonthDay, false otherwise.
-
isAnyURI
public boolean isAnyURI()Description copied from interface:ItemTests whether the item is an atomic item of type anyURI. -
isQName
public boolean isQName()Description copied from interface:ItemTests whether the item is an atomic item of type xs:QName (expanded QName, seeName). -
getQNameValue
Description copied from interface:ItemReturns the expanded name of this item when it is an xs:QName. Value equality followsName: same namespace URI and local name; the prefix is not significant for equality.- Specified by:
getQNameValuein interfaceItem- Returns:
- the expanded name.
-
isBinary
public boolean isBinary()Description copied from interface:ItemTests whether the item is an atomic item of type base64Binary or hexBinary. -
isHexBinary
public boolean isHexBinary()Description copied from interface:ItemTests whether the item is an atomic item of type hexBinary.- Specified by:
isHexBinaryin interfaceItem- Returns:
- true if it is an atomic item of type hexBinary, false otherwise.
-
isBase64Binary
public boolean isBase64Binary()Description copied from interface:ItemTests whether the item is an atomic item of type base64Binary.- Specified by:
isBase64Binaryin interfaceItem- Returns:
- true if it is an atomic item of type base64Binary, false otherwise.
-
isElementNode
public boolean isElementNode()Description copied from interface:ItemTests whether the item is an XML Element node.- Specified by:
isElementNodein interfaceItem- Returns:
- true if it is an XML Element node, false otherwise.
-
isAttributeNode
public boolean isAttributeNode()Description copied from interface:ItemTests whether the item is an XML Attribute node.- Specified by:
isAttributeNodein interfaceItem- Returns:
- true if it is an XML Attribute node, false otherwise.
-
getContent
public boolean getContent()Description copied from interface:ItemTests whether the item is an XML Text node.- Specified by:
getContentin interfaceItem- Returns:
- true if it is an XML Text node, false otherwise.
-
isDocumentNode
public boolean isDocumentNode()Description copied from interface:ItemTests whether the item is an XML Document node.- Specified by:
isDocumentNodein interfaceItem- Returns:
- true if it is an XML Document node, false otherwise.
-
isTextNode
public boolean isTextNode()- Specified by:
isTextNodein interfaceItem
-
isCommentNode
public boolean isCommentNode()- Specified by:
isCommentNodein interfaceItem
-
isNamespaceNode
public boolean isNamespaceNode()Description copied from interface:ItemTests whether the item is an XML Namespace node.- Specified by:
isNamespaceNodein interfaceItem- Returns:
- true if it is an XML Namespace node, false otherwise.
-
isProcessingInstructionNode
public boolean isProcessingInstructionNode()Description copied from interface:ItemTests whether the item is an XML Processing Instruction node.- Specified by:
isProcessingInstructionNodein interfaceItem- Returns:
- true if it is an XML Processing Instruction node, false otherwise.
-
isNode
public boolean isNode()Description copied from interface:ItemTests whether the item is an XML node. -
isMap
public boolean isMap()Description copied from interface:ItemTests whether the item is a map. -
isObject
public boolean isObject()Description copied from interface:ItemTests whether the item is an object. Object items are legacy JSONiq objects, that allow only for - string keys - singleton values -
getKeys
Description copied from interface:ItemReturns the string keys of the item, if it is a map. -
getStringKeys
Description copied from interface:ItemReturns the string keys of the item, if it is a map.- Specified by:
getStringKeysin interfaceItem- Returns:
- a list of strings, corresponding to the keys of the map.
-
getItemKeys
Description copied from interface:ItemReturns the (possibly non-string) atomic keys of the item, if it is a map-like object.- Specified by:
getItemKeysin interfaceItem- Returns:
- the list of atomic keys as items.
-
getValues
Description copied from interface:ItemReturns the values of the item, if it is a map. -
getItemValues
Description copied from interface:ItemReturns the values of the item, if it is a map.- Specified by:
getItemValuesin interfaceItem- Returns:
- a list containing, for each key in the map, the item associated with that key.
-
getSequenceValues
Description copied from interface:ItemReturns the value sequences of the item, if it is a map.- Specified by:
getSequenceValuesin interfaceItem- Returns:
- a list containing, for each key in the map, the sequence of items associated with that key.
-
getItemByKey
Description copied from interface:ItemReturns the value item associated with a specific key, if it is a map.- Specified by:
getItemByKeyin interfaceItem- Parameters:
key- a string key.- Returns:
- the item associated with the key, or null if absent.
-
getItemByKey
Description copied from interface:ItemReturns the value item associated with a specific key, if it is an object.- Specified by:
getItemByKeyin interfaceItem- Parameters:
key- a key item.- Returns:
- the item associated with the key, or null if absent.
-
getSequenceByKey
Description copied from interface:ItemReturns the value sequence associated with a string key, if it is a map.- Specified by:
getSequenceByKeyin interfaceItem- Parameters:
key- a string key.- Returns:
- the value sequence for the key, or null if absent.
-
getSequenceByKey
Description copied from interface:ItemReturns the value sequence associated with a key, if it is a map-like object.- Specified by:
getSequenceByKeyin interfaceItem- Parameters:
key- an atomic key item.- Returns:
- the value sequence for the key, or null if absent.
-
putItemByKey
Description copied from interface:ItemAdds a key-value pair, if it is a map.- Specified by:
putItemByKeyin interfaceItem- Parameters:
key- a key.value- a value.
-
putItemByKey
Description copied from interface:ItemAdds a key-value pair, if it is a map.- Specified by:
putItemByKeyin interfaceItem- Parameters:
key- an atomic key.value- a value.
-
putSequenceByKey
Description copied from interface:ItemAdds a key-sequence pair, if it is a map.- Specified by:
putSequenceByKeyin interfaceItem- Parameters:
key- an atomic key.valueSequence- a value sequence.
-
putSequenceByKey
public void putSequenceByKey(Item key, List<Item> valueSequence) throws UnsupportedOperationException, OurBadException, DuplicateObjectKeyException Description copied from interface:ItemAdds a key-sequence pair, if it is a map.- Specified by:
putSequenceByKeyin interfaceItem- Parameters:
key- an atomic key.valueSequence- a value sequence.- Throws:
UnsupportedOperationException- if the item is not a map.OurBadException- if the value sequence is not a singleton and the item does not support non-singleton values.DuplicateObjectKeyException- if the key is already present.
-
removeItemByKey
Description copied from interface:ItemRemoves a key-value pair, if it is a map.- Specified by:
removeItemByKeyin interfaceItem- Parameters:
key- a key.- Throws:
UnsupportedOperationException- if the item is not a map.
-
removeItemByKey
Description copied from interface:ItemRemoves a key-value pair, if it is a map.- Specified by:
removeItemByKeyin interfaceItem- Parameters:
key- an atomic key.- Throws:
UnsupportedOperationException- if the item is not a map.
-
putLazyItemByKey
public void putLazyItemByKey(String key, RuntimeIterator iterator, DynamicContext context, boolean isArray) throws UnsupportedOperationException Description copied from interface:ItemAdds a key-value pair, if it is a lazy object item. The value is lazily computed.- Specified by:
putLazyItemByKeyin interfaceItem- Parameters:
key- a key.iterator- a runtime iterator.context- a dynamic context.isArray- whether to always wrap the result in an array.- Throws:
UnsupportedOperationException- if the item is not a lazy object.
-
isArray
public boolean isArray()Description copied from interface:ItemTests whether the item is an array. -
isArrayOfItems
public boolean isArrayOfItems()Description copied from interface:ItemTests whether the item is an array of items. Arrays of items are arrays whose members are singletons.- Specified by:
isArrayOfItemsin interfaceItem- Returns:
- true if it is an array of items, false otherwise.
-
getSize
Description copied from interface:ItemReturns the size of the item, if it is an array.- Specified by:
getSizein interfaceItem- Returns:
- the size as an int.
- Throws:
UnsupportedOperationException- if the item is not an array.
-
getItems
Description copied from interface:ItemReturns the members of the item if it is an array. -
getItemMembers
Description copied from interface:ItemReturns the members of the item, if it is an array.- Specified by:
getItemMembersin interfaceItem- Returns:
- the list of the members.
- Throws:
UnsupportedOperationException- if the item is not an array.OurBadException- if any member of the array is a non-singleton.
-
getSequenceMembers
Description copied from interface:ItemReturns the member sequences of the item, if it is an array.- Specified by:
getSequenceMembersin interfaceItem- Returns:
- the list of the members.
- Throws:
UnsupportedOperationException- if the item is not an array.
-
getItemAt
Description copied from interface:ItemReturns the member of the item at the specified position if it is an array.- Specified by:
getItemAtin interfaceItem- Parameters:
position- the position of the member.- Returns:
- the member.
- Throws:
UnsupportedOperationException- if the item is not an array.OurBadException- if the member is a non-singleton.
-
getSequenceAt
Description copied from interface:ItemReturns the member of the item at the specified position if it is an array.- Specified by:
getSequenceAtin interfaceItem- Parameters:
position- the position of the member.- Returns:
- the member.
- Throws:
UnsupportedOperationException- if the item is not an array.
-
append
Description copied from interface:ItemAppends an item to the item, if it is an array.- Specified by:
appendin interfaceItem- Parameters:
item- the item to append.- Throws:
UnsupportedOperationException- if the item is not an array.
-
appendItem
Description copied from interface:ItemAppends an item to the item, if it is an array.- Specified by:
appendItemin interfaceItem- Parameters:
item- the item to append.- Throws:
UnsupportedOperationException- if the item is not an array.
-
appendSequence
public void appendSequence(List<Item> sequence) throws UnsupportedOperationException, OurBadException Description copied from interface:ItemAppends a sequence to the item, if it is an array.- Specified by:
appendSequencein interfaceItem- Parameters:
sequence- the sequence to append.- Throws:
UnsupportedOperationException- if the item is not an array.OurBadException- if the member is a non-singleton sequence and the array does not support non-singleton members.
-
putItemAt
Description copied from interface:ItemPuts an item at the given index, if it is an array.- Specified by:
putItemAtin interfaceItem- Parameters:
item- the item to put.index- the index to put the item at.- Throws:
UnsupportedOperationException- if the item is not an array.
-
putSequenceAt
public void putSequenceAt(List<Item> sequence, int index) throws UnsupportedOperationException, OurBadException Description copied from interface:ItemPuts a sequence at the given index, if it is an array.- Specified by:
putSequenceAtin interfaceItem- Parameters:
sequence- the sequence to put.index- the index to put the sequence at.- Throws:
UnsupportedOperationException- if the item is not an array.OurBadException- if the member is a non-singleton sequence and the array does not support non-singleton members.
-
putItemsAt
Description copied from interface:ItemAdd all items in items at index i, if it is an array.- Specified by:
putItemsAtin interfaceItem- Parameters:
items- a list of items.i- an integer.- Throws:
UnsupportedOperationException- if the item is not an array.
-
putSequencesAt
public void putSequencesAt(List<List<Item>> sequences, int index) throws UnsupportedOperationException, OurBadException Description copied from interface:ItemPuts sequences at the given index, if it is an array.- Specified by:
putSequencesAtin interfaceItem- Parameters:
sequences- the sequences to put.index- the index to put the sequence at.- Throws:
UnsupportedOperationException- if the item is not an array.OurBadException- if any member is a non-singleton sequence and the array does not support non-singleton members.
-
removeItemAt
Description copied from interface:ItemRemoves the item at the given index, if it is an array.- Specified by:
removeItemAtin interfaceItem- Parameters:
index- the index to remove the item at.- Throws:
UnsupportedOperationException- if the item is not an array.
-
removeSequenceAt
Description copied from interface:ItemRemoves the sequence at the given index, if it is an array.- Specified by:
removeSequenceAtin interfaceItem- Parameters:
index- the index to remove the sequence at.- Throws:
UnsupportedOperationException- if the item is not an array.
-
getStringValue
Description copied from interface:ItemReturns the string value of the item, if it is an atomic item.- Specified by:
getStringValuein interfaceItem- Returns:
- the string value.
-
getBooleanValue
public boolean getBooleanValue()Description copied from interface:ItemReturns the boolean value of the item, if it is a boolean.- Specified by:
getBooleanValuein interfaceItem- Returns:
- the boolean value.
-
getDoubleValue
public double getDoubleValue()Description copied from interface:ItemReturns the double value of the item, if it is a double.- Specified by:
getDoubleValuein interfaceItem- Returns:
- the double value.
-
getFloatValue
public float getFloatValue()Description copied from interface:ItemReturns the float value of the item, if it is a float.- Specified by:
getFloatValuein interfaceItem- Returns:
- the float value.
-
getIntValue
public int getIntValue()Description copied from interface:ItemReturns the int value of the item, if it is an int.- Specified by:
getIntValuein interfaceItem- Returns:
- the integer value as an int.
-
getIntegerValue
Description copied from interface:ItemReturns the integer value of the item as a bit integer, if it is an integer.- Specified by:
getIntegerValuein interfaceItem- Returns:
- the integer value as a BigInteger.
-
getDecimalValue
Description copied from interface:ItemReturns the decimal value of the item, if it is a decimal.- Specified by:
getDecimalValuein interfaceItem- Returns:
- the decimal value as a BigDecimal.
-
getPeriodValue
Description copied from interface:ItemReturns the period value of the item, if it is a duration.- Specified by:
getPeriodValuein interfaceItem- Returns:
- the period value as a Period.
-
getDurationValue
Description copied from interface:ItemReturns the duration value of the item, if it is a duration.- Specified by:
getDurationValuein interfaceItem- Returns:
- the duration value as a Duration.
-
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- Specified by:
getEpochMillisin interfaceItem- Returns:
- the EpochMillis
-
getDateTimeValue
Description copied from interface:ItemReturns the dateTime value of the item, if it is an atomic item of type dateTimeItem or dateItem or timeItem.- Specified by:
getDateTimeValuein interfaceItem- Returns:
- the dateTime value as a OffsetDateTime.
-
getTimeValue
Description copied from interface:ItemReturns the time value of the item, if it is an atomic item of type or timeItem.- Specified by:
getTimeValuein interfaceItem- Returns:
- the time value as a OffsetTime.
-
getYear
public int getYear()Description copied from interface:ItemReturn year of the item, if it's DateTime or Duration -
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 -
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. -
getOffset
public int getOffset()Description copied from interface:ItemOffset is an integer between −840 and 840 inclusive -
getHour
public int getHour()Description copied from interface:ItemReturn only hour of the item, if it's DateTime, Time or Duration -
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 -
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 -
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- Specified by:
getNanosecondin interfaceItem- Returns:
- only nanoseconds
-
getBinaryValue
public byte[] getBinaryValue()Description copied from interface:ItemReturns the byte[] value of the item, if it is an atomic item of type hexBinary or Base64Binary.- Specified by:
getBinaryValuein interfaceItem- Returns:
- the binary value as an array of bytes.
-
getDynamicType
Description copied from interface:ItemReturns the dynamic type of the item (only for error message purposes).- Specified by:
getDynamicTypein interfaceItem- Returns:
- the dynamic type as an item type.
-
getIdentifier
Description copied from interface:ItemReturns the identifier (name and arity) of the function, if it is a function item.- Specified by:
getIdentifierin interfaceItem- Returns:
- the function identifier.
-
getParameterNames
Description copied from interface:ItemReturns the names of the parameters of the function, if it is a function item.- Specified by:
getParameterNamesin interfaceItem- Returns:
- the function parameter names.
-
getSignature
Description copied from interface:ItemReturns the signature of the function, if it is a function item.- Specified by:
getSignaturein interfaceItem- Returns:
- the function signature.
-
getBodyIterator
Description copied from interface:ItemReturns the body iterator, if it is a function item.- Specified by:
getBodyIteratorin interfaceItem- Returns:
- the function signature.
-
getLocalVariablesInClosure
Description copied from interface:ItemReturns the local variable bindings, if it is a function item.- Specified by:
getLocalVariablesInClosurein interfaceItem- Returns:
- the function signature.
-
getRDDVariablesInClosure
Description copied from interface:ItemReturns the RDD variable bindings, if it is a function item.- Specified by:
getRDDVariablesInClosurein interfaceItem- Returns:
- the function signature.
-
getDFVariablesInClosure
Description copied from interface:ItemReturns the DataFrame variable bindings, if it is a function item.- Specified by:
getDFVariablesInClosurein interfaceItem- Returns:
- the function signature.
-
getModuleDynamicContext
Description copied from interface:ItemReturns the module dynamic context, if it is a function item.- Specified by:
getModuleDynamicContextin interfaceItem- Returns:
- the function signature.
-
hasTimeZone
public boolean hasTimeZone()- Specified by:
hasTimeZonein interfaceItem- Returns:
- true if the Item has a timeZone, false otherwise
-
hasDateTime
public boolean hasDateTime()Description copied from interface:ItemTests whether the item contains a representation of date or time (or both).- Specified by:
hasDateTimein interfaceItem- Returns:
- true if it is an atomic item of type time, date or dateTime, false otherwise.
-
getEffectiveBooleanValue
public boolean getEffectiveBooleanValue()Description copied from interface:ItemReturns the effective boolean value of the item, if atomic.- Specified by:
getEffectiveBooleanValuein interfaceItem- Returns:
- the effective boolean value.
-
castToDoubleValue
public double castToDoubleValue()Description copied from interface:ItemCasts the item to a double value (must be a numeric).- Specified by:
castToDoubleValuein interfaceItem- Returns:
- the double value.
-
castToFloatValue
public float castToFloatValue()Description copied from interface:ItemCasts the item to a float value (must be a numeric).- Specified by:
castToFloatValuein interfaceItem- Returns:
- the float value.
-
castToDecimalValue
Description copied from interface:ItemCasts the item to a decimal value (must be a numeric).- Specified by:
castToDecimalValuein interfaceItem- Returns:
- the BigDecimal value.
-
castToIntegerValue
Description copied from interface:ItemCasts the item to a big integer value (must be a numeric).- Specified by:
castToIntegerValuein interfaceItem- Returns:
- the BigInteger value.
-
castToIntValue
public int castToIntValue()Description copied from interface:ItemCasts the item to an integer value (must be a numeric).- Specified by:
castToIntValuein interfaceItem- Returns:
- the int value.
-
isNaN
public boolean isNaN()Description copied from interface:ItemChecks doubles and floats for NaN. -
generateNativeQuery
Description copied from interface:ItemGet sparkSql string for the item- Specified by:
generateNativeQueryin interfaceItem- Parameters:
context- input context- Returns:
- String representing the item in a sparksql query or null if it is not supported for the item
-
getSparkSQLValue
Description copied from interface:ItemReturns the SparkSQL value of the item for use in a query.- Specified by:
getSparkSQLValuein interfaceItem- Returns:
- String representing the SparkSQL value of the item.
-
getSparkSQLValue
Description copied from interface:ItemReturns the SparkSQL value of the item for use in a query.- Specified by:
getSparkSQLValuein interfaceItem- Returns:
- String representing the SparkSQL value of the item.
-
getSparkSQLType
Description copied from interface:ItemReturns the SparkSQL type of the item for use in a query.- Specified by:
getSparkSQLTypein interfaceItem- Returns:
- String representing the SparkSQL type of the item.
-
getVariantValue
Description copied from interface:ItemReturns the Object containing the converted value of the item for a DataFrame. For use to build Variant columns.- Specified by:
getVariantValuein interfaceItem- Returns:
- Object representing the converted value of the item.
-
physicalEquals
Description copied from interface:ItemTests for physical equality. The semantics are that of the eq operator.- Specified by:
physicalEqualsin interfaceItem- Parameters:
other- another item.- Returns:
- true it is equal to other, false otherwise.
-
isEstimator
public boolean isEstimator()- Specified by:
isEstimatorin interfaceItem
-
getEstimator
public org.apache.spark.ml.Estimator<?> getEstimator()- Specified by:
getEstimatorin interfaceItem
-
isTransformer
public boolean isTransformer()- Specified by:
isTransformerin interfaceItem
-
getTransformer
public org.apache.spark.ml.Transformer getTransformer()- Specified by:
getTransformerin interfaceItem
-
getTextValue
Description copied from interface:ItemReturns the string value of the text item, if it is a text item.- Specified by:
getTextValuein interfaceItem- Returns:
- the string value.
-
addParentToDescendants
public void addParentToDescendants()Description copied from interface:ItemMethod sets the parent item for all descendents of the current item.- Specified by:
addParentToDescendantsin interfaceItem
-
attributes
Description copied from interface:ItemXDM 3.1 Section 5.1 attributes Accessor. dm:attributes($n as node()) as attribute()* "The dm:attributes accessor returns the dynamic, unordered set of attribute nodes that have the node as their parent. It is defined only on element and document nodes; for other node kinds it returns the empty sequence."- Specified by:
attributesin interfaceItem
-
children
Description copied from interface:ItemXDM 3.1 Section 5.3 children Accessor. dm:children($n as node()) as node()* "The dm:children accessor returns the dynamic, ordered sequence of child nodes of the node. It is defined on all node kinds except attribute and namespace nodes; for those node kinds it returns the empty sequence." -
namespaceNodes
Description copied from interface:ItemXDM 3.1 Section 5.7 namespace-nodes Accessor. dm:namespace-nodes($n as node()) as namespace-node()* "The dm:namespace-nodes accessor returns the dynamic, unordered set of Namespace Nodes. It is defined on all seven node kinds." This default implementation is only a placeholder on the generic Item interface and must be overridden by XML node implementations that support namespaces.- Specified by:
namespaceNodesin interfaceItem
-
declaredNamespaceNodes
Description copied from interface:ItemHelper accessor for XML element nodes: returns namespace nodes for the namespace bindings declared directly on the element. This does not include inherited or statically known namespaces — only the bindings explicitly declared on the element (for example via xmlns attributes). Non-element nodes must override this to return the empty sequence.- Specified by:
declaredNamespaceNodesin interfaceItem
-
nodeKind
Description copied from interface:ItemXDM 3.1 Section 5.9 node-kind Accessor. dm:node-kind($n as node()) as xs:string "The dm:node-kind accessor returns the kind of the node. The node kind is one of the strings \"document\", \"element\", \"attribute\", \"text\", \"namespace\", \"processing-instruction\", or \"comment\"." This default implementation is only a placeholder on the generic Item interface and must be overridden by XML node implementations. -
baseUri
Description copied from interface:ItemXDM 3.1 Section 5.2 base-uri Accessor. dm:base-uri($n as node()) as xs:anyURI? "The dm:base-uri accessor returns the value of the base-uri property of the node, if it has one; otherwise it returns the empty sequence." -
documentUri
Description copied from interface:ItemXDM 3.1 Section 5.4 document-uri Accessor. dm:document-uri($n as document-node()) as xs:anyURI? "The dm:document-uri accessor returns the value of the document-uri property of a document node, if it has one; otherwise it returns the empty sequence."- Specified by:
documentUriin interfaceItem
-
isId
public boolean isId()Description copied from interface:ItemXDM 3.1 Section 5.5 is-id Accessor. dm:is-id($n as node()) as xs:boolean "The dm:is-id accessor returns true if the node is an attribute node whose type is xs:ID or is derived by restriction from xs:ID; otherwise it returns false." -
isIdrefs
public boolean isIdrefs()Description copied from interface:ItemXDM 3.1 Section 5.6 is-idrefs Accessor. dm:is-idrefs($n as node()) as xs:boolean "The dm:is-idrefs accessor returns true if the node is an attribute node whose type is xs:IDREF or xs:IDREFS or is derived by restriction from one of these types; otherwise it returns false." -
nilled
Description copied from interface:ItemXDM 3.1 Section 5.8 nilled Accessor. dm:nilled($n as node()) as xs:boolean? "The dm:nilled accessor returns true if the element node is nilled, false if the element node is not nilled, or the empty sequence if the concept of nilled does not apply." In this API, the optional xs:boolean result is represented as a sequence of zero or one Items. -
typeName
Description copied from interface:ItemXDM 3.1 Section 5.13 type-name Accessor. dm:type-name($n as node()) as xs:QName? "The dm:type-name accessor returns the name of the dynamic type of the node, or the empty sequence if the node is untyped." -
typedValue
Description copied from interface:ItemXDM 3.1 Section 5.14 typed-value Accessor. dm:typed-value($n as node()) as xs:anyAtomicType* "The dm:typed-value accessor returns the typed value of the node as a sequence of zero or more atomic values." In this API, the typed value is exposed as a sequence of Items, which are expected to be atomic items in the XDM sense.- Specified by:
typedValuein interfaceItem
-
unparsedEntityPublicId
Description copied from interface:ItemXDM 3.1 Section 5.15 unparsed-entity-public-id Accessor. dm:unparsed-entity-public-id($n as document-node(), $name as xs:string) as xs:string? "The dm:unparsed-entity-public-id accessor returns the public identifier of an unparsed entity with a given name in the document, or the empty sequence if there is no such entity or if it has no public identifier."- Specified by:
unparsedEntityPublicIdin interfaceItem
-
unparsedEntitySystemId
Description copied from interface:ItemXDM 3.1 Section 5.16 unparsed-entity-system-id Accessor. dm:unparsed-entity-system-id($n as document-node(), $name as xs:string) as xs:anyURI? "The dm:unparsed-entity-system-id accessor returns the system identifier of an unparsed entity with a given name in the document, or the empty sequence if there is no such entity or if it has no system identifier."- Specified by:
unparsedEntitySystemIdin interfaceItem
-
nodeName
Description copied from interface:ItemXDM 3.1 Section 5.10 node-name Accessor. dm:node-name($n as node()) as xs:QName? "The dm:node-name accessor returns the name of the node as an xs:QName, or the empty sequence if the node does not have a name." -
parent
Description copied from interface:ItemXDM 3.1 Section 5.11 parent Accessor. dm:parent($n as node()) as node()? "The dm:parent accessor returns the parent of the node, or the empty sequence if the node has no parent." -
setParent
-
getXmlDocumentPosition
Description copied from interface:ItemGet the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness- Specified by:
getXmlDocumentPositionin interfaceItem- Returns:
- the XML document position
-
setXmlDocumentPosition
Description copied from interface:ItemSet the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness- Specified by:
setXmlDocumentPositionin interfaceItem- Parameters:
path- the path of the XML documentcurrent- the current position- Returns:
- the new position
-
getCollection
Description copied from interface:ItemReturns the collection to which the item belongs, if any. Only defined for top-level items.- Specified by:
getCollectionin interfaceItem- Returns:
- the collection.
-
setCollection
Description copied from interface:ItemSets the collection to which the item belongs. Only defined for top-level items.- Specified by:
setCollectionin interfaceItem- Parameters:
collection- the collection.
-
getMutabilityLevel
public int getMutabilityLevel()Description copied from interface:ItemReturns the mutability level of the item.- Specified by:
getMutabilityLevelin interfaceItem- Returns:
- an int representing nestedness of the item inside transform expressions.
-
setMutabilityLevel
public void setMutabilityLevel(int mutabilityLevel) Description copied from interface:ItemSets the mutability level of the item to a supplied value.- Specified by:
setMutabilityLevelin interfaceItem- Parameters:
mutabilityLevel- new mutability level.
-
getTopLevelID
public long getTopLevelID()Description copied from interface:ItemReturns the top level ID of the item.- Specified by:
getTopLevelIDin interfaceItem- Returns:
- int representing the rowID of the item within a DeltaFile.
-
setTopLevelID
public void setTopLevelID(long topLevelID) Description copied from interface:ItemSets the top level ID of the item to a supplied value.- Specified by:
setTopLevelIDin interfaceItem- Parameters:
topLevelID- new top level ID.
-
getPathIn
Description copied from interface:ItemReturns the path from the top level object of a DeltaFile for the item. -
setPathIn
Description copied from interface:ItemSets the path from the top level object of a DeltaFile for the item to a supplied value. -
getTableLocation
Description copied from interface:ItemReturns the location of the DeltaFile for the item.- Specified by:
getTableLocationin interfaceItem- Returns:
- String representing the location of the DeltaFile for the item.
-
setTableLocation
Description copied from interface:ItemSets the location of the DeltaFile for the item to a supplied value.- Specified by:
setTableLocationin interfaceItem- Parameters:
location- new location of the DeltaFile for the item.
-
getTopLevelOrder
public double getTopLevelOrder()Description copied from interface:ItemReturns the top level order (sequence number) identifier- Specified by:
getTopLevelOrderin interfaceItem- Returns:
- double representing rowOrder of the tuple
-
setTopLevelOrder
public void setTopLevelOrder(double topLevelOrder) Description copied from interface:ItemSets the top level order parameter (rowOrder)- Specified by:
setTopLevelOrderin interfaceItem- Parameters:
topLevelOrder- new rowOrder value
-
atomizedValue
Description copied from interface:ItemXDM 3.1 Section 5.12 string-value Accessor. dm:string-value($n as node()) as xs:string "The dm:string-value accessor returns the string-value of the node as defined for each node kind." In this API, node string values are exposed via getStringValue() and the default implementation of dm:typed-value delegates to atomizedValue().- Specified by:
atomizedValuein interfaceItem
-
serialize
-
serializeAsJSON
- Specified by:
serializeAsJSONin interfaceItem
-