public class AggregationFunctionEvaluator extends AggregationFunction
Constructor and Description |
---|
AggregationFunctionEvaluator(java.lang.String function)
Creates a new instance of AggregationFunctionEvaluator.
|
AggregationFunctionEvaluator(java.lang.String function,
java.util.Map<java.lang.String,java.lang.Float> maxDistances)
Creates a new instance of AggregationFunctionEvaluator.
|
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. |
float |
getParameterMaximalDistance(int parameterIndex)
Returns the maximal distance for the specified parameter of 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, setFactoryClass, valueOf
public AggregationFunctionEvaluator(java.lang.String function, java.util.Map<java.lang.String,java.lang.Float> maxDistances) throws java.lang.IllegalArgumentException
function
- the function stringmaxDistances
- the list of maximal distances (map values) for the variable names (map keys)java.lang.IllegalArgumentException
- if the specified function cannot be parsedpublic AggregationFunctionEvaluator(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 float getParameterMaximalDistance(int parameterIndex)
AggregationFunction
AggregationFunction.compute(float...)
function.
This method returns the LocalAbstractObject.MAX_DISTANCE
by default.getParameterMaximalDistance
in class AggregationFunction
parameterIndex
- the index of a parameter (corresponds to the index of the
parameter name as given by AggregationFunction.getParameterName(int)
)AggregationFunction.compute(float...)
functionpublic java.lang.String toString()
toString
in class java.lang.Object