jcolibri.method.retrieve.NNretrieval.similarity.local
Class Table

java.lang.Object
  extended by jcolibri.method.retrieve.NNretrieval.similarity.local.Table
All Implemented Interfaces:
LocalSimilarityFunction

public class Table
extends java.lang.Object
implements LocalSimilarityFunction

Similarity function that uses a table to obtain the similarity between two values. Allowed values are Strings or Enums. The table is read from a text file with the following format:


Constructor Summary
Table(java.lang.String filename)
           
 
Method Summary
 double compute(java.lang.Object caseObject, java.lang.Object queryObject)
          Applies the similarity function.
 boolean isApplicable(java.lang.Object o1, java.lang.Object o2)
          Applicable to String or Enum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Table

public Table(java.lang.String filename)
Method Detail

compute

public double compute(java.lang.Object caseObject,
                      java.lang.Object queryObject)
               throws NoApplicableSimilarityFunctionException
Applies the similarity function.

Specified by:
compute in interface LocalSimilarityFunction
Parameters:
caseObject - is a String or Enum
queryObject - is a String or Enum
Returns:
result of apply the similarity function.
Throws:
NoApplicableSimilarityFunctionException

isApplicable

public boolean isApplicable(java.lang.Object o1,
                            java.lang.Object o2)
Applicable to String or Enum

Specified by:
isApplicable in interface LocalSimilarityFunction

GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es