Class AnnotatedItem

java.lang.Object
org.rumbledb.items.AnnotatedItem
All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable, Serializable, Item

public class AnnotatedItem extends Object implements Item
See Also:
  • Constructor Details

    • AnnotatedItem

      public AnnotatedItem()
    • AnnotatedItem

      public AnnotatedItem(Item itemToAnnotate, ItemType type)
  • Method Details

    • equals

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

      public int hashCode()
      Description copied from interface: Item
      Computes a hash code.
      Specified by:
      hashCode in interface Item
      Overrides:
      hashCode in class Object
      Returns:
      a hash code as an int.
    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
      Specified by:
      write in interface com.esotericsoftware.kryo.KryoSerializable
    • read

      public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
      Specified by:
      read in interface com.esotericsoftware.kryo.KryoSerializable
    • isFunction

      public boolean isFunction()
      Description copied from interface: Item
      Tests whether the item is a function.
      Specified by:
      isFunction in interface Item
      Returns:
      true if it is a function, false otherwise
    • isAtomic

      public boolean isAtomic()
      Description copied from interface: Item
      Tests whether the item is an atomic item.
      Specified by:
      isAtomic in interface Item
      Returns:
      true if it is an atomic item, false otherwise.
    • isString

      public boolean isString()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type string.
      Specified by:
      isString in interface Item
      Returns:
      true if it is an atomic item of type string, false otherwise.
    • isUntypedAtomic

      public boolean isUntypedAtomic()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type xs:untypedAtomic.
      Specified by:
      isUntypedAtomic in interface Item
      Returns:
      true if it is an atomic item of type xs:untypedAtomic, false otherwise.
    • isBoolean

      public boolean isBoolean()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type default boolean.
      Specified by:
      isBoolean in interface Item
      Returns:
      true if it is an atomic item of type default boolean, false otherwise.
    • isNull

      public boolean isNull()
      Description copied from interface: Item
      Tests whether the item is the null item.
      Specified by:
      isNull in interface Item
      Returns:
      true if it is the null item, false otherwise.
    • isNumeric

      public boolean isNumeric()
      Description copied from interface: Item
      Tests whether the item is a number (decimal or double).
      Specified by:
      isNumeric in interface Item
      Returns:
      true if it is a number, false otherwise.
    • isDecimal

      public boolean isDecimal()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type decimal.
      Specified by:
      isDecimal in interface Item
      Returns:
      true if it is an atomic item of type decimal, false otherwise.
    • isInteger

      public boolean isInteger()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type integer.
      Specified by:
      isInteger in interface Item
      Returns:
      true if it is an atomic item of type integer, false otherwise.
    • isInt

      public boolean isInt()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type int.
      Specified by:
      isInt in interface Item
      Returns:
      true if it is an atomic item of type int, false otherwise.
    • isDouble

      public boolean isDouble()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type double.
      Specified by:
      isDouble in interface Item
      Returns:
      true if it is an atomic item of type double, false otherwise.
    • isFloat

      public boolean isFloat()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type float.
      Specified by:
      isFloat in interface Item
      Returns:
      true if it is an atomic item of type float, false otherwise.
    • isDuration

      public boolean isDuration()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type duration.
      Specified by:
      isDuration in interface Item
      Returns:
      true if it is an atomic item of type duration, false otherwise.
    • isPeriod

      public boolean isPeriod()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type period.
      Specified by:
      isPeriod in interface Item
      Returns:
      true if it is an atomic item of type period, false otherwise.
    • isYearMonthDuration

      public boolean isYearMonthDuration()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type yearMonthDuration.
      Specified by:
      isYearMonthDuration in interface Item
      Returns:
      true if it is an atomic item of type yearMonthDuration, false otherwise.
    • isDayTimeDuration

      public boolean isDayTimeDuration()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type dayTimeDuration.
      Specified by:
      isDayTimeDuration in interface Item
      Returns:
      true if it is an atomic item of type dayTimeDuration, false otherwise.
    • isDateTime

      public boolean isDateTime()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type dateTime.
      Specified by:
      isDateTime in interface Item
      Returns:
      true if it is an atomic item of type dateTime, false otherwise.
    • isDate

      public boolean isDate()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type date.
      Specified by:
      isDate in interface Item
      Returns:
      true if it is an atomic item of type date, false otherwise.
    • isTime

      public boolean isTime()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type time.
      Specified by:
      isTime in interface Item
      Returns:
      true if it is an atomic item of type time, false otherwise.
    • isGDay

      public boolean isGDay()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type gDay.
      Specified by:
      isGDay in interface Item
      Returns:
      true if it is an atomic item of type gDay, false otherwise.
    • isGMonth

      public boolean isGMonth()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type gMonth.
      Specified by:
      isGMonth in interface Item
      Returns:
      true if it is an atomic item of type gMonth, false otherwise.
    • isGYear

      public boolean isGYear()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type gYear.
      Specified by:
      isGYear in interface Item
      Returns:
      true if it is an atomic item of type gYear, false otherwise.
    • isGMonthDay

      public boolean isGMonthDay()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type gMonthDay.
      Specified by:
      isGMonthDay in interface Item
      Returns:
      true if it is an atomic item of type gMonthDay, false otherwise.
    • isGYearMonth

      public boolean isGYearMonth()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type gMonthDay.
      Specified by:
      isGYearMonth in interface Item
      Returns:
      true if it is an atomic item of type gMonthDay, false otherwise.
    • isAnyURI

      public boolean isAnyURI()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type anyURI.
      Specified by:
      isAnyURI in interface Item
      Returns:
      true if it is an atomic item of type anyURI, false otherwise.
    • isQName

      public boolean isQName()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type xs:QName (expanded QName, see Name).
      Specified by:
      isQName in interface Item
      Returns:
      true if it is an xs:QName item, false otherwise.
    • getQNameValue

      public Name getQNameValue()
      Description copied from interface: Item
      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.
      Specified by:
      getQNameValue in interface Item
      Returns:
      the expanded name.
    • isBinary

      public boolean isBinary()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type base64Binary or hexBinary.
      Specified by:
      isBinary in interface Item
      Returns:
      true if it is an atomic item of type base64Binary or hexBinary, false otherwise.
    • isHexBinary

      public boolean isHexBinary()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type hexBinary.
      Specified by:
      isHexBinary in interface Item
      Returns:
      true if it is an atomic item of type hexBinary, false otherwise.
    • isBase64Binary

      public boolean isBase64Binary()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type base64Binary.
      Specified by:
      isBase64Binary in interface Item
      Returns:
      true if it is an atomic item of type base64Binary, false otherwise.
    • isElementNode

      public boolean isElementNode()
      Description copied from interface: Item
      Tests whether the item is an XML Element node.
      Specified by:
      isElementNode in interface Item
      Returns:
      true if it is an XML Element node, false otherwise.
    • isAttributeNode

      public boolean isAttributeNode()
      Description copied from interface: Item
      Tests whether the item is an XML Attribute node.
      Specified by:
      isAttributeNode in interface Item
      Returns:
      true if it is an XML Attribute node, false otherwise.
    • getContent

      public boolean getContent()
      Description copied from interface: Item
      Tests whether the item is an XML Text node.
      Specified by:
      getContent in interface Item
      Returns:
      true if it is an XML Text node, false otherwise.
    • isDocumentNode

      public boolean isDocumentNode()
      Description copied from interface: Item
      Tests whether the item is an XML Document node.
      Specified by:
      isDocumentNode in interface Item
      Returns:
      true if it is an XML Document node, false otherwise.
    • isTextNode

      public boolean isTextNode()
      Specified by:
      isTextNode in interface Item
    • isCommentNode

      public boolean isCommentNode()
      Specified by:
      isCommentNode in interface Item
    • isNamespaceNode

      public boolean isNamespaceNode()
      Description copied from interface: Item
      Tests whether the item is an XML Namespace node.
      Specified by:
      isNamespaceNode in interface Item
      Returns:
      true if it is an XML Namespace node, false otherwise.
    • isProcessingInstructionNode

      public boolean isProcessingInstructionNode()
      Description copied from interface: Item
      Tests whether the item is an XML Processing Instruction node.
      Specified by:
      isProcessingInstructionNode in interface Item
      Returns:
      true if it is an XML Processing Instruction node, false otherwise.
    • isNode

      public boolean isNode()
      Description copied from interface: Item
      Tests whether the item is an XML node.
      Specified by:
      isNode in interface Item
      Returns:
      true if it is an XML node, false otherwise.
    • isMap

      public boolean isMap()
      Description copied from interface: Item
      Tests whether the item is a map.
      Specified by:
      isMap in interface Item
      Returns:
      true if it is a map, false otherwise.
    • isObject

      public boolean isObject()
      Description copied from interface: Item
      Tests whether the item is an object. Object items are legacy JSONiq objects, that allow only for - string keys - singleton values
      Specified by:
      isObject in interface Item
      Returns:
      true if it is an object, false otherwise.
    • getKeys

      public List<String> getKeys()
      Description copied from interface: Item
      Returns the string keys of the item, if it is a map.
      Specified by:
      getKeys in interface Item
      Returns:
      the list of the keys.
    • getStringKeys

      public List<String> getStringKeys()
      Description copied from interface: Item
      Returns the string keys of the item, if it is a map.
      Specified by:
      getStringKeys in interface Item
      Returns:
      a list of strings, corresponding to the keys of the map.
    • getItemKeys

      public List<Item> getItemKeys()
      Description copied from interface: Item
      Returns the (possibly non-string) atomic keys of the item, if it is a map-like object.
      Specified by:
      getItemKeys in interface Item
      Returns:
      the list of atomic keys as items.
    • getValues

      public List<Item> getValues()
      Description copied from interface: Item
      Returns the values of the item, if it is a map.
      Specified by:
      getValues in interface Item
      Returns:
      the list of the value items.
    • getItemValues

      public List<Item> getItemValues()
      Description copied from interface: Item
      Returns the values of the item, if it is a map.
      Specified by:
      getItemValues in interface Item
      Returns:
      a list containing, for each key in the map, the item associated with that key.
    • getSequenceValues

      public List<List<Item>> getSequenceValues()
      Description copied from interface: Item
      Returns the value sequences of the item, if it is a map.
      Specified by:
      getSequenceValues in interface Item
      Returns:
      a list containing, for each key in the map, the sequence of items associated with that key.
    • getItemByKey

      public Item getItemByKey(String key)
      Description copied from interface: Item
      Returns the value item associated with a specific key, if it is a map.
      Specified by:
      getItemByKey in interface Item
      Parameters:
      key - a string key.
      Returns:
      the item associated with the key, or null if absent.
    • getItemByKey

      public Item getItemByKey(Item key)
      Description copied from interface: Item
      Returns the value item associated with a specific key, if it is an object.
      Specified by:
      getItemByKey in interface Item
      Parameters:
      key - a key item.
      Returns:
      the item associated with the key, or null if absent.
    • getSequenceByKey

      public List<Item> getSequenceByKey(String key)
      Description copied from interface: Item
      Returns the value sequence associated with a string key, if it is a map.
      Specified by:
      getSequenceByKey in interface Item
      Parameters:
      key - a string key.
      Returns:
      the value sequence for the key, or null if absent.
    • getSequenceByKey

      public List<Item> getSequenceByKey(Item key)
      Description copied from interface: Item
      Returns the value sequence associated with a key, if it is a map-like object.
      Specified by:
      getSequenceByKey in interface Item
      Parameters:
      key - an atomic key item.
      Returns:
      the value sequence for the key, or null if absent.
    • putItemByKey

      public void putItemByKey(String key, Item value)
      Description copied from interface: Item
      Adds a key-value pair, if it is a map.
      Specified by:
      putItemByKey in interface Item
      Parameters:
      key - a key.
      value - a value.
    • putItemByKey

      public void putItemByKey(Item key, Item value)
      Description copied from interface: Item
      Adds a key-value pair, if it is a map.
      Specified by:
      putItemByKey in interface Item
      Parameters:
      key - an atomic key.
      value - a value.
    • putSequenceByKey

      public void putSequenceByKey(String key, List<Item> valueSequence)
      Description copied from interface: Item
      Adds a key-sequence pair, if it is a map.
      Specified by:
      putSequenceByKey in interface Item
      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: Item
      Adds a key-sequence pair, if it is a map.
      Specified by:
      putSequenceByKey in interface Item
      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

      public void removeItemByKey(String key) throws UnsupportedOperationException
      Description copied from interface: Item
      Removes a key-value pair, if it is a map.
      Specified by:
      removeItemByKey in interface Item
      Parameters:
      key - a key.
      Throws:
      UnsupportedOperationException - if the item is not a map.
    • removeItemByKey

      public void removeItemByKey(Item key) throws UnsupportedOperationException
      Description copied from interface: Item
      Removes a key-value pair, if it is a map.
      Specified by:
      removeItemByKey in interface Item
      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: Item
      Adds a key-value pair, if it is a lazy object item. The value is lazily computed.
      Specified by:
      putLazyItemByKey in interface Item
      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: Item
      Tests whether the item is an array.
      Specified by:
      isArray in interface Item
      Returns:
      true if it is an array, false otherwise.
    • isArrayOfItems

      public boolean isArrayOfItems()
      Description copied from interface: Item
      Tests whether the item is an array of items. Arrays of items are arrays whose members are singletons.
      Specified by:
      isArrayOfItems in interface Item
      Returns:
      true if it is an array of items, false otherwise.
    • getSize

      public int getSize() throws UnsupportedOperationException
      Description copied from interface: Item
      Returns the size of the item, if it is an array.
      Specified by:
      getSize in interface Item
      Returns:
      the size as an int.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • getItems

      public List<Item> getItems()
      Description copied from interface: Item
      Returns the members of the item if it is an array.
      Specified by:
      getItems in interface Item
      Returns:
      the list of the array members.
    • getItemMembers

      public List<Item> getItemMembers() throws UnsupportedOperationException, OurBadException
      Description copied from interface: Item
      Returns the members of the item, if it is an array.
      Specified by:
      getItemMembers in interface Item
      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

      public List<List<Item>> getSequenceMembers() throws UnsupportedOperationException
      Description copied from interface: Item
      Returns the member sequences of the item, if it is an array.
      Specified by:
      getSequenceMembers in interface Item
      Returns:
      the list of the members.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • getItemAt

      public Item getItemAt(int position) throws UnsupportedOperationException, OurBadException
      Description copied from interface: Item
      Returns the member of the item at the specified position if it is an array.
      Specified by:
      getItemAt in interface Item
      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

      public List<Item> getSequenceAt(int position) throws UnsupportedOperationException
      Description copied from interface: Item
      Returns the member of the item at the specified position if it is an array.
      Specified by:
      getSequenceAt in interface Item
      Parameters:
      position - the position of the member.
      Returns:
      the member.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • append

      public void append(Item item) throws UnsupportedOperationException
      Description copied from interface: Item
      Appends an item to the item, if it is an array.
      Specified by:
      append in interface Item
      Parameters:
      item - the item to append.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • appendItem

      public void appendItem(Item item) throws UnsupportedOperationException
      Description copied from interface: Item
      Appends an item to the item, if it is an array.
      Specified by:
      appendItem in interface Item
      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: Item
      Appends a sequence to the item, if it is an array.
      Specified by:
      appendSequence in interface Item
      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

      public void putItemAt(Item item, int index) throws UnsupportedOperationException
      Description copied from interface: Item
      Puts an item at the given index, if it is an array.
      Specified by:
      putItemAt in interface Item
      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: Item
      Puts a sequence at the given index, if it is an array.
      Specified by:
      putSequenceAt in interface Item
      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

      public void putItemsAt(List<Item> items, int i) throws UnsupportedOperationException
      Description copied from interface: Item
      Add all items in items at index i, if it is an array.
      Specified by:
      putItemsAt in interface Item
      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: Item
      Puts sequences at the given index, if it is an array.
      Specified by:
      putSequencesAt in interface Item
      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

      public void removeItemAt(int index) throws UnsupportedOperationException
      Description copied from interface: Item
      Removes the item at the given index, if it is an array.
      Specified by:
      removeItemAt in interface Item
      Parameters:
      index - the index to remove the item at.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • removeSequenceAt

      public void removeSequenceAt(int index) throws UnsupportedOperationException
      Description copied from interface: Item
      Removes the sequence at the given index, if it is an array.
      Specified by:
      removeSequenceAt in interface Item
      Parameters:
      index - the index to remove the sequence at.
      Throws:
      UnsupportedOperationException - if the item is not an array.
    • getStringValue

      public String getStringValue()
      Description copied from interface: Item
      Returns the string value of the item, if it is an atomic item.
      Specified by:
      getStringValue in interface Item
      Returns:
      the string value.
    • getBooleanValue

      public boolean getBooleanValue()
      Description copied from interface: Item
      Returns the boolean value of the item, if it is a boolean.
      Specified by:
      getBooleanValue in interface Item
      Returns:
      the boolean value.
    • getDoubleValue

      public double getDoubleValue()
      Description copied from interface: Item
      Returns the double value of the item, if it is a double.
      Specified by:
      getDoubleValue in interface Item
      Returns:
      the double value.
    • getFloatValue

      public float getFloatValue()
      Description copied from interface: Item
      Returns the float value of the item, if it is a float.
      Specified by:
      getFloatValue in interface Item
      Returns:
      the float value.
    • getIntValue

      public int getIntValue()
      Description copied from interface: Item
      Returns the int value of the item, if it is an int.
      Specified by:
      getIntValue in interface Item
      Returns:
      the integer value as an int.
    • getIntegerValue

      public BigInteger getIntegerValue()
      Description copied from interface: Item
      Returns the integer value of the item as a bit integer, if it is an integer.
      Specified by:
      getIntegerValue in interface Item
      Returns:
      the integer value as a BigInteger.
    • getDecimalValue

      public BigDecimal getDecimalValue()
      Description copied from interface: Item
      Returns the decimal value of the item, if it is a decimal.
      Specified by:
      getDecimalValue in interface Item
      Returns:
      the decimal value as a BigDecimal.
    • getPeriodValue

      public Period getPeriodValue()
      Description copied from interface: Item
      Returns the period value of the item, if it is a duration.
      Specified by:
      getPeriodValue in interface Item
      Returns:
      the period value as a Period.
    • getDurationValue

      public Duration getDurationValue()
      Description copied from interface: Item
      Returns the duration value of the item, if it is a duration.
      Specified by:
      getDurationValue in interface Item
      Returns:
      the duration value as a Duration.
    • getEpochMillis

      public long getEpochMillis()
      Description copied from interface: Item
      Returns the EpochMillis of the item, if it's DateTime or Duration It will collect all the parts of the item and compress it into the EpochMillis
      Specified by:
      getEpochMillis in interface Item
      Returns:
      the EpochMillis
    • getDateTimeValue

      public OffsetDateTime getDateTimeValue()
      Description copied from interface: Item
      Returns the dateTime value of the item, if it is an atomic item of type dateTimeItem or dateItem or timeItem.
      Specified by:
      getDateTimeValue in interface Item
      Returns:
      the dateTime value as a OffsetDateTime.
    • getTimeValue

      public OffsetTime getTimeValue()
      Description copied from interface: Item
      Returns the time value of the item, if it is an atomic item of type or timeItem.
      Specified by:
      getTimeValue in interface Item
      Returns:
      the time value as a OffsetTime.
    • getYear

      public int getYear()
      Description copied from interface: Item
      Return year of the item, if it's DateTime or Duration
      Specified by:
      getYear in interface Item
      Returns:
      year
    • getMonth

      public int getMonth()
      Description copied from interface: Item
      Return only month of the item, if it's DateTime or Duration It will not convert years into months
      Specified by:
      getMonth in interface Item
      Returns:
      only month
    • getDay

      public int getDay()
      Description copied from interface: Item
      Return only day of the item, if it's DateTime or Duration It will not convert months and years into days.
      Specified by:
      getDay in interface Item
      Returns:
      only day
    • getOffset

      public int getOffset()
      Description copied from interface: Item
      Offset is an integer between −840 and 840 inclusive
      Specified by:
      getOffset in interface Item
      Returns:
      offset in minutes
    • getHour

      public int getHour()
      Description copied from interface: Item
      Return only hour of the item, if it's DateTime, Time or Duration
      Specified by:
      getHour in interface Item
      Returns:
      only hour
    • getMinute

      public int getMinute()
      Description copied from interface: Item
      Return only minutes of the item, if it's DateTime, Time or Duration It will not convert hours into minutes
      Specified by:
      getMinute in interface Item
      Returns:
      only minute
    • getSecond

      public double getSecond()
      Description copied from interface: Item
      Return only seconds of the item, if it's DateTime, Time or Duration It will not convert hours and minutes into seconds
      Specified by:
      getSecond in interface Item
      Returns:
      only seconds
    • getNanosecond

      public int getNanosecond()
      Description copied from interface: Item
      Return the only nanoseconds of the item, if it's DateTime, Time or Duration It will not convert hours, minutes and seconds into nanoseconds It exists only if the value in seconds will have decimal values, otherwise it will return 0
      Specified by:
      getNanosecond in interface Item
      Returns:
      only nanoseconds
    • getBinaryValue

      public byte[] getBinaryValue()
      Description copied from interface: Item
      Returns the byte[] value of the item, if it is an atomic item of type hexBinary or Base64Binary.
      Specified by:
      getBinaryValue in interface Item
      Returns:
      the binary value as an array of bytes.
    • getDynamicType

      public ItemType getDynamicType()
      Description copied from interface: Item
      Returns the dynamic type of the item (only for error message purposes).
      Specified by:
      getDynamicType in interface Item
      Returns:
      the dynamic type as an item type.
    • getIdentifier

      public FunctionIdentifier getIdentifier()
      Description copied from interface: Item
      Returns the identifier (name and arity) of the function, if it is a function item.
      Specified by:
      getIdentifier in interface Item
      Returns:
      the function identifier.
    • getParameterNames

      public List<Name> getParameterNames()
      Description copied from interface: Item
      Returns the names of the parameters of the function, if it is a function item.
      Specified by:
      getParameterNames in interface Item
      Returns:
      the function parameter names.
    • getSignature

      public FunctionSignature getSignature()
      Description copied from interface: Item
      Returns the signature of the function, if it is a function item.
      Specified by:
      getSignature in interface Item
      Returns:
      the function signature.
    • getBodyIterator

      public RuntimeIterator getBodyIterator()
      Description copied from interface: Item
      Returns the body iterator, if it is a function item.
      Specified by:
      getBodyIterator in interface Item
      Returns:
      the function signature.
    • getLocalVariablesInClosure

      public Map<Name,List<Item>> getLocalVariablesInClosure()
      Description copied from interface: Item
      Returns the local variable bindings, if it is a function item.
      Specified by:
      getLocalVariablesInClosure in interface Item
      Returns:
      the function signature.
    • getRDDVariablesInClosure

      public Map<Name,org.apache.spark.api.java.JavaRDD<Item>> getRDDVariablesInClosure()
      Description copied from interface: Item
      Returns the RDD variable bindings, if it is a function item.
      Specified by:
      getRDDVariablesInClosure in interface Item
      Returns:
      the function signature.
    • getDFVariablesInClosure

      public Map<Name,JSoundDataFrame> getDFVariablesInClosure()
      Description copied from interface: Item
      Returns the DataFrame variable bindings, if it is a function item.
      Specified by:
      getDFVariablesInClosure in interface Item
      Returns:
      the function signature.
    • getModuleDynamicContext

      public DynamicContext getModuleDynamicContext()
      Description copied from interface: Item
      Returns the module dynamic context, if it is a function item.
      Specified by:
      getModuleDynamicContext in interface Item
      Returns:
      the function signature.
    • hasTimeZone

      public boolean hasTimeZone()
      Specified by:
      hasTimeZone in interface Item
      Returns:
      true if the Item has a timeZone, false otherwise
    • hasDateTime

      public boolean hasDateTime()
      Description copied from interface: Item
      Tests whether the item contains a representation of date or time (or both).
      Specified by:
      hasDateTime in interface Item
      Returns:
      true if it is an atomic item of type time, date or dateTime, false otherwise.
    • getEffectiveBooleanValue

      public boolean getEffectiveBooleanValue()
      Description copied from interface: Item
      Returns the effective boolean value of the item, if atomic.
      Specified by:
      getEffectiveBooleanValue in interface Item
      Returns:
      the effective boolean value.
    • castToDoubleValue

      public double castToDoubleValue()
      Description copied from interface: Item
      Casts the item to a double value (must be a numeric).
      Specified by:
      castToDoubleValue in interface Item
      Returns:
      the double value.
    • castToFloatValue

      public float castToFloatValue()
      Description copied from interface: Item
      Casts the item to a float value (must be a numeric).
      Specified by:
      castToFloatValue in interface Item
      Returns:
      the float value.
    • castToDecimalValue

      public BigDecimal castToDecimalValue()
      Description copied from interface: Item
      Casts the item to a decimal value (must be a numeric).
      Specified by:
      castToDecimalValue in interface Item
      Returns:
      the BigDecimal value.
    • castToIntegerValue

      public BigInteger castToIntegerValue()
      Description copied from interface: Item
      Casts the item to a big integer value (must be a numeric).
      Specified by:
      castToIntegerValue in interface Item
      Returns:
      the BigInteger value.
    • castToIntValue

      public int castToIntValue()
      Description copied from interface: Item
      Casts the item to an integer value (must be a numeric).
      Specified by:
      castToIntValue in interface Item
      Returns:
      the int value.
    • isNaN

      public boolean isNaN()
      Description copied from interface: Item
      Checks doubles and floats for NaN.
      Specified by:
      isNaN in interface Item
      Returns:
      true if NaN, false if not NaN.
    • generateNativeQuery

      public NativeClauseContext generateNativeQuery(NativeClauseContext context)
      Description copied from interface: Item
      Get sparkSql string for the item
      Specified by:
      generateNativeQuery in interface Item
      Parameters:
      context - input context
      Returns:
      String representing the item in a sparksql query or null if it is not supported for the item
    • getSparkSQLValue

      public String getSparkSQLValue()
      Description copied from interface: Item
      Returns the SparkSQL value of the item for use in a query.
      Specified by:
      getSparkSQLValue in interface Item
      Returns:
      String representing the SparkSQL value of the item.
    • getSparkSQLValue

      public String getSparkSQLValue(ItemType itemType)
      Description copied from interface: Item
      Returns the SparkSQL value of the item for use in a query.
      Specified by:
      getSparkSQLValue in interface Item
      Returns:
      String representing the SparkSQL value of the item.
    • getSparkSQLType

      public String getSparkSQLType()
      Description copied from interface: Item
      Returns the SparkSQL type of the item for use in a query.
      Specified by:
      getSparkSQLType in interface Item
      Returns:
      String representing the SparkSQL type of the item.
    • getVariantValue

      public Object getVariantValue()
      Description copied from interface: Item
      Returns the Object containing the converted value of the item for a DataFrame. For use to build Variant columns.
      Specified by:
      getVariantValue in interface Item
      Returns:
      Object representing the converted value of the item.
    • physicalEquals

      public boolean physicalEquals(Object other)
      Description copied from interface: Item
      Tests for physical equality. The semantics are that of the eq operator.
      Specified by:
      physicalEquals in interface Item
      Parameters:
      other - another item.
      Returns:
      true it is equal to other, false otherwise.
    • isEstimator

      public boolean isEstimator()
      Specified by:
      isEstimator in interface Item
    • getEstimator

      public org.apache.spark.ml.Estimator<?> getEstimator()
      Specified by:
      getEstimator in interface Item
    • isTransformer

      public boolean isTransformer()
      Specified by:
      isTransformer in interface Item
    • getTransformer

      public org.apache.spark.ml.Transformer getTransformer()
      Specified by:
      getTransformer in interface Item
    • getTextValue

      public String getTextValue()
      Description copied from interface: Item
      Returns the string value of the text item, if it is a text item.
      Specified by:
      getTextValue in interface Item
      Returns:
      the string value.
    • addParentToDescendants

      public void addParentToDescendants()
      Description copied from interface: Item
      Method sets the parent item for all descendents of the current item.
      Specified by:
      addParentToDescendants in interface Item
    • attributes

      public List<Item> attributes()
      Description copied from interface: Item
      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."
      Specified by:
      attributes in interface Item
    • children

      public List<Item> children()
      Description copied from interface: Item
      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."
      Specified by:
      children in interface Item
    • namespaceNodes

      public List<Item> namespaceNodes()
      Description copied from interface: Item
      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.
      Specified by:
      namespaceNodes in interface Item
    • declaredNamespaceNodes

      public List<Item> declaredNamespaceNodes()
      Description copied from interface: Item
      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.
      Specified by:
      declaredNamespaceNodes in interface Item
    • nodeKind

      public String nodeKind()
      Description copied from interface: Item
      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.
      Specified by:
      nodeKind in interface Item
    • baseUri

      public List<Item> baseUri()
      Description copied from interface: Item
      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."
      Specified by:
      baseUri in interface Item
    • documentUri

      public List<Item> documentUri()
      Description copied from interface: Item
      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."
      Specified by:
      documentUri in interface Item
    • isId

      public boolean isId()
      Description copied from interface: Item
      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."
      Specified by:
      isId in interface Item
    • isIdrefs

      public boolean isIdrefs()
      Description copied from interface: Item
      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."
      Specified by:
      isIdrefs in interface Item
    • nilled

      public List<Item> nilled()
      Description copied from interface: Item
      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.
      Specified by:
      nilled in interface Item
    • typeName

      public List<Item> typeName()
      Description copied from interface: Item
      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."
      Specified by:
      typeName in interface Item
    • typedValue

      public List<Item> typedValue()
      Description copied from interface: Item
      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.
      Specified by:
      typedValue in interface Item
    • unparsedEntityPublicId

      public List<Item> unparsedEntityPublicId(String name)
      Description copied from interface: Item
      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."
      Specified by:
      unparsedEntityPublicId in interface Item
    • unparsedEntitySystemId

      public List<Item> unparsedEntitySystemId(String name)
      Description copied from interface: Item
      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."
      Specified by:
      unparsedEntitySystemId in interface Item
    • nodeName

      public Name nodeName()
      Description copied from interface: Item
      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."
      Specified by:
      nodeName in interface Item
      Returns:
      the expanded name (Name) of the node, or null when the accessor yields the empty sequence
    • parent

      public Item parent()
      Description copied from interface: Item
      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."
      Specified by:
      parent in interface Item
    • setParent

      public void setParent(Item parent)
      Specified by:
      setParent in interface Item
    • getXmlDocumentPosition

      public XMLDocumentPosition getXmlDocumentPosition()
      Description copied from interface: Item
      Get the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness
      Specified by:
      getXmlDocumentPosition in interface Item
      Returns:
      the XML document position
    • setXmlDocumentPosition

      public int setXmlDocumentPosition(String path, int current)
      Description copied from interface: Item
      Set the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness
      Specified by:
      setXmlDocumentPosition in interface Item
      Parameters:
      path - the path of the XML document
      current - the current position
      Returns:
      the new position
    • getCollection

      public Collection getCollection()
      Description copied from interface: Item
      Returns the collection to which the item belongs, if any. Only defined for top-level items.
      Specified by:
      getCollection in interface Item
      Returns:
      the collection.
    • setCollection

      public void setCollection(Collection collection)
      Description copied from interface: Item
      Sets the collection to which the item belongs. Only defined for top-level items.
      Specified by:
      setCollection in interface Item
      Parameters:
      collection - the collection.
    • getMutabilityLevel

      public int getMutabilityLevel()
      Description copied from interface: Item
      Returns the mutability level of the item.
      Specified by:
      getMutabilityLevel in interface Item
      Returns:
      an int representing nestedness of the item inside transform expressions.
    • setMutabilityLevel

      public void setMutabilityLevel(int mutabilityLevel)
      Description copied from interface: Item
      Sets the mutability level of the item to a supplied value.
      Specified by:
      setMutabilityLevel in interface Item
      Parameters:
      mutabilityLevel - new mutability level.
    • getTopLevelID

      public long getTopLevelID()
      Description copied from interface: Item
      Returns the top level ID of the item.
      Specified by:
      getTopLevelID in interface Item
      Returns:
      int representing the rowID of the item within a DeltaFile.
    • setTopLevelID

      public void setTopLevelID(long topLevelID)
      Description copied from interface: Item
      Sets the top level ID of the item to a supplied value.
      Specified by:
      setTopLevelID in interface Item
      Parameters:
      topLevelID - new top level ID.
    • getPathIn

      public String getPathIn()
      Description copied from interface: Item
      Returns the path from the top level object of a DeltaFile for the item.
      Specified by:
      getPathIn in interface Item
      Returns:
      String representing the path of the item from the top level within a DeltaFile.
    • setPathIn

      public void setPathIn(String pathIn)
      Description copied from interface: Item
      Sets the path from the top level object of a DeltaFile for the item to a supplied value.
      Specified by:
      setPathIn in interface Item
      Parameters:
      pathIn - new path from top level.
    • getTableLocation

      public String getTableLocation()
      Description copied from interface: Item
      Returns the location of the DeltaFile for the item.
      Specified by:
      getTableLocation in interface Item
      Returns:
      String representing the location of the DeltaFile for the item.
    • setTableLocation

      public void setTableLocation(String location)
      Description copied from interface: Item
      Sets the location of the DeltaFile for the item to a supplied value.
      Specified by:
      setTableLocation in interface Item
      Parameters:
      location - new location of the DeltaFile for the item.
    • getTopLevelOrder

      public double getTopLevelOrder()
      Description copied from interface: Item
      Returns the top level order (sequence number) identifier
      Specified by:
      getTopLevelOrder in interface Item
      Returns:
      double representing rowOrder of the tuple
    • setTopLevelOrder

      public void setTopLevelOrder(double topLevelOrder)
      Description copied from interface: Item
      Sets the top level order parameter (rowOrder)
      Specified by:
      setTopLevelOrder in interface Item
      Parameters:
      topLevelOrder - new rowOrder value
    • atomizedValue

      public List<Item> atomizedValue()
      Description copied from interface: Item
      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().
      Specified by:
      atomizedValue in interface Item
    • serialize

      public String serialize()
      Specified by:
      serialize in interface Item
    • serializeAsJSON

      public String serializeAsJSON()
      Specified by:
      serializeAsJSON in interface Item