@PublicAPI public class ReusableInputProducer extends java.lang.Object implements InputProducer
getNext()
and should be returned by the caller by reuse(java.lang.Object)
- then the
input object is again added to the queue and can be accessed by getNext()
.
This input producer can be used to distribute resources, calculation performer objects
(e.g. plugins).Constructor and Description |
---|
ReusableInputProducer(java.lang.Object[] inputs)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
createInput() |
java.lang.Object |
getNext()
Returns the next input object.
|
boolean |
hasNext()
Returns
true . |
void |
reuse(java.lang.Object input)
Puts an input object into the input queue.
|
public ReusableInputProducer(java.lang.Object[] inputs)
inputs
- the input objectspublic void reuse(java.lang.Object input)
input
- the input objectpublic boolean hasNext() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
true
.hasNext
in interface chemaxon.util.concurrent.util.ConcurrentIterator
true
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public java.lang.Object getNext() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
getNext
in interface chemaxon.util.concurrent.util.ConcurrentIterator
java.lang.InterruptedException
java.util.concurrent.ExecutionException
protected java.lang.Object createInput()