Class DistanceEntry<E>
- java.lang.Object
-
- elki.index.tree.metrical.mtreevariants.strategies.split.distribution.DistanceEntry<E>
-
- Type Parameters:
E
- the type of Entry used in the index
- All Implemented Interfaces:
java.lang.Comparable<DistanceEntry<E>>
public class DistanceEntry<E> extends java.lang.Object implements java.lang.Comparable<DistanceEntry<E>>
Helper class: encapsulates an entry in an Index and a distance value belonging to this entry.- Since:
- 0.1
- Author:
- Elke Achtert
-
-
Constructor Summary
Constructors Constructor Description DistanceEntry(E entry, double distance)
Constructs a new DistanceEntry object with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(DistanceEntry<E> o)
Compares this object with the specified object for order.double
getDistance()
Returns the distance value belonging to the entry.E
getEntry()
Returns the entry of the Index.java.lang.String
toString()
Returns a string representation of the object.
-
-
-
Field Detail
-
entry
private E entry
The entry of the Index.
-
distance
private double distance
The distance value belonging to the entry.
-
-
Constructor Detail
-
DistanceEntry
public DistanceEntry(E entry, double distance)
Constructs a new DistanceEntry object with the specified parameters.- Parameters:
entry
- the entry of the Indexdistance
- the distance value belonging to the entry
-
-
Method Detail
-
getEntry
public E getEntry()
Returns the entry of the Index.- Returns:
- the entry of the Index
-
getDistance
public double getDistance()
Returns the distance value belonging to the entry.- Returns:
- the distance value belonging to the entry
-
compareTo
public int compareTo(DistanceEntry<E> o)
Compares this object with the specified object for order.- Specified by:
compareTo
in interfacejava.lang.Comparable<E>
- Parameters:
o
- the Object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
java.lang.ClassCastException
- if the specified object's type prevents it from being compared to this Object.
-
toString
public java.lang.String toString()
Returns a string representation of the object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of the object.
-
-