In - input value mapped to an Iterator.Out - output value from the generated sub-iterator.final class FlatMapPipeProcessor<In,Out> extends AbstractPipeMultiProcessor<In,Out>
MapPipeProcessor,
ZipPipeProcessorhasNextNeedsValue, nextOnSameSourceOnNoValue| Constructor and Description |
|---|
FlatMapPipeProcessor(Function<In,Iterator<Out>> mapper)
Constructs a
FlatMapPipeProcessor instances. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearOutputValue()
Clears the processed result after being returned by
AbstractPipeProcessor.retrieveOutputValue(). |
boolean |
hasOutputValue()
Gets whether processing was successful and the processor has a value
to yield.
|
boolean |
isInactive()
Gets whether the processor does not process any more and the pipeline
up to it should be discarded.
|
boolean |
needsValue()
Gets whether the processor needs a fresh input value to produce output
values.
|
void |
processInputValue(In value)
Processes an input value in order to return a result, if any.
|
protected Out |
retrieveOutputValue()
Retrieves the processed result produced by
AbstractPipeProcessor.processInputValue(Object). |
enqueueFilter, enqueueMap, getNext, getOutputValue, getSource, pushFrontFilter, pushFrontMap, setNext, setSourcepublic boolean needsValue()
AbstractPipeMultiProcessor
Unlike AbstractPipeProcessor, this type of processor may yield
more than one output for a single input. This means feeding in input
values must be put on hold as long as the current processor still has
output values to provide. This state ends when needsValue returns
true.
needsValue in class AbstractPipeMultiProcessor<In,Out>AbstractPipeProcessorpublic void processInputValue(In value)
AbstractPipeProcessorThe result of processing must be stored internally.
processInputValue in class AbstractPipeProcessor<In,Out>value - Value to process.AbstractPipeProcessor.hasOutputValue(),
AbstractPipeProcessor.getOutputValue()public boolean hasOutputValue()
AbstractPipeProcessor
If AbstractPipeProcessor.hasOutputValue() returns false than no internal
storage of input or output may take place.
hasOutputValue in class AbstractPipeProcessor<In,Out>AbstractPipeProcessor.processInputValue(java.lang.Object),
AbstractPipeProcessor.getOutputValue()protected Out retrieveOutputValue()
AbstractPipeProcessorAbstractPipeProcessor.processInputValue(Object).retrieveOutputValue in class AbstractPipeProcessor<In,Out>AbstractPipeProcessor.getOutputValue(),
AbstractPipeProcessor.clearOutputValue()protected void clearOutputValue()
AbstractPipeProcessorAbstractPipeProcessor.retrieveOutputValue().clearOutputValue in class AbstractPipeProcessor<In,Out>AbstractPipeProcessor.getOutputValue(),
AbstractPipeProcessor.retrieveOutputValue()public boolean isInactive()
AbstractPipeProcessor
AbstractPipeProcessor.isInactive() returning true is equivalent to the
situation when no matter with what value
AbstractPipeProcessor.processInputValue(Object) will be called,
AbstractPipeProcessor.hasOutputValue() will always return false.
Most processors have this function return false with the
exception of while and limit compositions. These will
turn completely inactive once a certain condition is met.
isInactive in class AbstractPipeProcessor<In,Out>true if processing must stop, false otherwise.Copyright © 2016. All rights reserved.