messif.objects.util.impl
Class SubdistanceToken

java.lang.Object
  extended by messif.objects.util.impl.SubdistanceToken
All Implemented Interfaces:
java.io.Serializable, PatternToken

public class SubdistanceToken
extends java.lang.Object
implements PatternToken

The subdistance identifier for the aggregation function evalutator.

See Also:
Serialized Form

Field Summary
protected  int index
          Subdistance index
protected  java.lang.String name
          Subdistance string name
 
Constructor Summary
SubdistanceToken(java.lang.String subdistanceName, java.util.List<SubdistanceToken> currentSubdistanceList)
          Create subdistance token given the subdistance name and a list of already created subdistances.
 
Method Summary
 float evaluate(float[] subdistances)
          The subdistance knows a priori its index to the array of subdistances
 java.lang.String getName()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected final java.lang.String name
Subdistance string name


index

protected final int index
Subdistance index

Constructor Detail

SubdistanceToken

public SubdistanceToken(java.lang.String subdistanceName,
                        java.util.List<SubdistanceToken> currentSubdistanceList)
Create subdistance token given the subdistance name and a list of already created subdistances. If the passed name is present in the list, the current index is used or the distance is added in the end of the passed list.

Parameters:
subdistanceName - name of the subdistance (e.g. ScalableColor)
currentSubdistanceList - list of subdistances that already appeared in the aggregation string
Method Detail

getName

public java.lang.String getName()

evaluate

public final float evaluate(float[] subdistances)
The subdistance knows a priori its index to the array of subdistances

Specified by:
evaluate in interface PatternToken
Parameters:
subdistances - specific subdistances for the two meta objects compared
Returns:
one of the subdistances given

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object