de.lmu.ifi.dbs.elki.distance
Class AbstractDistance<D extends AbstractDistance<D>>
java.lang.Object
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
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. |
AbstractDistance
public AbstractDistance()
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