|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.objects.util.AggregationFunction
public abstract class AggregationFunction
The predecessor class of the similarity aggregate functions.
Constructor Summary | |
---|---|
AggregationFunction()
|
Method Summary | |
---|---|
abstract float |
compute(float... distances)
Computes the value of the aggregate distance from the provided sub-distances. |
float |
getDistance(MetaObject object1,
MetaObject object2)
Computes distance of two meta objects using this combination function. |
float |
getDistance(MetaObject object1,
MetaObject object2,
float[] descriptorDistances)
Computes distance of two meta objects using this combination function. |
static java.lang.Class<? extends AggregationFunction> |
getFactoryClass()
Returns the class currently set for the factory method valueOf(java.lang.String) . |
float |
getParameterMaximalDistance(int parameterIndex)
Returns the maximal distance for the specified parameter of the compute(float...) function. |
abstract java.lang.String[] |
getParameterNames()
Returns the names of distance parameters (i.e. the descriptor names) for the compute(float...) function. |
static void |
setFactoryClass(java.lang.Class<? extends AggregationFunction> factoryClass)
Sets the class created by factory method valueOf(java.lang.String) . |
static AggregationFunction |
valueOf(java.lang.String string)
Factory method for creating threshold functions from strings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AggregationFunction()
Method Detail |
---|
public abstract java.lang.String[] getParameterNames()
compute(float...)
function.
compute(float...)
functionpublic float getParameterMaximalDistance(int parameterIndex) throws java.lang.IndexOutOfBoundsException
compute(float...)
function.
This method returns the LocalAbstractObject.MAX_DISTANCE
by default.
parameterIndex
- the index of a parameter (corresponds to the index of the
parameter name as given by getParameterNames()
)
compute(float...)
function
java.lang.IndexOutOfBoundsException
- if the specified parameter index is not validpublic abstract float compute(float... distances)
distances
array items must correspond with the parameter
names as returned by getParameterNames()
.
distances
- the distances in respective descriptors
public float getDistance(MetaObject object1, MetaObject object2, float[] descriptorDistances)
descriptorDistances
- array that will be filled with distances of the respective sub-distances;
i.e. the distance between object1.getObject(parameterName[0]) and object2.getObject(parameterName[0])
will be stored in the first array component, etc.object1
- the one meta object to compute distance forobject2
- the other meta object to compute distance for
public float getDistance(MetaObject object1, MetaObject object2)
object1
- the one meta object to compute distance forobject2
- the other meta object to compute distance for
public static AggregationFunction valueOf(java.lang.String string) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
string
- the theshold function (using standard expression syntax)
AggregationFunction
java.lang.NoSuchMethodException
- if there is no threshold function class set by setFactoryClass(java.lang.Class extends messif.objects.util.AggregationFunction>)
yet
java.lang.reflect.InvocationTargetException
- if the parsing of the threshold function has thrown an exceptionpublic static void setFactoryClass(java.lang.Class<? extends AggregationFunction> factoryClass) throws java.lang.NoSuchMethodException
valueOf(java.lang.String)
.
factoryClass
- the new class for factory method
java.lang.NoSuchMethodException
- if the specified class is abstract or lacks a public constructor with one String
argumentpublic static java.lang.Class<? extends AggregationFunction> getFactoryClass()
valueOf(java.lang.String)
.
valueOf(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |