Package org.apache.calcite.avatica.util
Class AbstractCursor
java.lang.Object
org.apache.calcite.avatica.util.AbstractCursor
- All Implemented Interfaces:
AutoCloseable,Cursor
- Direct Known Subclasses:
PositionedCursor
Base class for implementing a cursor.
Derived class needs to provide AbstractCursor.Getter and can override
Cursor.Accessor implementations if it
wishes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classAbstract implementation ofAbstractCursor.Getter.static classAccessor that assumes that the underlying value is an ARRAY; corresponds toTypes.ARRAY.protected static interfaceGets a value from a particular field of the current record of this cursor.classImplementation ofAbstractCursor.Getterthat returns the current contents of a mutable slot.classImplementation ofAbstractCursor.Getterthat returns the value of a given field of the current contents of another getter.Nested classes/interfaces inherited from interface org.apache.calcite.avatica.util.Cursor
Cursor.Accessor -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final boolean[]Slot into which each accessor should write whether the value returned was null. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Cursor.AccessorcreateAccessor(ColumnMetaData columnMetaData, int ordinal, Calendar localCalendar, ArrayImpl.Factory factory) protected Cursor.AccessorcreateAccessor(ColumnMetaData columnMetaData, AbstractCursor.Getter getter, Calendar localCalendar, ArrayImpl.Factory factory) createAccessors(List<ColumnMetaData> types, Calendar localCalendar, ArrayImpl.Factory factory) Creates a list of accessors, one per column.protected abstract AbstractCursor.GettercreateGetter(int ordinal) abstract booleannext()Moves to the next row.booleanwasNull()Returns whether the last value returned was null.
-
Field Details
-
wasNull
protected final boolean[] wasNullSlot into which each accessor should write whether the value returned was null.
-
-
Constructor Details
-
AbstractCursor
protected AbstractCursor()
-
-
Method Details
-
wasNull
public boolean wasNull()Description copied from interface:CursorReturns whether the last value returned was null. -
createAccessors
public List<Cursor.Accessor> createAccessors(List<ColumnMetaData> types, Calendar localCalendar, ArrayImpl.Factory factory) Description copied from interface:CursorCreates a list of accessors, one per column.- Specified by:
createAccessorsin interfaceCursor- Parameters:
types- List of column types, perTypes.localCalendar- Calendar in local time zonefactory- Factory that creates sub-ResultSets when needed- Returns:
- List of column accessors
-
createAccessor
protected Cursor.Accessor createAccessor(ColumnMetaData columnMetaData, int ordinal, Calendar localCalendar, ArrayImpl.Factory factory) -
createAccessor
protected Cursor.Accessor createAccessor(ColumnMetaData columnMetaData, AbstractCursor.Getter getter, Calendar localCalendar, ArrayImpl.Factory factory) -
createGetter
-
next
public abstract boolean next()Description copied from interface:CursorMoves to the next row.
-