edu.indiana.iucbrf.feature.differentiator
Class AbstractFeatureDifferentiator

java.lang.Object
  extended by edu.indiana.iucbrf.feature.differentiator.AbstractFeatureDifferentiator
All Implemented Interfaces:
FeatureDifferentiator, Differentiator, java.io.Serializable
Direct Known Subclasses:
EqualityFeatureDifferentiator, NeighborhoodFeatureDifferentiator, SubtractionFeatureDifferentiator, TermVectorFeatureDifferentiator

public abstract class AbstractFeatureDifferentiator
extends java.lang.Object
implements FeatureDifferentiator

See Also:
Serialized Form

Field Summary
protected  double normalizationValue
          The calculated difference is normalized (divided by) this value.
 
Constructor Summary
AbstractFeatureDifferentiator()
          Creates a new instance of AbstractFeatureDifferentiator
AbstractFeatureDifferentiator(double normalizationValue)
           
 
Method Summary
 double calcDifference(Feature f1, Feature f2)
          Normalizes the result of calcDifferenceImpl, according to normalizationValue.
 double calcDifference(java.lang.Object obj1, java.lang.Object obj2)
           
protected abstract  double calcDifferenceImpl(Feature f1, Feature f2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

normalizationValue

protected double normalizationValue
The calculated difference is normalized (divided by) this value. Default is 1.0 (hence no normalization).

Constructor Detail

AbstractFeatureDifferentiator

public AbstractFeatureDifferentiator()
Creates a new instance of AbstractFeatureDifferentiator


AbstractFeatureDifferentiator

public AbstractFeatureDifferentiator(double normalizationValue)
Method Detail

calcDifference

public double calcDifference(java.lang.Object obj1,
                             java.lang.Object obj2)
Specified by:
calcDifference in interface Differentiator

calcDifference

public double calcDifference(Feature f1,
                             Feature f2)
Normalizes the result of calcDifferenceImpl, according to normalizationValue.

Specified by:
calcDifference in interface FeatureDifferentiator

calcDifferenceImpl

protected abstract double calcDifferenceImpl(Feature f1,
                                             Feature f2)