InputType
- The input type of the first evaluator of the list, which is also the
input type of the composite evaluator.OutputType
- The output type of the last evaluator of the list, which is also the
output type of the composite evaluator.public class CompositeEvaluatorList<InputType,OutputType> extends AbstractCloneableSerializable implements Evaluator<InputType,OutputType>
Constructor and Description |
---|
CompositeEvaluatorList()
Creates a new
CompositeEvaluatorList with an empty list of
evaluators. |
CompositeEvaluatorList(java.util.Collection<? extends Evaluator<?,?>> evaluators)
Creates a new
CompositeEvaluatorList from the given collection
of evaluators. |
CompositeEvaluatorList(Evaluator<?,?>... evaluatorsArray)
Creates a new
CompositeEvaluatorList from the given array of
evaluators. |
Modifier and Type | Method and Description |
---|---|
CompositeEvaluatorList<InputType,OutputType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
OutputType |
evaluate(InputType input)
Evaluates the function on the given input and returns the output.
|
java.util.ArrayList<Evaluator<?,?>> |
getEvaluators()
Gets the list of evaluators that is being composed together.
|
void |
setEvaluators(java.util.Collection<? extends Evaluator<?,?>> evaluators)
Sets the list of evaluators to compose together.
|
void |
setEvaluators(Evaluator<?,?>... evaluatorsArray)
Sets the array of evaluators to compose together.
|
public CompositeEvaluatorList()
CompositeEvaluatorList
with an empty list of
evaluators.public CompositeEvaluatorList(Evaluator<?,?>... evaluatorsArray)
CompositeEvaluatorList
from the given array of
evaluators.evaluatorsArray
- The array of evaluators to compose.public CompositeEvaluatorList(java.util.Collection<? extends Evaluator<?,?>> evaluators)
CompositeEvaluatorList
from the given collection
of evaluators. It makes a copy of the given collection.evaluators
- The evaluators to compose.public CompositeEvaluatorList<InputType,OutputType> clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
public OutputType evaluate(InputType input)
Evaluator
evaluate
in interface Evaluator<InputType,OutputType>
input
- The input to evaluate.public java.util.ArrayList<Evaluator<?,?>> getEvaluators()
public void setEvaluators(java.util.Collection<? extends Evaluator<?,?>> evaluators)
evaluators
- The list of evaluators.public void setEvaluators(Evaluator<?,?>... evaluatorsArray)
evaluatorsArray
- The array of evaluators.