Interface ArrayReader

All Superinterfaces:
ColumnReader
All Known Subinterfaces:
DictReader
All Known Implementing Classes:
ArrayReaderImpl, DictReaderImpl

public interface ArrayReader extends ColumnReader
Generic array reader. An array is one of the following:
  • Array of scalars. Read the values using #elements(), which provides an array-like access to the scalars.
  • A repeated map. Use #tuple(int) to get a tuple reader for a specific array element. Use size() to learn the number of maps in the array.
  • List of lists. Use the #array(int) method to get the nested list at a given index. Use size() to learn the number of maps in the array.
  • Method Details

    • size

      int size()
      Number of elements in the array.
      Returns:
      the number of elements
    • entryType

      ObjectType entryType()
      The object type of the list entry. All entries have the same type.
      Returns:
      the object type of each entry
    • entry

      ObjectReader entry()
      Return the generic object reader for the array element. This version does not position the reader, the client must call setPosn(int) to set the position. This form allows up-front setup of the readers when convenient for the caller.
    • scalar

      ScalarReader scalar()
    • tuple

      TupleReader tuple()
    • array

      ArrayReader array()
    • variant

      VariantReader variant()
    • setPosn

      void setPosn(int index)
      Set the array reader to read a given array entry. Not used for scalars, only for maps and arrays when using the non-indexed methods entry(), tuple() and array().
    • rewind

      void rewind()
    • next

      boolean next()
      Move forward one position.
      Returns:
      true if another position is available, false if the end of the array is reached