Package mondrian.calc.impl
Class AbstractTupleIterable
java.lang.Object
mondrian.calc.impl.AbstractTupleIterable
- All Implemented Interfaces:
Iterable<List<Member>>
,TupleIterable
Abstract implementation of
TupleIterable
.
Derived classes need to implement only TupleIterable.tupleCursor()
,
and this implementation will implement tupleIterator()
and
iterator()
by creating a wrapper around that cursor. (The cursor
interface is easier to implement efficiently than the wider iterator
interface.) If you have a more efficient implementation of cursor, override
the tupleIterator
method.
- Author:
- jhyde
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface mondrian.calc.TupleIterable
tupleCursor
-
Field Details
-
arity
protected final int arity
-
-
Constructor Details
-
AbstractTupleIterable
public AbstractTupleIterable(int arity) Creates an AbstractTupleIterable.- Parameters:
arity
- Arity (number of members per tuple)
-
-
Method Details
-
getArity
public int getArity()Description copied from interface:TupleIterable
Returns the number of members in each tuple.- Specified by:
getArity
in interfaceTupleIterable
- Returns:
- The number of members in each tuple
-
slice
Description copied from interface:TupleIterable
Returns an iterable over the members at a given column.The iteratble returns an interator that is modifiable if and only if this TupleIterable is modifiable.
If this
TupleIterable
happens to be aTupleList
, the method is overridden to return aList
<Member
>.- Specified by:
slice
in interfaceTupleIterable
- Parameters:
column
- Ordinal of the member in each tuple to project- Returns:
- Iterable that returns an iterator over members
-
iterator
-
tupleIterator
Description copied from interface:TupleIterable
Creates an iterator over the contents of this iterable.Always has the same effect as calling
Iterable.iterator()
.- Specified by:
tupleIterator
in interfaceTupleIterable
- Returns:
- cursor over the tuples returned by this iterable
- See Also:
-