Class ArrayBlockingQueueToCloseableIteratorAdapter<T>
java.lang.Object
fr.lirmm.graphik.util.stream.AbstractCloseableIterator<T>
fr.lirmm.graphik.util.stream.ArrayBlockingQueueToCloseableIteratorAdapter<T>
- Type Parameters:
T- type of elements of the iterator
- All Implemented Interfaces:
CloseableIterator<T>, Closeable, AutoCloseable
Adapts a closeable iterator to a buffered closeable iterator backed by an array-blocking stream.
- Author:
- Clément Sipieter (INRIA) <clement@6pi.fr>
-
Constructor Summary
ConstructorsConstructorDescriptionAdapts the specified iterator with the default buffer size.ArrayBlockingQueueToCloseableIteratorAdapter(CloseableIterator<T> it, int bufferSize) Adapts the specified iterator with a bounded buffer. -
Method Summary
Methods inherited from class AbstractCloseableIterator
finalize
-
Constructor Details
-
ArrayBlockingQueueToCloseableIteratorAdapter
Adapts the specified iterator with the default buffer size.- Parameters:
it- the iterator to adapt
-
ArrayBlockingQueueToCloseableIteratorAdapter
Adapts the specified iterator with a bounded buffer.- Parameters:
it- the iterator to adaptbufferSize- the internal buffer size
-
-
Method Details
-
close
public void close() -
hasNext
public boolean hasNext()Description copied from interface:CloseableIteratorReturns whether another element is available.- Returns:
- true if another element can be read
-
next
Description copied from interface:CloseableIteratorReturns the next element.- Returns:
- the next element
-