public class ThresholdFunctionSimpleEvaluator extends AggregationFunction
Constructor and Description |
---|
ThresholdFunctionSimpleEvaluator(java.lang.String function)
Creates a new instance of ThresholdFunctionSimpleEvaluator.
|
Modifier and Type | Method and Description |
---|---|
float |
compute(float... distances)
Computes the value of the aggregate distance from the provided sub-distances.
|
int |
getParameterCount()
Returns the number of distance parameters (i.e. the descriptor names) for the
AggregationFunction.compute(float...) function. |
java.lang.String |
getParameterName(int index)
Returns the name of the
index th distance parameter (i.e. the descriptor name) for the AggregationFunction.compute(float...) function. |
java.lang.String |
toString()
Returns a string representation of the encapsulated function.
|
getDistance, getDistance, getDistanceObjectClass, getFactoryClass, getParameterMaximalDistance, setFactoryClass, valueOf
public ThresholdFunctionSimpleEvaluator(java.lang.String function) throws java.lang.IllegalArgumentException
function
- the function stringjava.lang.IllegalArgumentException
- if the specified function cannot be parsedpublic float compute(float... distances)
AggregationFunction
distances
array items must correspond with the parameter
names as returned by AggregationFunction.getParameterName(int)
.compute
in class AggregationFunction
distances
- the distances in respective descriptorspublic int getParameterCount()
AggregationFunction
AggregationFunction.compute(float...)
function.getParameterCount
in class AggregationFunction
AggregationFunction.compute(float...)
functionpublic java.lang.String getParameterName(int index)
AggregationFunction
index
th distance parameter (i.e. the descriptor name) for the AggregationFunction.compute(float...)
function.getParameterName
in class AggregationFunction
index
- the index of the parameter for which to get the nameindex
th distance parameter (i.e. the descriptor name) for the AggregationFunction.compute(float...)
functionpublic java.lang.String toString()
toString
in class java.lang.Object