Package com.kuzudb

Class KuzuList

java.lang.Object
com.kuzudb.KuzuList
All Implemented Interfaces:
AutoCloseable

public class KuzuList extends Object implements AutoCloseable
  • Constructor Details

    • KuzuList

      public KuzuList(Value value)
      Construct a list from a value
      Parameters:
      value - the value to construct the list from
    • KuzuList

      public KuzuList(Value[] values)
      Construct a list literal from an array of values
      Parameters:
      values - : the array to construct the list from
    • KuzuList

      public KuzuList(DataType type, long numElements)
      Construct a list of a specific size populated with the default element
      Parameters:
      numElements - : the size of the list to construct
  • Method Details

    • getValue

      public Value getValue()
      Returns:
      Gets the underlying Value for the list
    • getListSize

      public long getListSize()
      Get the size of the list.
      Returns:
      The size of the list.
      Throws:
      RuntimeException - If the list has been destroyed.
    • getListElement

      public Value getListElement(long index)
      Get the element at the given index from the given list.
      Parameters:
      index - : The index of the element.
      Returns:
      The element at the given index from the given list.
      Throws:
      RuntimeException - If the list has been destroyed.
    • toArray

      public Value[] toArray()
      Gets the elements the list as a Java array. This will be truncated if the size of the list doesn't fit in a 32-bit integer.
      Returns:
      the list as a Java array
      Throws:
      RuntimeException
    • close

      public void close()
      Closes this object, relinquishing the underlying value
      Specified by:
      close in interface AutoCloseable
      Throws:
      RuntimeException