|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eigenbase.runtime.CompoundTupleIter
public class CompoundTupleIter
CompoundTupleIter creates an iterator out of several iterators.
CompoundTupleIter is serial: it yields all the elements of its first input
Iterator, then all those of its second input, etc. When all inputs are
exhausted, it is done. (Cf CompoundParallelTupleIter.)
| Nested Class Summary | |
|---|---|
static class |
CompoundTupleIter.Test
|
| Nested classes/interfaces inherited from interface org.eigenbase.runtime.TupleIter |
|---|
TupleIter.NoDataReason, TupleIter.TimeoutException |
| Field Summary | |
|---|---|
private int |
i
|
private TupleIter |
iterator
|
private TupleIter[] |
iterators
|
private static Logger |
tracer
|
| Fields inherited from interface org.eigenbase.runtime.TupleIter |
|---|
EMPTY_ITERATOR |
| Constructor Summary | |
|---|---|
CompoundTupleIter(TupleIter[] iterators)
|
|
| Method Summary | |
|---|---|
void |
closeAllocation()
Closes this object. |
Object |
fetchNext()
Returns the next element in the iteration. |
private void |
initIterator()
|
void |
restart()
Restarts this iterator, so that a subsequent call to TupleIter.fetchNext() returns the first element in the collection being
iterated. |
boolean |
setTimeout(long timeout,
boolean asUnderflow)
Sets a timeout for TupleIter.fetchNext(); (optional operation). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Logger tracer
private TupleIter iterator
private TupleIter[] iterators
private int i
| Constructor Detail |
|---|
public CompoundTupleIter(TupleIter[] iterators)
| Method Detail |
|---|
private void initIterator()
public boolean setTimeout(long timeout,
boolean asUnderflow)
TupleIterTupleIter.fetchNext(); (optional operation). Not
all implementing classes support a timeout. For those that do, this
method provides a common interface, For those that do not, the adapter
TimeoutQueueTupleIter puts a timeout queue on top.
setTimeout in interface TupleItertimeout - in milliseconds. 0 means poll, infinity means block.asUnderflow - true means indicate timeout by returning TupleIter.NoDataReason.UNDERFLOW; false means throw TupleIter.TimeoutException on a timeout.
public Object fetchNext()
TupleIterTupleIter.NoDataReason enumeration indicating why
no data was returned.
If this method returns TupleIter.NoDataReason.END_OF_DATA, no further
data will be returned by this iterator unless TupleIter.restart()
is called.
If this method returns TupleIter.NoDataReason.UNDERFLOW, no data is
currently available, but may be come available in the future. It is
possible for consecutive calls to return UNDERFLOW and then END_OF_DATA.
The object returned by this method may be re-used for each subsequent
call to fetchNext(). In other words, callers must either
make certain that the returned value is no longer needed or is copied
before any subsequent calls to fetchNext().
fetchNext in interface TupleIterTupleIter.NoDataReason.public void restart()
TupleIterTupleIter.fetchNext() returns the first element in the collection being
iterated.
restart in interface TupleIterpublic void closeAllocation()
ClosableAllocation
closeAllocation in interface ClosableAllocation
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||