Class EnumeratorCursor<T>

java.lang.Object
org.apache.calcite.avatica.util.AbstractCursor
org.apache.calcite.avatica.util.PositionedCursor<T>
org.apache.calcite.runtime.EnumeratorCursor<T>
Type Parameters:
T - Element type
All Implemented Interfaces:
AutoCloseable, org.apache.calcite.avatica.util.Cursor
Direct Known Subclasses:
ArrayEnumeratorCursor, RecordEnumeratorCursor

public abstract class EnumeratorCursor<T> extends org.apache.calcite.avatica.util.PositionedCursor<T>
Implementation of Cursor on top of an Enumerator that returns a record for each row. The returned record is cached to avoid multiple computations of current row. For instance, EnumerableCalc computes result just in current() method, thus it makes sense to cache the result and make it available for all the accessors.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.calcite.avatica.util.PositionedCursor

    org.apache.calcite.avatica.util.PositionedCursor.ArrayGetter, org.apache.calcite.avatica.util.PositionedCursor.FieldGetter, org.apache.calcite.avatica.util.PositionedCursor.ListGetter, org.apache.calcite.avatica.util.PositionedCursor.MapGetter<K>, org.apache.calcite.avatica.util.PositionedCursor.ObjectGetter

    Nested classes/interfaces inherited from class org.apache.calcite.avatica.util.AbstractCursor

    org.apache.calcite.avatica.util.AbstractCursor.AbstractGetter, org.apache.calcite.avatica.util.AbstractCursor.ArrayAccessor, org.apache.calcite.avatica.util.AbstractCursor.Getter, org.apache.calcite.avatica.util.AbstractCursor.SlotGetter, org.apache.calcite.avatica.util.AbstractCursor.StructGetter

    Nested classes/interfaces inherited from interface org.apache.calcite.avatica.util.Cursor

    org.apache.calcite.avatica.util.Cursor.Accessor
  • Field Summary

    Fields inherited from class org.apache.calcite.avatica.util.AbstractCursor

    wasNull
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates an EnumeratorCursor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected T
     
    boolean
     

    Methods inherited from class org.apache.calcite.avatica.util.AbstractCursor

    createAccessor, createAccessor, createAccessors, createGetter, wasNull

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EnumeratorCursor

      protected EnumeratorCursor(Enumerator<T> enumerator)
      Creates an EnumeratorCursor.
      Parameters:
      enumerator - input enumerator
  • Method Details

    • current

      protected T current()
      Specified by:
      current in class org.apache.calcite.avatica.util.PositionedCursor<T>
    • next

      public boolean next()
      Specified by:
      next in interface org.apache.calcite.avatica.util.Cursor
      Specified by:
      next in class org.apache.calcite.avatica.util.AbstractCursor
    • close

      public void close()