public abstract class AbstractTupleIterable extends Object implements TupleIterable
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.
| Modifier and Type | Field and Description |
|---|---|
protected int |
arity |
| Constructor and Description |
|---|
AbstractTupleIterable(int arity)
Creates an AbstractTupleIterable.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getArity()
Returns the number of members in each tuple.
|
Iterator<List<Member>> |
iterator() |
Iterable<Member> |
slice(int column)
Returns an iterable over the members at a given column.
|
TupleIterator |
tupleIterator()
Creates an iterator over the contents of this iterable.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittupleCursorforEach, spliteratorpublic AbstractTupleIterable(int arity)
arity - Arity (number of members per tuple)public int getArity()
TupleIterablegetArity in interface TupleIterablepublic Iterable<Member> slice(int column)
TupleIterableThe 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>.
slice in interface TupleIterablecolumn - Ordinal of the member in each tuple to projectpublic TupleIterator tupleIterator()
TupleIterableAlways has the same effect as calling Iterable.iterator().
tupleIterator in interface TupleIterableTupleIterable.tupleCursor()Copyright © 2020 Hitachi Vantara. All rights reserved.