Class EnumeratorCursor<T>

  • Type Parameters:
    T - Element type
    All Implemented Interfaces:
    java.lang.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 extends java.lang.Object>, 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 
      Modifier and Type Field Description
      private Enumerator<T> enumerator  
      • Fields inherited from class org.apache.calcite.avatica.util.AbstractCursor

        wasNull
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected EnumeratorCursor​(Enumerator<T> enumerator)
      Creates a EnumeratorCursor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      protected T current()  
      boolean next()  
      • 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
    • Field Detail

    • Constructor Detail

      • EnumeratorCursor

        protected EnumeratorCursor​(Enumerator<T> enumerator)
        Creates a EnumeratorCursor
        Parameters:
        enumerator - input enumerator
    • Method Detail

      • 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()