InputType
- The type of input the forward evaluator. Also the output of the
reverse evaluator.OutputType
- The type of output of the forward evaluator. Also the input of the
reverse evaluatorForwardType
- The type of the forward evaluator.ReverseType
- The type of the reverse evaluator.public class ForwardReverseEvaluatorPair<InputType,OutputType,ForwardType extends Evaluator<? super InputType,? extends OutputType>,ReverseType extends Evaluator<? super OutputType,? extends InputType>> extends AbstractCloneableSerializable implements ReversibleEvaluator<InputType,OutputType,ForwardReverseEvaluatorPair<OutputType,InputType,ReverseType,ForwardType>>
Modifier and Type | Field and Description |
---|---|
protected ForwardType |
forward
The forward evaluator from input type to output type.
|
protected ReverseType |
reverse
The reverse evaluator from output type to input type.
|
Constructor and Description |
---|
ForwardReverseEvaluatorPair()
Creates a new, empty
ForwardReverseEvaluatorPair . |
ForwardReverseEvaluatorPair(ForwardType forward,
ReverseType reverse)
Creates a new
ForwardReverseEvaluatorPair . |
Modifier and Type | Method and Description |
---|---|
static <InputType,OutputType,ForwardType extends Evaluator<? super InputType,? extends OutputType>,ReverseType extends Evaluator<? super OutputType,? extends InputType>> |
create(ForwardType forward,
ReverseType reverse)
Convenience method for creating a new forward-reverse evaluator pair.
|
OutputType |
evaluate(InputType input)
Evaluates the function on the given input and returns the output.
|
InputType |
evaluateReverse(OutputType output)
Evaluates the reverse evaluator on a given object of output type.
|
ForwardType |
getForward()
Gets the forward evaluator that maps input type to output type.
|
ReverseType |
getReverse()
Gets the reverse evaluator that maps output type to input type.
|
ForwardReverseEvaluatorPair<OutputType,InputType,ReverseType,ForwardType> |
reverse()
Gets the data converter that performs the reverse conversion.
|
void |
setForward(ForwardType forward)
Sets the forward evaluator that maps input type to output type.
|
void |
setReverse(ReverseType reverse)
Sets the reverse evaluator that maps output type to input type.
|
clone
protected ForwardType extends Evaluator<? super InputType,? extends OutputType> forward
protected ReverseType extends Evaluator<? super OutputType,? extends InputType> reverse
public ForwardReverseEvaluatorPair()
ForwardReverseEvaluatorPair
.public ForwardReverseEvaluatorPair(ForwardType forward, ReverseType reverse)
ForwardReverseEvaluatorPair
.forward
- The forward evaluator.reverse
- The reverse evaluator.public ForwardReverseEvaluatorPair<OutputType,InputType,ReverseType,ForwardType> reverse()
ReversibleEvaluator
reverse
in interface ReversibleEvaluator<InputType,OutputType,ForwardReverseEvaluatorPair<OutputType,InputType,ReverseType extends Evaluator<? super OutputType,? extends InputType>,ForwardType extends Evaluator<? super InputType,? extends OutputType>>>
public OutputType evaluate(InputType input)
Evaluator
evaluate
in interface Evaluator<InputType,OutputType>
input
- The input to evaluate.public InputType evaluateReverse(OutputType output)
output
- The object of output type to pass to the reverse evaluator.public ForwardType getForward()
public void setForward(ForwardType forward)
forward
- The forward evaluator.public ReverseType getReverse()
public void setReverse(ReverseType reverse)
reverse
- The reverse evaluator.public static <InputType,OutputType,ForwardType extends Evaluator<? super InputType,? extends OutputType>,ReverseType extends Evaluator<? super OutputType,? extends InputType>> ForwardReverseEvaluatorPair<InputType,OutputType,ForwardType,ReverseType> create(ForwardType forward, ReverseType reverse)
InputType
- The input type for the forward evaluator. Also the output type of
the reverse evaluator.OutputType
- The output type for the forward evaluator. Also the input type of
the reverse evaluator.ForwardType
- The type of the forward evaluator.ReverseType
- The type of the reverse evaluator.forward
- The forward evaluator.reverse
- The reverse evaluator.