de.dfki.mycbr.core.similarity
Class NumberFct

java.lang.Object
  extended by java.util.Observable
      extended by de.dfki.mycbr.core.similarity.NumberFct
All Implemented Interfaces:
ISimFct, java.util.Observer
Direct Known Subclasses:
AdvancedDoubleFct, AdvancedFloatFct, AdvancedIntegerFct, DoubleFct, FloatFct, IntegerFct

public abstract class NumberFct
extends java.util.Observable
implements ISimFct

Defines how to compute the similarity of two integers, floats or doubles. The similarity of two numbers is influenced by the range of possible values and their distance.

Author:
myCBR Team

Constructor Summary
NumberFct(Project p, SimpleAttDesc d, java.lang.String n)
           
 
Method Summary
 AttributeDesc getDesc()
          Returns the description of the attributes which can be compared using this function
 DistanceConfig getDistanceFct()
          Returns the mode of this function
 MultipleConfig getMultipleConfig()
           
 java.lang.String getName()
          Returns the name of this function
 Project getProject()
           
 boolean isSymmetric()
          Specifies whether this function is symmetric or asymmetric
 void setDistanceFct(DistanceConfig df)
          Sets the mode of this function to mode
 void setMultipleConfig(MultipleConfig mc)
           
 void setName(java.lang.String name)
          Sets the name of this function to name
 void setSymmetric(boolean symmetric)
          Specifies whether this function is symmetric or not.
 
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
 
Methods inherited from interface de.dfki.mycbr.core.similarity.ISimFct
calculateSimilarity, clone
 
Methods inherited from interface java.util.Observer
update
 

Constructor Detail

NumberFct

public NumberFct(Project p,
                 SimpleAttDesc d,
                 java.lang.String n)
Method Detail

getMultipleConfig

public MultipleConfig getMultipleConfig()
Specified by:
getMultipleConfig in interface ISimFct

getName

public java.lang.String getName()
Description copied from interface: ISimFct
Returns the name of this function

Specified by:
getName in interface ISimFct
Returns:
the name of this function

getProject

public Project getProject()
Specified by:
getProject in interface ISimFct

isSymmetric

public boolean isSymmetric()
Description copied from interface: ISimFct
Specifies whether this function is symmetric or asymmetric

Specified by:
isSymmetric in interface ISimFct
Returns:
true, if similarity function is symmetric, false otherwise

setMultipleConfig

public void setMultipleConfig(MultipleConfig mc)
Specified by:
setMultipleConfig in interface ISimFct

setName

public void setName(java.lang.String name)
Description copied from interface: ISimFct
Sets the name of this function to name

Specified by:
setName in interface ISimFct
Parameters:
name - the new name of this function

setSymmetric

public void setSymmetric(boolean symmetric)
Description copied from interface: ISimFct
Specifies whether this function is symmetric or not. If a function sim is symmetric, sim(q,c) = sim(c,q) should hold for all queries q and cases c this function is defined on. Else the function is asymmetric.

Specified by:
setSymmetric in interface ISimFct
Parameters:
symmetric - specifies whether this function is symmetric or not.

setDistanceFct

public void setDistanceFct(DistanceConfig df)
Sets the mode of this function to mode

Parameters:
df - the new mode of this function

getDistanceFct

public DistanceConfig getDistanceFct()
Returns the mode of this function

Returns:
the mode of this function

getDesc

public AttributeDesc getDesc()
Description copied from interface: ISimFct
Returns the description of the attributes which can be compared using this function

Specified by:
getDesc in interface ISimFct
Returns:
the description this function belongs to