Class SingletonCloseableIteratorWithoutException<E>
java.lang.Object
fr.lirmm.graphik.util.stream.SingletonCloseableIteratorWithoutException<E>
- Type Parameters:
E- type of elements of the iterator
- All Implemented Interfaces:
CloseableIterator<E>, CloseableIteratorWithoutException<E>, Closeable, AutoCloseable, Iterator<E>
public class SingletonCloseableIteratorWithoutException<E>
extends Object
implements CloseableIteratorWithoutException<E>
Closeable iterator without checked exceptions over a single element.
- Author:
- Clément Sipieter (INRIA) <clement@6pi.fr>
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an iterator over a single element. -
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
-
SingletonCloseableIteratorWithoutException
Creates an iterator over a single element.- Parameters:
e- the unique element
-
-
Method Details
-
hasNext
public boolean hasNext()Description copied from interface:CloseableIteratorReturns whether another element is available.- Specified by:
hasNextin interfaceCloseableIterator<E>- Specified by:
hasNextin interfaceCloseableIteratorWithoutException<E>- Specified by:
hasNextin interfaceIterator<E>- Returns:
- true if another element can be read
-
next
Description copied from interface:CloseableIteratorReturns the next element.- Specified by:
nextin interfaceCloseableIterator<E>- Specified by:
nextin interfaceCloseableIteratorWithoutException<E>- Specified by:
nextin interfaceIterator<E>- Returns:
- the next element
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCloseableIterator<E>
-