Package mondrian.calc

Interface TupleIterable

All Superinterfaces:
Iterable<List<Member>>
All Known Subinterfaces:
TupleList
All Known Implementing Classes:
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 Details

    • 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()
      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