Class ArrayItem

All Implemented Interfaces:
Serializable, Item

public class ArrayItem extends AbstractArrayItem
See Also:
  • Constructor Details

    • ArrayItem

      public ArrayItem()
    • ArrayItem

      public ArrayItem(List<Item> arrayItems)
  • Method Details

    • copy

      public Item copy(boolean mutable)
      Description copied from interface: Item
      Makes a copy.
      Parameters:
      mutable - whether the copy should be mutable (if supported by the item).
      Returns:
      a copy
    • isArray

      public boolean isArray()
      Description copied from interface: Item
      Tests whether the item is an array.
      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.
      Returns:
      true if it is an array of items, false otherwise.
    • getSize

      public int getSize()
      Description copied from interface: Item
      Returns the size of the item, if it is an array, or the number of keys if it is a map.
      Returns:
      the size as an int.
    • getItemMembers

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

      public List<List<Item>> getSequenceMembers()
      Description copied from interface: Item
      Returns the member sequences of the item, if it is an array.
      Returns:
      the list of the members.
    • getItemAt

      public Item getItemAt(int position) throws ArrayIndexOutOfBoundsException
      Description copied from interface: Item
      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:
      ArrayIndexOutOfBoundsException - if the position is out of bounds.
      ArrayIndexOutOfBoundsException
    • getSequenceAt

      public List<Item> getSequenceAt(int position) throws ArrayIndexOutOfBoundsException
      Description copied from interface: Item
      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:
      ArrayIndexOutOfBoundsException - if the position is out of bounds.
      ArrayIndexOutOfBoundsException
    • appendItem

      public void appendItem(Item item)
      Description copied from interface: Item
      Appends an item to the item, if it is an array.
      Parameters:
      item - the item to append.
    • appendSequence

      public void appendSequence(List<Item> sequence) throws OurBadException
      Description copied from interface: Item
      Appends a sequence to the item, if it is an array.
      Parameters:
      sequence - the sequence to append.
      Throws:
      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)
      Description copied from interface: Item
      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.
    • putSequenceAt

      public void putSequenceAt(List<Item> sequence, int index) throws OurBadException
      Description copied from interface: Item
      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:
      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)
      Description copied from interface: Item
      Add all items in items at index i, if it is an array.
      Parameters:
      items - a list of items.
      i - an integer.
    • putSequencesAt

      public void putSequencesAt(List<List<Item>> sequences, int index) throws OurBadException
      Description copied from interface: Item
      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:
      OurBadException - if any member is a non-singleton sequence and the array does not support non-singleton members.
    • removeItemAt

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

      public void removeSequenceAt(int index)
      Description copied from interface: Item
      Removes the sequence at the given index, if it is an array.
      Parameters:
      index - the index to remove the sequence at.
    • getDynamicType

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

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

      public int getMutabilityLevel()
      Description copied from interface: Item
      Returns the mutability level of the 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.
      Parameters:
      mutabilityLevel - new mutability level.
    • getTopLevelID

      public long getTopLevelID()
      Description copied from interface: Item
      Returns the top level ID of the 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.
      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.
      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.
      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.
      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.
      Parameters:
      location - new location of the DeltaFile for the item.
    • getSparkSQLValue

      public String getSparkSQLValue()
      Description copied from interface: Item
      Returns the SparkSQL value of the item for use in a query.
      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.
      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.
      Returns:
      String representing the SparkSQL type of the item.
    • 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().
    • getStringValue

      public String getStringValue()
      Description copied from interface: Item
      Returns the string value of the item, if it is an atomic item.
      Returns:
      the string value.
    • 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.
      Returns:
      Object representing the converted value of the item.
    • 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.
      Parameters:
      collection - the collection.
    • 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.
      Returns:
      the collection.