Class ArrayCloseableIterator<T>
java.lang.Object
fr.lirmm.graphik.util.stream.AbstractCloseableIterator<T>
fr.lirmm.graphik.util.stream.ArrayCloseableIterator<T>
- Type Parameters:
T- the element type
- All Implemented Interfaces:
CloseableIterator<T>, Closeable, AutoCloseable
Closeable iterator backed by an in-memory array.
-
Constructor Summary
ConstructorsConstructorDescriptionArrayCloseableIterator(T... args) Creates an iterator over the provided array elements. -
Method Summary
Methods inherited from class AbstractCloseableIterator
finalize
-
Constructor Details
-
ArrayCloseableIterator
Creates an iterator over the provided array elements.- Parameters:
args- the elements to iterate over
-
-
Method Details
-
hasNext
Description copied from interface:CloseableIteratorReturns whether another element is available.- Returns:
- true if another element can be read
- Throws:
IteratorException- if the iteration fails
-
next
Description copied from interface:CloseableIteratorReturns the next element.- Returns:
- the next element
- Throws:
IteratorException- if the iteration fails
-
close
public void close()
-