gate.util
Interface ClosableIterator<T>

Type Parameters:
T -
All Superinterfaces:
Iterator<T>
All Known Subinterfaces:
OntologyTupleQuery

public interface ClosableIterator<T>
extends Iterator<T>

An iterator that should be closed as soon as it is not used anymore. The close() method is used to close the iterator at any time. It is not an error to close() an iterator that already has been closed. This iterator also auto-closes when hasNext() is called and no more elements are available.


Method Summary
 void close()
          Close the iteratori and free all resources.
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

close

void close()
Close the iteratori and free all resources. This method can be called more than once, all calls after the first one have no effect. After close() has been called, hasNext() is guaranteed to return false. After close() it is an error the call next(). close will throw a GateRuntimeException in that case. This method is called automatically when hasNext() is called and no more elements are available.