Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance
Class AbstractDistance<D extends AbstractDistance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.AbstractDistance<D>
Type Parameters:
D - the (final) type of Distance used
All Implemented Interfaces:
Distance<D>, Externalizable, Serializable, Comparable<D>
Direct Known Subclasses:
CorrelationDistance, NumberDistance, SubspaceDistance

public abstract class AbstractDistance<D extends AbstractDistance<D>>
extends Object
implements Distance<D>

An abstract distance implements equals conveniently for any extending class. At the same time any extending class is to implement hashCode properly. See DistanceUtil for related utility functions such as min, max.

Author:
Arthur Zimek
See Also:
DistanceUtil, Serialized Form

Constructor Summary
AbstractDistance()
           
 
Method Summary
 boolean equals(Object o)
          Returns true if this == o has the value true or o is not null and o is of the same class as this instance and this.compareTo(o) is 0, false otherwise.
abstract  int hashCode()
          Any extending class should implement a proper hashCode method.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.Distance
description, externalizableSize, minus, plus, toString
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Constructor Detail

AbstractDistance

public AbstractDistance()
Method Detail

hashCode

public abstract int hashCode()
Any extending class should implement a proper hashCode method.

Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Returns true if this == o has the value true or o is not null and o is of the same class as this instance and this.compareTo(o) is 0, false otherwise.

Overrides:
equals in class Object

Release 0.2.1 (2009-07-13_1605)