|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TupleIter
TupleIter provides an Iterator-like interface for reading tuple data.
TupleIter replaces the combination of Iterator
and
RestartableIterator
.
Note that calling closeAllocation()
closes this iterator, allowing it to release its
resources. No further calls to fetchNext()
or restart()
may be made once the iterator is closed.
Nested Class Summary | |
---|---|
static class |
TupleIter.NoDataReason
NoDataReason provides a reason why no data was returned by a call to fetchNext() . |
static class |
TupleIter.TimeoutException
One way to indicate that fetchNext() timed-out. |
Field Summary | |
---|---|
static TupleIter |
EMPTY_ITERATOR
|
Method Summary | |
---|---|
Object |
fetchNext()
Returns the next element in the iteration. |
void |
restart()
Restarts this iterator, so that a subsequent call to fetchNext() returns the first element in the collection being
iterated. |
boolean |
setTimeout(long timeout,
boolean asUnderflow)
Sets a timeout for fetchNext() ; (optional operation). |
Methods inherited from interface org.eigenbase.util.ClosableAllocation |
---|
closeAllocation |
Field Detail |
---|
static final TupleIter EMPTY_ITERATOR
Method Detail |
---|
Object fetchNext()
TupleIter.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 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()
.
TupleIter.NoDataReason
.boolean setTimeout(long timeout, boolean asUnderflow)
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.
timeout
- 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.
void restart()
fetchNext()
returns the first element in the collection being
iterated.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |