|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.distance.AbstractDistance<D>
de.lmu.ifi.dbs.elki.distance.NumberDistance<DoubleDistance>
de.lmu.ifi.dbs.elki.distance.DoubleDistance
public class DoubleDistance
Provides a Distance for a double-valued distance.
Field Summary | |
---|---|
private static long |
serialVersionUID
Generated serialVersionUID. |
private double |
value
The double value of this distance. |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug |
Constructor Summary | |
---|---|
DoubleDistance()
Empty constructor for serialization purposes. |
|
DoubleDistance(double value)
Constructs a new DoubleDistance object that represents the double argument. |
Method Summary | |
---|---|
int |
compareTo(DoubleDistance d)
Compares this DoubleDistance with the given DoubleDistance wrt the representad double. |
boolean |
equals(Object o)
Returns true if o is of the same class as this instance and this.compareTo(o) is 0,
false otherwise. |
int |
externalizableSize()
Retuns the number of Bytes this distance uses if it is written to an external file. |
double |
getDoubleValue()
Returns the double value of this distance. |
int |
hashCode()
Any extending class should implement a proper hashCode method. |
DoubleDistance |
minus(DoubleDistance distance)
Returns a new Distance by subtracting the given distance from this distance. |
DoubleDistance |
plus(DoubleDistance distance)
Returns a new distance as sum of this distance and the given distance. |
void |
readExternal(ObjectInput in)
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
DoubleDistance |
times(double lambda)
Returns a new distance as the product of this distance and the given double value. |
DoubleDistance |
times(DoubleDistance distance)
Returns a new distance as the product of this distance and the given distance. |
String |
toString()
Returns a string representation of this distance. |
void |
writeExternal(ObjectOutput out)
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays. |
Methods inherited from class de.lmu.ifi.dbs.elki.distance.NumberDistance |
---|
description |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private double value
Constructor Detail |
---|
public DoubleDistance()
public DoubleDistance(double value)
value
- the value to be represented by the DoubleDistance.Method Detail |
---|
public DoubleDistance plus(DoubleDistance distance)
Distance
distance
- the distancce to be added to this distance
Distance.plus(Distance)
public DoubleDistance minus(DoubleDistance distance)
Distance
distance
- the distance to be subtracted from this distance
Distance.minus(Distance)
public DoubleDistance times(DoubleDistance distance)
distance
- the distancce to be multiplied with this distance
public DoubleDistance times(double lambda)
lambda
- the double value this distance should be multiplied with
public int compareTo(DoubleDistance d)
d1.compareTo(d2)
is the same as
Double.compare(d1.value, d2.value)
.
Comparable.compareTo(Object)
public void writeExternal(ObjectOutput out) throws IOException
out
- the stream to write the object to
IOException
- Includes any I/O exceptions that may occurpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
in
- the stream to read data from in order to restore the object
IOException
- if I/O errors occur
ClassNotFoundException
- If the class for an object being restored cannot be found.public int externalizableSize()
public double getDoubleValue()
getDoubleValue
in class NumberDistance<DoubleDistance>
public boolean equals(Object o)
AbstractDistance
this.compareTo(o)
is 0,
false otherwise.
equals
in class AbstractDistance<DoubleDistance>
Object.equals(Object)
public int hashCode()
AbstractDistance
hashCode
in class AbstractDistance<DoubleDistance>
Object.hashCode()
public String toString()
toString
in interface Distance<DoubleDistance>
toString
in class Object
|
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |