InputType
- The input type for the first evaluator. This is also the input type of
the composite evaluator.IntermediateType
- The output of the first evaluator and input to the second evaluator.OutputType
- The output type of the second evaluator. This is also the output type
of the composite evaluator.@CodeReview(reviewer="Kevin R. Dixon", date="2008-12-02", changesNeeded=false, comments={"I *really* don\'t like the names used by this class.","\'first\' and \'second\' are ambiguous about which one gets fired first.","This is address by the comments, but I would still prefer to see the member names changed.","I\'m not going to flunk this, but I\'m just going on record here."}) public class CompositeEvaluatorPair<InputType,IntermediateType,OutputType> extends DefaultPair<Evaluator<? super InputType,? extends IntermediateType>,Evaluator<? super IntermediateType,? extends OutputType>> implements Evaluator<InputType,OutputType>, java.io.Serializable
first, second
Constructor and Description |
---|
CompositeEvaluatorPair()
Creates a new
CompositeEvalutor . |
CompositeEvaluatorPair(Evaluator<? super InputType,? extends IntermediateType> first,
Evaluator<? super IntermediateType,? extends OutputType> second)
Creates a new
CompositeEvaluatorPair from the two given evaluators. |
Modifier and Type | Method and Description |
---|---|
static <InputType,IntermediateType,OutputType> |
create(Evaluator<? super InputType,? extends IntermediateType> first,
Evaluator<? super IntermediateType,? extends OutputType> second)
A convenience method for creating composite evaluators.
|
OutputType |
evaluate(InputType input)
Evaluates the function on the given input and returns the output.
|
public CompositeEvaluatorPair()
CompositeEvalutor
. The two internal evaluators are
initialized to null.public CompositeEvaluatorPair(Evaluator<? super InputType,? extends IntermediateType> first, Evaluator<? super IntermediateType,? extends OutputType> second)
CompositeEvaluatorPair
from the two given evaluators.first
- The first evaluator.second
- The second evaluator.public OutputType evaluate(InputType input)
Evaluator
evaluate
in interface Evaluator<InputType,OutputType>
input
- The input to evaluate.public static <InputType,IntermediateType,OutputType> CompositeEvaluatorPair<InputType,IntermediateType,OutputType> create(Evaluator<? super InputType,? extends IntermediateType> first, Evaluator<? super IntermediateType,? extends OutputType> second)
InputType
- The input type for the first evaluator.IntermediateType
- The output of the first evaluator and input to the second evaluator.OutputType
- The output type of the second evaluator.first
- The first evaluator.second
- The second evaluator.CompositeEvaluatorPair
from the two given evaluators.