Interface Item

All Superinterfaces:
com.esotericsoftware.kryo.KryoSerializable, Serializable
All Known Implementing Classes:
AnnotatedItem, AnyURIItem, ArrayItem, AttributeItem, Base64BinaryItem, BooleanItem, CommentItem, DateItem, DateTimeItem, DateTimeStampItem, DayTimeDurationItem, DecimalItem, DocumentItem, DoubleItem, DurationItem, ElementItem, FloatItem, FunctionItem, gDayItem, gMonthDayItem, gMonthItem, gYearItem, gYearMonthItem, HexBinaryItem, IntegerItem, IntItem, LazyObjectItem, MapItem, NamespaceItem, NullItem, ObjectItem, ProcessingInstructionItem, QNameItem, SequenceArrayItem, StringItem, TextItem, TimeItem, UntypedAtomicItem, YearMonthDurationItem

public interface Item extends Serializable, com.esotericsoftware.kryo.KryoSerializable
An instance of this class is an item in the JSONiq data model. JSONiq manipulates sequences of items. All calls should be made via this interface. Objects of type Item should never be cast to a subclass (in a subsequent version, we will make the classes implementing this interface visible only at the package level). An item can be structured or atomic or a function. Structured items include objects and arrays. Objects are mappings from strings (keys) to items. Arrays are ordered lists of items. Atomic items have a lexical value and a type. Rumble does not support all atomic types yet.
Author:
Ghislain Fourny, Stefan Irimescu, Can Berker Cikis
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Method sets the parent item for all descendents of the current item.
    default void
    append(Item item)
    Deprecated.
    use appendItem(Item) instead
    default void
    Appends an item to the item, if it is an array.
    default void
    Appends a sequence to the item, if it is an array.
    default List<Item>
    XDM 3.1 Section 5.12 string-value Accessor.
    default List<Item>
    XDM 3.1 Section 5.1 attributes Accessor.
    default List<Item>
    XDM 3.1 Section 5.2 base-uri Accessor.
    default BigDecimal
    Casts the item to a decimal value (must be a numeric).
    default double
    Casts the item to a double value (must be a numeric).
    default float
    Casts the item to a float value (must be a numeric).
    default BigInteger
    Casts the item to a big integer value (must be a numeric).
    default int
    Casts the item to an integer value (must be a numeric).
    default List<Item>
    XDM 3.1 Section 5.3 children Accessor.
    default List<Item>
    Helper accessor for XML element nodes: returns namespace nodes for the namespace bindings declared directly on the element.
    default List<Item>
    XDM 3.1 Section 5.4 document-uri Accessor.
    boolean
    equals(Object other)
    Tests for logical equality.
    Get sparkSql string for the item
    default byte[]
    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.
    default boolean
    Returns the boolean value of the item, if it is a boolean.
    default Collection
    Returns the collection to which the item belongs, if any.
    default boolean
    Tests 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.
    default int
    Return only day of the item, if it's DateTime or Duration It will not convert months and years into days.
    default BigDecimal
    Returns the decimal value of the item, if it is a decimal.
    Returns the DataFrame variable bindings, if it is a function item.
    default double
    Returns the double value of the item, if it is a double.
    default Duration
    Returns the duration value of the item, if it is a duration.
    default ItemType
    Returns the dynamic type of the item (only for error message purposes).
    default boolean
    Returns the effective boolean value of the item, if atomic.
    default 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 EpochMillis
    default org.apache.spark.ml.Estimator<?>
     
    default float
    Returns the float value of the item, if it is a float.
    default int
    Return only hour of the item, if it's DateTime, Time or Duration
    Returns the identifier (name and arity) of the function, if it is a function item.
    default BigInteger
    Returns the integer value of the item as a bit integer, if it is an integer.
    default int
    Returns the int value of the item, if it is an int.
    default Item
    getItemAt(int position)
    Returns the member of the item at the specified position if it is an array.
    default Item
    Returns the value item associated with a specific key, if it is a map.
    default Item
    Returns the value item associated with a specific key, if it is an object.
    default List<Item>
    Returns the (possibly non-string) atomic keys of the item, if it is a map-like object.
    default List<Item>
    Returns the members of the item, if it is an array.
    default List<Item>
    Deprecated.
    use getItemMembers() instead
    default List<Item>
    Returns the values of the item, if it is a map.
    default List<String>
    Deprecated.
    use getStringKeys() instead
    default Map<Name,List<Item>>
    Returns the local variable bindings, if it is a function item.
    default int
    Return only minutes of the item, if it's DateTime, Time or Duration It will not convert hours into minutes
    Returns the module dynamic context, if it is a function item.
    default int
    Return only month of the item, if it's DateTime or Duration It will not convert years into months
    default int
    Returns the mutability level of the item.
    default int
    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
    default int
    Offset is an integer between −840 and 840 inclusive
    default List<Name>
    Returns the names of the parameters of the function, if it is a function item.
    default String
    Returns the path from the top level object of a DeltaFile for the item.
    default Period
    Returns the period value of the item, if it is a duration.
    default Name
    Returns the expanded name of this item when it is an xs:QName.
    default Map<Name,org.apache.spark.api.java.JavaRDD<Item>>
    Returns the RDD variable bindings, if it is a function item.
    default double
    Return only seconds of the item, if it's DateTime, Time or Duration It will not convert hours and minutes into seconds
    default List<Item>
    getSequenceAt(int position)
    Returns the member of the item at the specified position if it is an array.
    default List<Item>
    Returns the value sequence associated with a string key, if it is a map.
    default List<Item>
    Returns the value sequence associated with a key, if it is a map-like object.
    default List<List<Item>>
    Returns the member sequences of the item, if it is an array.
    default List<List<Item>>
    Returns the value sequences of the item, if it is a map.
    Returns the signature of the function, if it is a function item.
    default int
    Returns the size of the item, if it is an array.
    default String
    Returns the SparkSQL type of the item for use in a query.
    default String
    Returns the SparkSQL value of the item for use in a query.
    default String
    Returns the SparkSQL value of the item for use in a query.
    default List<String>
    Returns the string keys of the item, if it is a map.
    default String
    Returns the string value of the item, if it is an atomic item.
    default String
    Returns the location of the DeltaFile for the item.
    default String
    Returns the string value of the text item, if it is a text item.
    default OffsetTime
    Returns the time value of the item, if it is an atomic item of type or timeItem.
    default long
    Returns the top level ID of the item.
    default double
    Returns the top level order (sequence number) identifier
    default org.apache.spark.ml.Transformer
     
    default List<Item>
    Deprecated.
    use getItemValues() instead
    default Object
    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 / uniqueness
    default int
    Return year of the item, if it's DateTime or Duration
    default boolean
    Tests whether the item contains a representation of date or time (or both).
    int
    Computes a hash code.
    default boolean
     
    default boolean
    Tests whether the item is an atomic item of type anyURI.
    default boolean
    Tests whether the item is an array.
    default boolean
    Tests whether the item is an array of items.
    default boolean
    Tests whether the item is an atomic item.
    default boolean
    Tests whether the item is an XML Attribute node.
    default boolean
    Tests whether the item is an atomic item of type base64Binary.
    default boolean
    Tests whether the item is an atomic item of type base64Binary or hexBinary.
    default boolean
    Tests whether the item is an atomic item of type default boolean.
    default boolean
    Whether this item is a function item representing a builtin function.
    default boolean
     
    default boolean
    Tests whether the item is an atomic item of type date.
    default boolean
    Tests whether the item is an atomic item of type dateTime.
    default boolean
    Tests whether the item is an atomic item of type dayTimeDuration.
    default boolean
    Tests whether the item is an atomic item of type decimal.
    default boolean
    Tests whether the item is an XML Document node.
    default boolean
    Tests whether the item is an atomic item of type double.
    default boolean
    Tests whether the item is an atomic item of type duration.
    default boolean
    Tests whether the item is an XML Element node.
    default boolean
     
    default boolean
    Tests whether the item is an atomic item of type float.
    default boolean
    Tests whether the item is a function.
    default boolean
    Tests whether the item is an atomic item of type gDay.
    default boolean
    Tests whether the item is an atomic item of type gMonth.
    default boolean
    Tests whether the item is an atomic item of type gMonthDay.
    default boolean
    Tests whether the item is an atomic item of type gYear.
    default boolean
    Tests whether the item is an atomic item of type gMonthDay.
    default boolean
    Tests whether the item is an atomic item of type hexBinary.
    default boolean
    XDM 3.1 Section 5.5 is-id Accessor.
    default boolean
    XDM 3.1 Section 5.6 is-idrefs Accessor.
    default boolean
    Tests whether the item is an atomic item of type int.
    default boolean
    Tests whether the item is an atomic item of type integer.
    default boolean
    Tests whether the item is a map.
    default boolean
    Tests whether the item is an XML Namespace node.
    default boolean
    Checks doubles and floats for NaN.
    default boolean
    Tests whether the item is an XML node.
    default boolean
    Tests whether the item is the null item.
    default boolean
    Tests whether the item is a number (decimal or double).
    default boolean
    Tests whether the item is an object.
    default boolean
    Tests whether the item is an atomic item of type period.
    default boolean
    Tests whether the item is an XML Processing Instruction node.
    default boolean
    Tests whether the item is an atomic item of type xs:QName (expanded QName, see Name).
    default boolean
    Tests whether the item is an atomic item of type string.
    default boolean
     
    default boolean
    Tests whether the item is an atomic item of type time.
    default boolean
     
    default boolean
    Tests whether the item is an atomic item of type xs:untypedAtomic.
    default boolean
    Tests whether the item is an atomic item of type yearMonthDuration.
    default List<Item>
    XDM 3.1 Section 5.7 namespace-nodes Accessor.
    default List<Item>
    XDM 3.1 Section 5.8 nilled Accessor.
    default String
    XDM 3.1 Section 5.9 node-kind Accessor.
    default Name
    XDM 3.1 Section 5.10 node-name Accessor.
    default Item
    XDM 3.1 Section 5.11 parent Accessor.
    default boolean
    Tests for physical equality.
    default void
    putItemAt(Item item, int index)
    Puts an item at the given index, if it is an array.
    default void
    putItemByKey(String key, Item value)
    Adds a key-value pair, if it is a map.
    default void
    putItemByKey(Item key, Item value)
    Adds a key-value pair, if it is a map.
    default void
    putItemsAt(List<Item> items, int i)
    Add all items in items at index i, if it is an array.
    default void
    putLazyItemByKey(String key, RuntimeIterator iterator, DynamicContext context, boolean isArray)
    Adds a key-value pair, if it is a lazy object item.
    default void
    putSequenceAt(List<Item> sequence, int index)
    Puts a sequence at the given index, if it is an array.
    default void
    putSequenceByKey(String key, List<Item> valueSequence)
    Adds a key-sequence pair, if it is a map.
    default void
    putSequenceByKey(Item key, List<Item> valueSequence)
    Adds a key-sequence pair, if it is a map.
    default void
    putSequencesAt(List<List<Item>> sequences, int index)
    Puts sequences at the given index, if it is an array.
    default void
    removeItemAt(int index)
    Removes the item at the given index, if it is an array.
    default void
    Removes a key-value pair, if it is a map.
    default void
    Removes a key-value pair, if it is a map.
    default void
    removeSequenceAt(int index)
    Removes the sequence at the given index, if it is an array.
    default String
     
    default String
     
    default void
    Sets the collection to which the item belongs.
    default void
    setMutabilityLevel(int mutabilityLevel)
    Sets the mutability level of the item to a supplied value.
    default void
    setParent(Item parent)
     
    default void
    setPathIn(String pathIn)
    Sets the path from the top level object of a DeltaFile for the item to a supplied value.
    default void
    Sets the location of the DeltaFile for the item to a supplied value.
    default void
    setTopLevelID(long topLevelID)
    Sets the top level ID of the item to a supplied value.
    default void
    setTopLevelOrder(double topLevelOrder)
    Sets the top level order parameter (rowOrder)
    default int
    setXmlDocumentPosition(String path, int current)
    Set the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness
    default List<Item>
    XDM 3.1 Section 5.14 typed-value Accessor.
    default List<Item>
    XDM 3.1 Section 5.13 type-name Accessor.
    default List<Item>
    XDM 3.1 Section 5.15 unparsed-entity-public-id Accessor.
    default List<Item>
    XDM 3.1 Section 5.16 unparsed-entity-system-id Accessor.

    Methods inherited from interface com.esotericsoftware.kryo.KryoSerializable

    read, write
  • Method Details

    • isFunction

      default boolean isFunction()
      Tests whether the item is a function.
      Returns:
      true if it is a function, false otherwise
    • isBuiltinFunction

      default boolean isBuiltinFunction()
      Whether this item is a function item representing a builtin function.
    • isAtomic

      default boolean isAtomic()
      Tests whether the item is an atomic item.
      Returns:
      true if it is an atomic item, false otherwise.
    • isString

      default boolean isString()
      Tests whether the item is an atomic item of type string.
      Returns:
      true if it is an atomic item of type string, false otherwise.
    • isUntypedAtomic

      default boolean isUntypedAtomic()
      Tests whether the item is an atomic item of type xs:untypedAtomic.
      Returns:
      true if it is an atomic item of type xs:untypedAtomic, false otherwise.
    • isBoolean

      default boolean isBoolean()
      Tests whether the item is an atomic item of type default boolean.
      Returns:
      true if it is an atomic item of type default boolean, false otherwise.
    • isNull

      default boolean isNull()
      Tests whether the item is the null item.
      Returns:
      true if it is the null item, false otherwise.
    • isNumeric

      default boolean isNumeric()
      Tests whether the item is a number (decimal or double).
      Returns:
      true if it is a number, false otherwise.
    • isDecimal

      default boolean isDecimal()
      Tests whether the item is an atomic item of type decimal.
      Returns:
      true if it is an atomic item of type decimal, false otherwise.
    • isInteger

      default boolean isInteger()
      Tests whether the item is an atomic item of type integer.
      Returns:
      true if it is an atomic item of type integer, false otherwise.
    • isInt

      default boolean isInt()
      Tests whether the item is an atomic item of type int.
      Returns:
      true if it is an atomic item of type int, false otherwise.
    • isDouble

      default boolean isDouble()
      Tests whether the item is an atomic item of type double.
      Returns:
      true if it is an atomic item of type double, false otherwise.
    • isFloat

      default boolean isFloat()
      Tests whether the item is an atomic item of type float.
      Returns:
      true if it is an atomic item of type float, false otherwise.
    • isDuration

      default boolean isDuration()
      Tests whether the item is an atomic item of type duration.
      Returns:
      true if it is an atomic item of type duration, false otherwise.
    • isPeriod

      default boolean isPeriod()
      Tests whether the item is an atomic item of type period.
      Returns:
      true if it is an atomic item of type period, false otherwise.
    • isYearMonthDuration

      default boolean isYearMonthDuration()
      Tests whether the item is an atomic item of type yearMonthDuration.
      Returns:
      true if it is an atomic item of type yearMonthDuration, false otherwise.
    • isDayTimeDuration

      default boolean isDayTimeDuration()
      Tests whether the item is an atomic item of type dayTimeDuration.
      Returns:
      true if it is an atomic item of type dayTimeDuration, false otherwise.
    • getMonth

      default int getMonth()
      Return only month of the item, if it's DateTime or Duration It will not convert years into months
      Returns:
      only month
    • getYear

      default int getYear()
      Return year of the item, if it's DateTime or Duration
      Returns:
      year
    • getDay

      default int getDay()
      Return only day of the item, if it's DateTime or Duration It will not convert months and years into days.
      Returns:
      only day
    • getOffset

      default int getOffset()
      Offset is an integer between −840 and 840 inclusive
      Returns:
      offset in minutes
    • getHour

      default int getHour()
      Return only hour of the item, if it's DateTime, Time or Duration
      Returns:
      only hour
    • getMinute

      default int getMinute()
      Return only minutes of the item, if it's DateTime, Time or Duration It will not convert hours into minutes
      Returns:
      only minute
    • getSecond

      default double getSecond()
      Return 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

      default int getNanosecond()
      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
      Returns:
      only nanoseconds
    • isDateTime

      default boolean isDateTime()
      Tests whether the item is an atomic item of type dateTime.
      Returns:
      true if it is an atomic item of type dateTime, false otherwise.
    • isDate

      default boolean isDate()
      Tests whether the item is an atomic item of type date.
      Returns:
      true if it is an atomic item of type date, false otherwise.
    • isTime

      default boolean isTime()
      Tests whether the item is an atomic item of type time.
      Returns:
      true if it is an atomic item of type time, false otherwise.
    • isGDay

      default boolean isGDay()
      Tests whether the item is an atomic item of type gDay.
      Returns:
      true if it is an atomic item of type gDay, false otherwise.
    • isGMonth

      default boolean isGMonth()
      Tests whether the item is an atomic item of type gMonth.
      Returns:
      true if it is an atomic item of type gMonth, false otherwise.
    • isGYear

      default boolean isGYear()
      Tests whether the item is an atomic item of type gYear.
      Returns:
      true if it is an atomic item of type gYear, false otherwise.
    • isGMonthDay

      default boolean isGMonthDay()
      Tests whether the item is an atomic item of type gMonthDay.
      Returns:
      true if it is an atomic item of type gMonthDay, false otherwise.
    • isGYearMonth

      default boolean isGYearMonth()
      Tests whether the item is an atomic item of type gMonthDay.
      Returns:
      true if it is an atomic item of type gMonthDay, false otherwise.
    • isAnyURI

      default boolean isAnyURI()
      Tests whether the item is an atomic item of type anyURI.
      Returns:
      true if it is an atomic item of type anyURI, false otherwise.
    • isQName

      default boolean isQName()
      Tests whether the item is an atomic item of type xs:QName (expanded QName, see Name).
      Returns:
      true if it is an xs:QName item, false otherwise.
    • getQNameValue

      default Name getQNameValue()
      Returns the expanded name of this item when it is an xs:QName. Value equality follows Name: same namespace URI and local name; the prefix is not significant for equality.
      Returns:
      the expanded name.
      Throws:
      UnsupportedOperationException - if the item is not an xs:QName.
    • isBinary

      default boolean isBinary()
      Tests whether the item is an atomic item of type base64Binary or hexBinary.
      Returns:
      true if it is an atomic item of type base64Binary or hexBinary, false otherwise.
    • isHexBinary

      default boolean isHexBinary()
      Tests whether the item is an atomic item of type hexBinary.
      Returns:
      true if it is an atomic item of type hexBinary, false otherwise.
    • isBase64Binary

      default boolean isBase64Binary()
      Tests whether the item is an atomic item of type base64Binary.
      Returns:
      true if it is an atomic item of type base64Binary, false otherwise.
    • isElementNode

      default boolean isElementNode()
      Tests whether the item is an XML Element node.
      Returns:
      true if it is an XML Element node, false otherwise.
    • isAttributeNode

      default boolean isAttributeNode()
      Tests whether the item is an XML Attribute node.
      Returns:
      true if it is an XML Attribute node, false otherwise.
    • getContent

      default boolean getContent()
      Tests whether the item is an XML Text node.
      Returns:
      true if it is an XML Text node, false otherwise.
    • isDocumentNode

      default boolean isDocumentNode()
      Tests whether the item is an XML Document node.
      Returns:
      true if it is an XML Document node, false otherwise.
    • isTextNode

      default boolean isTextNode()
    • isCommentNode

      default boolean isCommentNode()
    • isNamespaceNode

      default boolean isNamespaceNode()
      Tests whether the item is an XML Namespace node.
      Returns:
      true if it is an XML Namespace node, false otherwise.
    • isProcessingInstructionNode

      default boolean isProcessingInstructionNode()
      Tests whether the item is an XML Processing Instruction node.
      Returns:
      true if it is an XML Processing Instruction node, false otherwise.
    • isNode

      default boolean isNode()
      Tests whether the item is an XML node.
      Returns:
      true if it is an XML node, false otherwise.
    • isMap

      default boolean isMap()
      Tests whether the item is a map.
      Returns:
      true if it is a map, false otherwise.
    • isObject

      default boolean isObject()
      Tests whether the item is an object. Object items are legacy JSONiq objects, that allow only for - string keys - singleton values
      Returns:
      true if it is an object, false otherwise.
    • getKeys

      @Deprecated default List<String> getKeys()
      Deprecated.
      use getStringKeys() instead
      Returns the string keys of the item, if it is a map.
      Returns:
      the list of the keys.
    • getStringKeys

      default List<String> getStringKeys() throws UnsupportedOperationException, OurBadException
      Returns the string keys of the item, if it is a map.
      Returns:
      a list of strings, corresponding to the keys of the map.
      Throws:
      UnsupportedOperationException - if the item is not a map.
      OurBadException - if the map contains non-string keys.
    • getItemKeys

      default List<Item> getItemKeys() throws UnsupportedOperationException
      Returns the (possibly non-string) atomic keys of the item, if it is a map-like object.
      Returns:
      the list of atomic keys as items.
      Throws:
      UnsupportedOperationException - if the item is not a map.
    • getValues

      @Deprecated default List<Item> getValues()
      Deprecated.
      use getItemValues() instead
      Returns the values of the item, if it is a map.
      Returns:
      the list of the value items.
    • getItemValues

      default List<Item> getItemValues() throws UnsupportedOperationException, OurBadException
      Returns the values of the item, if it is a map.
      Returns:
      a list containing, for each key in the map, the item associated with that key.
      Throws:
      UnsupportedOperationException - if the item is not a map.
      OurBadException - if the map contains non-singleton values.
    • getSequenceValues

      default List<List<Item>> getSequenceValues() throws UnsupportedOperationException
      Returns the value sequences of the item, if it is a map.
      Returns:
      a list containing, for each key in the map, the sequence of items associated with that key.
      Throws:
      UnsupportedOperationException - if the item is not a map.
    • getItemByKey

      default Item getItemByKey(String key) throws UnsupportedOperationException, OurBadException
      Returns the value item associated with a specific key, if it is a map.
      Parameters:
      key - a string key.
      Returns:
      the item associated with the key, or null if absent.
      Throws:
      UnsupportedOperationException - if the item is not a map.
      OurBadException - if the value item associated with the key is not a singleton.
    • getItemByKey

      default Item getItemByKey(Item key) throws UnsupportedOperationException, OurBadException
      Returns the value item associated with a specific key, if it is an object.
      Parameters:
      key - a key item.
      Returns:
      the item associated with the key, or null if absent.
      Throws:
      UnsupportedOperationException - if the item is not a map.
      OurBadException - if the value item associated with the key is not a singleton.
    • getSequenceByKey

      default List<Item> getSequenceByKey(String key) throws UnsupportedOperationException
      Returns the value sequence associated with a string key, if it is a map.
      Parameters:
      key - a string key.
      Returns:
      the value sequence for the key, or null if absent.
      Throws:
      UnsupportedOperationException - if the item is not a map.
    • getSequenceByKey

      default List<Item> getSequenceByKey(Item key) throws UnsupportedOperationException
      Returns the value sequence associated with a key, if it is a map-like object.
      Parameters:
      key - an atomic key item.
      Returns:
      the value sequence for the key, or null if absent.
      Throws:
      UnsupportedOperationException - if the item is not a map.
    • putItemByKey

      default void putItemByKey(String key, Item value) throws UnsupportedOperationException, OurBadException
      Adds a key-value pair, if it is a map.
      Parameters:
      key - a key.
      value - a value.
      Throws:
      UnsupportedOperationException - if the item is not a map.
      DuplicateObjectKeyException - if the key is already present.
      OurBadException
    • putItemByKey

      default void putItemByKey(Item key, Item value) throws UnsupportedOperationException, OurBadException, DuplicateObjectKeyException
      Adds a key-value pair, if it is a map.
      Parameters:
      key - an atomic key.
      value - a value.
      Throws:
      UnsupportedOperationException - if the item is not a map.
      OurBadException - if the key is not atomic, or if the key is not a string item and the item does not support non-string keys.
      DuplicateObjectKeyException - if the key is already present.
    • putSequenceByKey

      default void putSequenceByKey(String key, List<Item> valueSequence) throws UnsupportedOperationException, OurBadException, DuplicateObjectKeyException
      Adds a key-sequence pair, if it is a map.
      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.
    • putSequenceByKey

      default void putSequenceByKey(Item key, List<Item> valueSequence) throws UnsupportedOperationException, OurBadException, DuplicateObjectKeyException
      Adds a key-sequence pair, if it is a map.
      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.
      OurBadException - if the key is not atomic, or if the key is not a string item and the item does not support non-string keys.
      DuplicateObjectKeyException - if the key is already present.
    • removeItemByKey

      default void removeItemByKey(String key) throws UnsupportedOperationException
      Removes a key-value pair, if it is a map.
      Parameters:
      key - a key.
      Throws:
      UnsupportedOperationException - if the item is not a map.
    • removeItemByKey

      default void removeItemByKey(Item key) throws UnsupportedOperationException
      Removes a key-value pair, if it is a map.
      Parameters:
      key - an atomic key.
      Throws:
      UnsupportedOperationException - if the item is not a map.
    • putLazyItemByKey

      default void putLazyItemByKey(String key, RuntimeIterator iterator, DynamicContext context, boolean isArray) throws UnsupportedOperationException
      Adds a key-value pair, if it is a lazy object item. The value is lazily computed.
      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

      default boolean isArray()
      Tests whether the item is an array.
      Returns:
      true if it is an array, false otherwise.
    • isArrayOfItems

      default boolean isArrayOfItems()
      Tests whether the item is an array of items. Arrays of items are arrays whose members are singletons.
      Returns:
      true if it is an array of items, false otherwise.
    • getSize

      default int getSize() throws UnsupportedOperationException
      Returns the size of the item, if it is an array.
      Returns:
      the size as an int.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • getItems

      @Deprecated default List<Item> getItems()
      Deprecated.
      use getItemMembers() instead
      Returns the members of the item if it is an array.
      Returns:
      the list of the array members.
    • getItemMembers

      default List<Item> getItemMembers() throws UnsupportedOperationException, OurBadException
      Returns the members of the item, if it is an array.
      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

      default List<List<Item>> getSequenceMembers() throws UnsupportedOperationException
      Returns the member sequences of the item, if it is an array.
      Returns:
      the list of the members.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • getItemAt

      Returns the member of the item at the specified position if it is an array.
      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.
      ArrayIndexOutOfBoundsException - if the position is out of bounds.
    • getSequenceAt

      default List<Item> getSequenceAt(int position) throws UnsupportedOperationException, ArrayIndexOutOfBoundsException
      Returns the member of the item at the specified position if it is an array.
      Parameters:
      position - the position of the member.
      Returns:
      the member.
      Throws:
      UnsupportedOperationException - if the item is not an array.
      ArrayIndexOutOfBoundsException - if the position is out of bounds.
    • append

      default void append(Item item) throws UnsupportedOperationException
      Deprecated.
      use appendItem(Item) instead
      Appends an item to the item, if it is an array.
      Parameters:
      item - the item to append.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • appendItem

      default void appendItem(Item item) throws UnsupportedOperationException
      Appends an item to the item, if it is an array.
      Parameters:
      item - the item to append.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • appendSequence

      default void appendSequence(List<Item> sequence) throws UnsupportedOperationException, OurBadException
      Appends a sequence to the item, if it is an array.
      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

      default void putItemAt(Item item, int index) throws UnsupportedOperationException
      Puts an item at the given index, if it is an array.
      Parameters:
      item - the item to put.
      index - the index to put the item at.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • putSequenceAt

      default void putSequenceAt(List<Item> sequence, int index) throws UnsupportedOperationException, OurBadException
      Puts a sequence at the given index, if it is an array.
      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

      default void putItemsAt(List<Item> items, int i) throws UnsupportedOperationException
      Add all items in items at index i, if it is an array.
      Parameters:
      items - a list of items.
      i - an integer.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • putSequencesAt

      default void putSequencesAt(List<List<Item>> sequences, int index) throws UnsupportedOperationException, OurBadException
      Puts sequences at the given index, if it is an array.
      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

      default void removeItemAt(int index) throws UnsupportedOperationException
      Removes the item at the given index, if it is an array.
      Parameters:
      index - the index to remove the item at.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • removeSequenceAt

      default void removeSequenceAt(int index) throws UnsupportedOperationException
      Removes the sequence at the given index, if it is an array.
      Parameters:
      index - the index to remove the sequence at.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • getStringValue

      default String getStringValue()
      Returns the string value of the item, if it is an atomic item.
      Returns:
      the string value.
    • getBooleanValue

      default boolean getBooleanValue()
      Returns the boolean value of the item, if it is a boolean.
      Returns:
      the boolean value.
    • getDoubleValue

      default double getDoubleValue()
      Returns the double value of the item, if it is a double.
      Returns:
      the double value.
    • getFloatValue

      default float getFloatValue()
      Returns the float value of the item, if it is a float.
      Returns:
      the float value.
    • getIntValue

      default int getIntValue()
      Returns the int value of the item, if it is an int.
      Returns:
      the integer value as an int.
    • getIntegerValue

      default BigInteger getIntegerValue()
      Returns the integer value of the item as a bit integer, if it is an integer.
      Returns:
      the integer value as a BigInteger.
    • getDecimalValue

      default BigDecimal getDecimalValue()
      Returns the decimal value of the item, if it is a decimal.
      Returns:
      the decimal value as a BigDecimal.
    • getPeriodValue

      default Period getPeriodValue()
      Returns the period value of the item, if it is a duration.
      Returns:
      the period value as a Period.
    • getDurationValue

      default Duration getDurationValue()
      Returns the duration value of the item, if it is a duration.
      Returns:
      the duration value as a Duration.
    • getEpochMillis

      default long getEpochMillis()
      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
      Returns:
      the EpochMillis
    • getDateTimeValue

      default OffsetDateTime getDateTimeValue()
      Returns the dateTime value of the item, if it is an atomic item of type dateTimeItem or dateItem or timeItem.
      Returns:
      the dateTime value as a OffsetDateTime.
    • getTimeValue

      default OffsetTime getTimeValue()
      Returns the time value of the item, if it is an atomic item of type or timeItem.
      Returns:
      the time value as a OffsetTime.
    • getBinaryValue

      default byte[] getBinaryValue()
      Returns the byte[] value of the item, if it is an atomic item of type hexBinary or Base64Binary.
      Returns:
      the binary value as an array of bytes.
    • getDynamicType

      default ItemType getDynamicType()
      Returns the dynamic type of the item (only for error message purposes).
      Returns:
      the dynamic type as an item type.
    • getIdentifier

      default FunctionIdentifier getIdentifier()
      Returns the identifier (name and arity) of the function, if it is a function item.
      Returns:
      the function identifier.
    • getParameterNames

      default List<Name> getParameterNames()
      Returns the names of the parameters of the function, if it is a function item.
      Returns:
      the function parameter names.
    • getSignature

      default FunctionSignature getSignature()
      Returns the signature of the function, if it is a function item.
      Returns:
      the function signature.
    • getBodyIterator

      default RuntimeIterator getBodyIterator()
      Returns the body iterator, if it is a function item.
      Returns:
      the function signature.
    • getLocalVariablesInClosure

      default Map<Name,List<Item>> getLocalVariablesInClosure()
      Returns the local variable bindings, if it is a function item.
      Returns:
      the function signature.
    • getRDDVariablesInClosure

      default Map<Name,org.apache.spark.api.java.JavaRDD<Item>> getRDDVariablesInClosure()
      Returns the RDD variable bindings, if it is a function item.
      Returns:
      the function signature.
    • getDFVariablesInClosure

      default Map<Name,JSoundDataFrame> getDFVariablesInClosure()
      Returns the DataFrame variable bindings, if it is a function item.
      Returns:
      the function signature.
    • getModuleDynamicContext

      default DynamicContext getModuleDynamicContext()
      Returns the module dynamic context, if it is a function item.
      Returns:
      the function signature.
    • hasTimeZone

      default boolean hasTimeZone()
      Returns:
      true if the Item has a timeZone, false otherwise
    • hasDateTime

      default boolean hasDateTime()
      Tests whether the item contains a representation of date or time (or both).
      Returns:
      true if it is an atomic item of type time, date or dateTime, false otherwise.
    • getEffectiveBooleanValue

      default boolean getEffectiveBooleanValue()
      Returns the effective boolean value of the item, if atomic.
      Returns:
      the effective boolean value.
    • castToDoubleValue

      default double castToDoubleValue()
      Casts the item to a double value (must be a numeric).
      Returns:
      the double value.
    • castToFloatValue

      default float castToFloatValue()
      Casts the item to a float value (must be a numeric).
      Returns:
      the float value.
    • castToDecimalValue

      default BigDecimal castToDecimalValue()
      Casts the item to a decimal value (must be a numeric).
      Returns:
      the BigDecimal value.
    • castToIntegerValue

      default BigInteger castToIntegerValue()
      Casts the item to a big integer value (must be a numeric).
      Returns:
      the BigInteger value.
    • castToIntValue

      default int castToIntValue()
      Casts the item to an integer value (must be a numeric).
      Returns:
      the int value.
    • isNaN

      default boolean isNaN()
      Checks doubles and floats for NaN.
      Returns:
      true if NaN, false if not NaN.
    • getMutabilityLevel

      default int getMutabilityLevel()
      Returns the mutability level of the item.
      Returns:
      an int representing nestedness of the item inside transform expressions.
    • setMutabilityLevel

      default void setMutabilityLevel(int mutabilityLevel)
      Sets the mutability level of the item to a supplied value.
      Parameters:
      mutabilityLevel - new mutability level.
    • getTopLevelID

      default long getTopLevelID()
      Returns the top level ID of the item.
      Returns:
      int representing the rowID of the item within a DeltaFile.
    • setTopLevelID

      default void setTopLevelID(long topLevelID)
      Sets the top level ID of the item to a supplied value.
      Parameters:
      topLevelID - new top level ID.
    • getPathIn

      default String getPathIn()
      Returns the path from the top level object of a DeltaFile for the item.
      Returns:
      String representing the path of the item from the top level within a DeltaFile.
    • setPathIn

      default void setPathIn(String pathIn)
      Sets the path from the top level object of a DeltaFile for the item to a supplied value.
      Parameters:
      pathIn - new path from top level.
    • getTableLocation

      default String getTableLocation()
      Returns the location of the DeltaFile for the item.
      Returns:
      String representing the location of the DeltaFile for the item.
    • setTableLocation

      default void setTableLocation(String location)
      Sets the location of the DeltaFile for the item to a supplied value.
      Parameters:
      location - new location of the DeltaFile for the item.
    • getTopLevelOrder

      default double getTopLevelOrder()
      Returns the top level order (sequence number) identifier
      Returns:
      double representing rowOrder of the tuple
    • setTopLevelOrder

      default void setTopLevelOrder(double topLevelOrder)
      Sets the top level order parameter (rowOrder)
      Parameters:
      topLevelOrder - new rowOrder value
    • getSparkSQLValue

      default String getSparkSQLValue()
      Returns the SparkSQL value of the item for use in a query.
      Returns:
      String representing the SparkSQL value of the item.
    • getSparkSQLValue

      default String getSparkSQLValue(ItemType itemType)
      Returns the SparkSQL value of the item for use in a query.
      Returns:
      String representing the SparkSQL value of the item.
    • getSparkSQLType

      default String getSparkSQLType()
      Returns the SparkSQL type of the item for use in a query.
      Returns:
      String representing the SparkSQL type of the item.
    • getVariantValue

      default Object getVariantValue()
      Returns the Object containing the converted value of the item for a DataFrame. For use to build Variant columns.
      Returns:
      Object representing the converted value of the item.
    • physicalEquals

      default boolean physicalEquals(Object other)
      Tests for physical equality. The semantics are that of the eq operator.
      Parameters:
      other - another item.
      Returns:
      true it is equal to other, false otherwise.
    • equals

      boolean equals(Object other)
      Tests for logical equality. The semantics are that of the eq operator.
      Overrides:
      equals in class Object
      Parameters:
      other - another item.
      Returns:
      true it is equal to other, false otherwise.
    • hashCode

      int hashCode()
      Computes a hash code.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code as an int.
    • serialize

      default String serialize()
    • serializeAsJSON

      default String serializeAsJSON()
    • generateNativeQuery

      default NativeClauseContext generateNativeQuery(NativeClauseContext context)
      Get sparkSql string for the item
      Parameters:
      context - input context
      Returns:
      String representing the item in a sparksql query or null if it is not supported for the item
    • isEstimator

      default boolean isEstimator()
    • getEstimator

      default org.apache.spark.ml.Estimator<?> getEstimator()
    • isTransformer

      default boolean isTransformer()
    • getTransformer

      default org.apache.spark.ml.Transformer getTransformer()
    • getTextValue

      default String getTextValue()
      Returns the string value of the text item, if it is a text item.
      Returns:
      the string value.
    • addParentToDescendants

      default void addParentToDescendants()
      Method sets the parent item for all descendents of the current item.
    • attributes

      default List<Item> attributes()
      XDM 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."
    • children

      default List<Item> children()
      XDM 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

      default List<Item> namespaceNodes()
      XDM 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.
    • declaredNamespaceNodes

      default List<Item> declaredNamespaceNodes()
      Helper 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.
    • nodeKind

      default String nodeKind()
      XDM 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

      default List<Item> baseUri()
      XDM 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

      default List<Item> documentUri()
      XDM 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."
    • isId

      default boolean isId()
      XDM 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

      default boolean isIdrefs()
      XDM 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

      default List<Item> nilled()
      XDM 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

      default List<Item> typeName()
      XDM 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

      default List<Item> typedValue()
      XDM 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.
    • unparsedEntityPublicId

      default List<Item> unparsedEntityPublicId(String name)
      XDM 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."
    • unparsedEntitySystemId

      default List<Item> unparsedEntitySystemId(String name)
      XDM 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."
    • nodeName

      default Name nodeName() throws UnsupportedOperationException
      XDM 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."
      Returns:
      the expanded name (Name) of the node, or null when the accessor yields the empty sequence
      Throws:
      UnsupportedOperationException - if called on an item that is not a node
    • parent

      default Item parent()
      XDM 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."
    • atomizedValue

      default List<Item> atomizedValue()
      XDM 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().
    • setParent

      default void setParent(Item parent)
    • getXmlDocumentPosition

      default XMLDocumentPosition getXmlDocumentPosition()
      Get the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness
      Returns:
      the XML document position
    • setXmlDocumentPosition

      default int setXmlDocumentPosition(String path, int current)
      Set the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness
      Parameters:
      path - the path of the XML document
      current - the current position
      Returns:
      the new position
    • getCollection

      default Collection getCollection()
      Returns the collection to which the item belongs, if any. Only defined for top-level items.
      Returns:
      the collection.
    • setCollection

      default void setCollection(Collection collection)
      Sets the collection to which the item belongs. Only defined for top-level items.
      Parameters:
      collection - the collection.