Class QueueStream<T>
java.lang.Object
fr.lirmm.graphik.util.stream.AbstractCloseableIterator<T>
fr.lirmm.graphik.util.stream.QueueStream<T>
- Type Parameters:
T- type of elements stored in the stream
- All Implemented Interfaces:
CloseableIterator<T>, CloseableIteratorWithoutException<T>, InMemoryStream<T>, Stream<T>, Writer<T>, Closeable, AutoCloseable, Iterator<T>
In-memory stream backed by a plain queue.
- Author:
- Clément Sipieter (INRIA) <clement@6pi.fr>
-
Constructor Details
-
QueueStream
public QueueStream()Creates an empty queue-backed stream.
-
-
Method Details
-
write
-
hasNext
public boolean hasNext()Description copied from interface:CloseableIteratorReturns whether another element is available.- Specified by:
hasNextin interfaceCloseableIterator<T>- Specified by:
hasNextin interfaceCloseableIteratorWithoutException<T>- Specified by:
hasNextin interfaceIterator<T>- Returns:
- true if another element can be read
-
next
Description copied from interface:CloseableIteratorReturns the next element.- Specified by:
nextin interfaceCloseableIterator<T>- Specified by:
nextin interfaceCloseableIteratorWithoutException<T>- Specified by:
nextin interfaceIterator<T>- Returns:
- the next element
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCloseableIterator<T>
-
write
-