Package mondrian.calc.impl
Class AbstractTupleCursor
java.lang.Object
mondrian.calc.impl.AbstractTupleCursor
- All Implemented Interfaces:
TupleCursor
- Direct Known Subclasses:
AbstractTupleIterator
Abstract implementation of
TupleIterator.
Derived classes need to implement only TupleCursor.forward().
- Author:
- jhyde
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcurrentToArray(Member[] members, int offset) Writes the member(s) of the next tuple to a given offset in an array.intgetArity()Returns the number of members in each tuple.member(int column) voidsetContext(Evaluator evaluator) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface mondrian.calc.TupleCursor
current, forward
-
Field Details
-
arity
protected final int arity
-
-
Constructor Details
-
AbstractTupleCursor
public AbstractTupleCursor(int arity)
-
-
Method Details
-
setContext
- Specified by:
setContextin interfaceTupleCursor
-
currentToArray
Description copied from interface:TupleCursorWrites the member(s) of the next tuple to a given offset in an array.This method saves the overhead of a memory allocation when the resulting tuple will be written immediately to an array. The effect of
currentToArray(members, 0)is the same as callingcurrent().toArray(members).Before calling this method, you must position the iterator at a valid position. Typically you would call hasNext followed by next; or forward.
- Specified by:
currentToArrayin interfaceTupleCursor- Parameters:
members- Membersoffset- Offset in the array to write to
-
getArity
public int getArity()Description copied from interface:TupleCursorReturns the number of members in each tuple.- Specified by:
getArityin interfaceTupleCursor- Returns:
- The number of members in each tuple
-
member
- Specified by:
memberin interfaceTupleCursor
-