Class LazyObjectItem

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

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

    • LazyObjectItem

      public LazyObjectItem()
  • 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.
    • 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(Item 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(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.
    • removeItemByKey

      public void removeItemByKey(String key)
      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.
    • removeItemByKey

      public void removeItemByKey(Item key)
      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.
    • putLazyItemByKey

      public void putLazyItemByKey(String key, RuntimeIterator iterator, DynamicContext context, boolean isArray)
      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.
    • 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
    • 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.
    • 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.
    • 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.
    • 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.