de.dfki.mycbr.core.similarity
Class DateFct

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

public class DateFct
extends java.util.Observable
implements ISimFct

Not implemented yet.

Author:
myCBR Team

Constructor Summary
DateFct(Project prj, DateDesc desc, java.lang.String name)
           
 
Method Summary
 Similarity calculateSimilarity(Attribute value1, Attribute value2)
          Computes the similarity of value1 and value2.
 void clone(AttributeDesc descNEW, boolean active)
          Creates a new function which is the same function as this but with a different description, namely descNEW.
 AttributeDesc getDesc()
          Returns the description of the attributes which can be compared using 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 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.
 void update(java.util.Observable o, java.lang.Object arg)
           
 
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

DateFct

public DateFct(Project prj,
               DateDesc desc,
               java.lang.String name)
Method Detail

calculateSimilarity

public Similarity calculateSimilarity(Attribute value1,
                                      Attribute value2)
                               throws java.lang.Exception
Description copied from interface: ISimFct
Computes the similarity of value1 and value2. Be aware that this function does not have to be symmetric. The specified values have to be of same type and must belong to the same description, else null is returned.

Specified by:
calculateSimilarity in interface ISimFct
Parameters:
value1 - the first value
value2 - the second value
Returns:
similarity of value1 and value2, invalid similarity if the values do not have the same type or do belong to different attribute descriptions
Throws:
java.lang.Exception

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

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.

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

clone

public void clone(AttributeDesc descNEW,
                  boolean active)
Description copied from interface: ISimFct
Creates a new function which is the same function as this but with a different description, namely descNEW. Assumption: this function fits the description of descNEW.

Specified by:
clone in interface ISimFct