|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.distance.AbstractDistance<D>
de.lmu.ifi.dbs.elki.distance.NumberDistance<D,N>
D
- the (final) type of NumberDistance usedN
- the type of Number used (e.g. Double, Integer, Float, etc.)public abstract class NumberDistance<D extends NumberDistance<D,N>,N extends Number>
Provides a Distance for a number-valued distance.
Field Summary | |
---|---|
private N |
value
The value of this distance. |
Constructor Summary | |
---|---|
NumberDistance(N value)
Constructs a new NumberDistance object that represents the value argument. |
Method Summary | |
---|---|
int |
compareTo(D other)
Compares this NumberDistance with the given NumberDistance wrt the represented value. |
N |
getValue()
Returns the value of this NumberDistance. |
int |
hashCode()
Returns the hash code for this NumberDistance, which is the hash code of its value. |
(package private) void |
setValue(N value)
Sets the value of this NumberDistance. |
String |
toString()
Returns a string representation of this NumberDistance. |
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractDistance |
---|
equals |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.Distance |
---|
description, externalizableSize, minus, plus |
Methods inherited from interface java.io.Externalizable |
---|
readExternal, writeExternal |
Field Detail |
---|
private N extends Number value
Constructor Detail |
---|
public NumberDistance(N value)
value
- the value to be represented by the NumberDistance.Method Detail |
---|
public final int hashCode()
hashCode
in class AbstractDistance<D extends NumberDistance<D,N>>
public int compareTo(D other)
d1.compareTo(d2)
is the same as
Double.compare(d1.value.doubleValue(), d2.value.doubleValue())
.
Subclasses may need to overwrite this method if necessary.
public final String toString()
toString
in interface Distance<D extends NumberDistance<D,N>>
toString
in class Object
public final N getValue()
void setValue(N value)
value
- the value to be set
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |