|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.distance.distancevalue.AbstractDistance<D> de.lmu.ifi.dbs.elki.distance.distancevalue.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 |
---|
Fields inherited from class de.lmu.ifi.dbs.elki.distance.distancevalue.AbstractDistance |
---|
DOUBLE_PATTERN, INFINITY_PATTERN, INTEGER_PATTERN |
Constructor Summary | |
---|---|
NumberDistance()
Constructs a new NumberDistance object that represents the value argument. |
Method Summary | |
---|---|
byte |
byteValue()
Get the value as byte. |
int |
compareTo(D other)
Compares this NumberDistance with the given NumberDistance wrt the represented value. |
abstract double |
doubleValue()
Get the value as double. |
float |
floatValue()
Get the value as float. |
abstract D |
fromDouble(double val)
Build a new instance from a double value. |
abstract 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. |
int |
intValue()
Get the value as int. |
abstract long |
longValue()
Get the value as long. |
(package private) abstract void |
setValue(N value)
Sets the value of this NumberDistance. |
short |
shortValue()
Get the value as short. |
String |
toString()
Returns a string representation of this NumberDistance. |
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancevalue.AbstractDistance |
---|
equals, getPattern, isInfiniteDistance, isNullDistance, isUndefinedDistance, requiredInputPattern, testInputPattern |
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.distancevalue.Distance |
---|
externalizableSize, infiniteDistance, minus, nullDistance, parseString, plus, undefinedDistance |
Methods inherited from interface java.io.Externalizable |
---|
readExternal, writeExternal |
Constructor Detail |
---|
public NumberDistance()
Method Detail |
---|
public abstract D fromDouble(double val)
val
- Value
public 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.
other
- Other object
public final String toString()
toString
in interface Distance<D extends NumberDistance<D,N>>
toString
in class Object
public abstract N getValue()
abstract void setValue(N value)
value
- the value to be setpublic abstract double doubleValue()
public float floatValue()
public int intValue()
public abstract long longValue()
public short shortValue()
public byte byteValue()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |