Class CloseableIteratorAdapter<T>
java.lang.Object
fr.inria.rules.integraal.util.stream.CloseableIteratorAdapter<T>
- Type Parameters:
T- type of elements of the iterator
- All Implemented Interfaces:
CloseableIterator<T>, CloseableIteratorWithoutException<T>, Closeable, AutoCloseable, Iterator<T>
public class CloseableIteratorAdapter<T>
extends Object
implements CloseableIteratorWithoutException<T>
Adapts a standard iterator to the closeable-iterator API.
- Author:
- Clément Sipieter (INRIA) <clement@6pi.fr>
-
Constructor Summary
ConstructorsConstructorDescriptionCloseableIteratorAdapter(Iterator<T> iterator) Creates an adapter around the supplied iterator. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining, remove
-
Constructor Details
-
CloseableIteratorAdapter
-
-
Method Details
-
hasNext
public boolean hasNext()Description copied from interface:CloseableIteratorIndicates whether another element can be read from the iterator.- Specified by:
hasNextin interfaceCloseableIterator<T>- Specified by:
hasNextin interfaceCloseableIteratorWithoutException<T>- Specified by:
hasNextin interfaceIterator<T>- Returns:
- true iff there is a next element
-
next
Description copied from interface:CloseableIteratorReturns the next element from the iterator.- Specified by:
nextin interfaceCloseableIterator<T>- Specified by:
nextin interfaceCloseableIteratorWithoutException<T>- Specified by:
nextin interfaceIterator<T>- Returns:
- the next element
-
close
public void close()Description copied from interface:CloseableIteratorCloses the iterator and releases its resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCloseableIterator<T>
-