Class LinkedBlockingStream<T>
java.lang.Object
fr.lirmm.graphik.util.stream.AbstractCloseableIterator<T>
fr.lirmm.graphik.util.stream.LinkedBlockingStream<T>
- Type Parameters:
T- type of elements stored in the stream
- All Implemented Interfaces:
CloseableIterator<T>, Writer<T>, Closeable, AutoCloseable
Concurrent in-memory stream backed by a linked queue.
- Author:
- Clément Sipieter (INRIA) clement@6pi.fr
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a blocking stream with the default queue bounds. -
Method Summary
Methods inherited from class AbstractCloseableIterator
finalize
-
Constructor Details
-
LinkedBlockingStream
public LinkedBlockingStream()Creates a blocking stream with the default queue bounds.
-
-
Method Details
-
write
-
hasNext
public boolean hasNext()Description copied from interface:CloseableIteratorReturns whether another element is available.- Specified by:
hasNextin interfaceCloseableIterator<T>- Returns:
- true if another element can be read
-
next
Description copied from interface:CloseableIteratorReturns the next element.- Specified by:
nextin interfaceCloseableIterator<T>- Returns:
- the next element
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCloseableIterator<T>
-
write
Description copied from interface:WriterWrites all objects provided by the iterator.- Specified by:
writein interfaceWriter<T>- Parameters:
it- the objects to write- Throws:
IOException- if the write fails
-