de.dfki.mycbr.core.similarity
Class SpecialFct

java.lang.Object
  extended by java.util.Observable
      extended by de.dfki.mycbr.core.similarity.SymbolFct
          extended by de.dfki.mycbr.core.similarity.SpecialFct
All Implemented Interfaces:
ISimFct, java.util.Observer

public class SpecialFct
extends SymbolFct

Special values such as "undefined" can be used as values for any attribute description. This class defines how to compute the similarity of two special values. They are basically treated like symbol attributes.

Author:
myCBR Team

Constructor Summary
SpecialFct(Project prj, SpecialDesc desc, java.lang.String name)
           
 
Method Summary
 Similarity calculateSimilarity(SpecialAttribute att1, SpecialAttribute att2)
          Returns the similarity of the given attributes.
 
Methods inherited from class de.dfki.mycbr.core.similarity.SymbolFct
calculateSimilarity, calculateSimilarity, clone, getDesc, getMultipleConfig, getName, getProject, isSymmetric, setMultipleConfig, setName, setSimilarity, setSimilarity, setSimilarity, setSimilarity, setSymmetric, update
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpecialFct

public SpecialFct(Project prj,
                  SpecialDesc desc,
                  java.lang.String name)
Parameters:
prj -
desc -
name -
Method Detail

calculateSimilarity

public Similarity calculateSimilarity(SpecialAttribute att1,
                                      SpecialAttribute att2)
Returns the similarity of the given attributes. Returns null if the attributes do not have the same description, if they are not of type SymbolAttribute or SpecialValueAttribute, or if there is something wrong with the index structure provided by the given range.

Parameters:
att1 - first attribute
att2 - second attribute
Returns:
similarity of the given attributes, invalid similarity if an error occurs
Throws:
java.lang.Exception