mondrian.calc
Interface TupleIterable

All Superinterfaces:
Iterable<List<Member>>
All Known Subinterfaces:
TupleList
All Known Implementing Classes:
AbstractEndToEndTupleList, AbstractTupleIterable, AbstractTupleList, ArrayTupleList, DelegatingTupleList, ListTupleList, UnaryTupleList

public interface TupleIterable
extends Iterable<List<Member>>

Extension to Iterable that returns a TupleIterator.

If efficiency is important, call tupleCursor() rather than tupleIterator() if possible. Because TupleCursor is a simpler API to implement than TupleIterator, in some cases the implementation may be more efficient.

Author:
jhyde

Method Summary
 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
iterator
 

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(). Because TupleCursor is a simpler API to implement than TupleIterator, 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 a TupleList, the method is overridden to return a List<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

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads