org.eigenbase.runtime
Class AbstractTupleIter

java.lang.Object
  extended by org.eigenbase.runtime.AbstractTupleIter
All Implemented Interfaces:
TupleIter, ClosableAllocation
Direct Known Subclasses:
CompoundParallelTupleIter, CompoundTupleIter.Test.BoxTupleIter, FennelAbstractTupleIter, MedMockTupleIter, RestartableCollectionTupleIter, RestartableIteratorTupleIter, ResultSetTupleIter, TimeoutQueueTupleIterTest.TickIterator

public abstract class AbstractTupleIter
extends Object
implements TupleIter

A base class for implementations of TupleIter, with default implementations of some of its methods.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/runtime/AbstractTupleIter.java#4 $
Author:
Marc Berkowitz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eigenbase.runtime.TupleIter
TupleIter.NoDataReason, TupleIter.TimeoutException
 
Field Summary
 
Fields inherited from interface org.eigenbase.runtime.TupleIter
EMPTY_ITERATOR
 
Constructor Summary
AbstractTupleIter()
           
 
Method Summary
 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
 
Methods inherited from interface org.eigenbase.runtime.TupleIter
fetchNext
 
Methods inherited from interface org.eigenbase.util.ClosableAllocation
closeAllocation
 

Constructor Detail

AbstractTupleIter

public AbstractTupleIter()
Method Detail

setTimeout

public boolean setTimeout(long timeout,
                          boolean asUnderflow)
Description copied from interface: TupleIter
Sets a timeout for TupleIter.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.

Specified by:
setTimeout in interface TupleIter
Parameters:
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.
Returns:
true if the timeout was set, false if the implementing class does not support a timeout.

restart

public void restart()
Description copied from interface: TupleIter
Restarts this iterator, so that a subsequent call to TupleIter.fetchNext() returns the first element in the collection being iterated.

Specified by:
restart in interface TupleIter