Package mondrian.calc
Interface TupleIterable
-
- All Known Subinterfaces:
TupleList
- All Known Implementing Classes:
AbstractTupleIterable
,AbstractTupleList
,ArrayTupleList
,DelegatingTupleList
,ListTupleList
,UnaryTupleList
public interface TupleIterable extends Iterable<List<Member>>
Extension toIterable
that returns aTupleIterator
.If efficiency is important, call
tupleCursor()
rather thantupleIterator()
if possible. BecauseTupleCursor
is a simpler API to implement thanTupleIterator
, in some cases the implementation may be more efficient.- Author:
- jhyde
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getArity()
Returns the number of members in each tuple.Iterable<Member>
slice(int column)
Returns an iterable over the members at a given column.TupleCursor
tupleCursor()
Creates a cursor over the contents of this iterable.TupleIterator
tupleIterator()
Creates an iterator over the contents of this iterable.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
tupleIterator
TupleIterator tupleIterator()
Creates an iterator over the contents of this iterable.Always has the same effect as calling
Iterable.iterator()
.- Returns:
- cursor over the tuples returned by this iterable
- See Also:
tupleCursor()
-
tupleCursor
TupleCursor tupleCursor()
Creates a cursor over the contents of this iterable.The contents of the cursor will always be the same as those returned by
tupleIterator()
. BecauseTupleCursor
is a simpler API to implement thanTupleIterator
, in some cases the implementation may be more efficient.- Returns:
- cursor over the tuples returned by this iterable
-
getArity
int getArity()
Returns the number of members in each tuple.- Returns:
- The number of members in each tuple
-
slice
Iterable<Member> slice(int column)
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
>.- Parameters:
column
- Ordinal of the member in each tuple to project- Returns:
- Iterable that returns an iterator over members
- Throws:
IllegalArgumentException
- if column is not less than arity
-
-