Package mondrian.calc.impl
Class AbstractTupleCursor
- java.lang.Object
-
- mondrian.calc.impl.AbstractTupleCursor
-
- All Implemented Interfaces:
TupleCursor
- Direct Known Subclasses:
AbstractTupleIterator
public abstract class AbstractTupleCursor extends Object implements TupleCursor
Abstract implementation ofTupleIterator
.Derived classes need to implement only
TupleCursor.forward()
.- Author:
- jhyde
-
-
Field Summary
Fields Modifier and Type Field Description protected int
arity
-
Constructor Summary
Constructors Constructor Description AbstractTupleCursor(int arity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
currentToArray(Member[] members, int offset)
Writes the member(s) of the next tuple to a given offset in an array.int
getArity()
Returns the number of members in each tuple.Member
member(int column)
void
setContext(Evaluator evaluator)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface mondrian.calc.TupleCursor
current, forward
-
-
-
-
Method Detail
-
setContext
public void setContext(Evaluator evaluator)
- Specified by:
setContext
in interfaceTupleCursor
-
currentToArray
public void currentToArray(Member[] members, int offset)
Description copied from interface:TupleCursor
Writes 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:
currentToArray
in interfaceTupleCursor
- Parameters:
members
- Membersoffset
- Offset in the array to write to
-
getArity
public int getArity()
Description copied from interface:TupleCursor
Returns the number of members in each tuple.- Specified by:
getArity
in interfaceTupleCursor
- Returns:
- The number of members in each tuple
-
member
public Member member(int column)
- Specified by:
member
in interfaceTupleCursor
-
-