In - input value to map.Out - mapped output value.final class MapPipeProcessor<In,Out> extends AbstractPipeProcessor<In,Out>
FlatMapPipeProcessor,
ZipPipeProcessorhasNextNeedsValue, nextOnSameSourceOnNoValue| Constructor and Description |
|---|
MapPipeProcessor(Function<In,Out> functor)
Constructs a
MapPipeProcessor instance. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearOutputValue()
Clears the processed result after being returned by
AbstractPipeProcessor.retrieveOutputValue(). |
<R> boolean |
enqueueMap(Function<Out,R> mapper)
Returns true and aggregates the given
mapper to the
end of existing mappers, otherwise it returns false. |
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.
|
void |
processInputValue(In value)
Processes an input value in order to return a result, if any.
|
<R> boolean |
pushFrontMap(Function<Out,R> mapper)
Returns true and aggregates the given
mapper to the
top of the existing mappers, otherwise it returns false. |
protected Out |
retrieveOutputValue()
Retrieves the processed result produced by
AbstractPipeProcessor.processInputValue(Object). |
enqueueFilter, getNext, getOutputValue, getSource, pushFrontFilter, setNext, setSourcepublic MapPipeProcessor(Function<In,Out> functor)
MapPipeProcessor instance.
The new MapPipeProcessor instance stores its functor
internally.
functor - Function mapping input elements to
output elements.public <R> boolean pushFrontMap(Function<Out,R> mapper)
AbstractPipeProcessormapper to the
top of the existing mappers, otherwise it returns false.
This method returns false by default. The only
AbstractPipeProcessor capable of mapping aggregation is
MapPipeProcessor.
pushFrontMap in class AbstractPipeProcessor<In,Out>R - type of mapped enumerated elements.mapper - mapping Function.public <R> boolean enqueueMap(Function<Out,R> mapper)
AbstractPipeProcessormapper to the
end of existing mappers, otherwise it returns false.
This method returns false by default. The only
AbstractPipeProcessor capable of mapping aggregation is
MapPipeProcessor.
enqueueMap in class AbstractPipeProcessor<In,Out>R - type of mapped enumerated elements.mapper - mapping Function.public 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.