|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.objects.util.AggregationFunction
messif.objects.util.impl.AggregationFunctionEvaluator
public class AggregationFunctionEvaluator
Evaluator for basic arithmetic operators and functions applied on particular sub-distances. Basic arithmetic operators (+, -, *, /, ^) and "log" and "log10" functions are supported as well as numeric constants (treated as floats).
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
float |
compute(float... distances)
Computes the value of the aggregate distance from the provided sub-distances. |
float |
getParameterMaximalDistance(int parameterIndex)
Returns the maximal distance for the specified parameter of the AggregationFunction.compute(float...) function. |
java.lang.String[] |
getParameterNames()
Returns the names of distance parameters (i.e. the descriptor names) for the AggregationFunction.compute(float...) function. |
java.lang.String |
toString()
Returns a string representation of the encapsulated function. |
Methods inherited from class messif.objects.util.AggregationFunction |
---|
getDistance, getDistance, getFactoryClass, setFactoryClass, valueOf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 string
java.lang.IllegalArgumentException
- if the specified function cannot be parsedMethod Detail |
---|
public float compute(float... distances)
AggregationFunction
distances
array items must correspond with the parameter
names as returned by AggregationFunction.getParameterNames()
.
compute
in class AggregationFunction
distances
- the distances in respective descriptors
public java.lang.String[] getParameterNames()
AggregationFunction
AggregationFunction.compute(float...)
function.
getParameterNames
in class AggregationFunction
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.getParameterNames()
)
AggregationFunction.compute(float...)
functionpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |