InputType
- The type of the input the evaluator can use.OutputType
- The type of the output the evaluator will produce.StateType
- State object contained in this object.@CodeReview(reviewer="Kevin R. Dixon", date="2008-02-08", changesNeeded=false, comments="Fixed a couple of comment typos, otherwise looks fine.") public interface StatefulEvaluator<InputType,OutputType,StateType extends CloneableSerializable> extends Evaluator<InputType,OutputType>
StatefulEvaluator
interface defines the functionality of an
Evaluator
that maintains an internal state. It defines the methods
for manipulating the state object.Modifier and Type | Method and Description |
---|---|
StateType |
createDefaultState()
Creates a new default state object.
|
OutputType |
evaluate(InputType input)
Evaluates the object using the given input and current state objects,
returning the output.
|
OutputType |
evaluate(InputType input,
StateType state)
Evaluates the object using the given input and the given state object,
returning the output.
|
StateType |
getState()
Gets the current state of the evaluator.
|
void |
resetState()
Resets the state of the evaluator to a default state.
|
void |
setState(StateType state)
Sets the current state of the evaluator.
|
StateType createDefaultState()
OutputType evaluate(InputType input)
evaluate
in interface Evaluator<InputType,OutputType>
input
- The input to evaluate.OutputType evaluate(InputType input, StateType state)
input
- The input to evaluate.state
- The state to use, which can be modified by side effect.
The current state of the Evaluator will be based on this given
state.StateType getState()
void setState(StateType state)
createDefaultState()
or getState()
should be used for
proper behavior.state
- The new state for the evaluator.void resetState()