Package org.apache.calcite.runtime
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
ModifierConstructorDescriptionprotected
EnumeratorCursor
(Enumerator<T> enumerator) Creates anEnumeratorCursor
. -
Method Summary
Methods inherited from class org.apache.calcite.avatica.util.AbstractCursor
createAccessor, createAccessor, createAccessors, createGetter, wasNull
-
Constructor Details
-
EnumeratorCursor
Creates anEnumeratorCursor
.- Parameters:
enumerator
- input enumerator
-
-
Method Details
-
current
- Specified by:
current
in classorg.apache.calcite.avatica.util.PositionedCursor<T>
-
next
public boolean next()- Specified by:
next
in interfaceorg.apache.calcite.avatica.util.Cursor
- Specified by:
next
in classorg.apache.calcite.avatica.util.AbstractCursor
-
close
public void close()
-