de.lmu.ifi.dbs.elki.index.tree
Class DistanceEntry<D extends Distance<D>,E extends Entry>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.DistanceEntry<D,E>
Type Parameters:
E - the type of Entry used in the index
D - the type of Distance used
All Implemented Interfaces:
Comparable<DistanceEntry<D,E>>

public class DistanceEntry<D extends Distance<D>,E extends Entry>
extends Object
implements Comparable<DistanceEntry<D,E>>

Helper class: encapsulates an entry in an Index and a distance value belonging to this entry.


Field Summary
private  D distance
          The distance value belonging to the entry.
private  E entry
          The entry of the Index.
private  int index
          The index of the entry in its parent's child array.
 
Constructor Summary
DistanceEntry(E entry, D distance, int index)
          Constructs a new DistanceEntry object with the specified parameters.
 
Method Summary
 int compareTo(DistanceEntry<D,E> o)
          Compares this object with the specified object for order.
 D getDistance()
          Returns the distance value belonging to the entry.
 E getEntry()
          Returns the entry of the Index.
 int getIndex()
          Returns the index of this entry in its parents child array.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

entry

private E extends Entry entry
The entry of the Index.


distance

private D extends Distance<D> distance
The distance value belonging to the entry.


index

private int index
The index of the entry in its parent's child array.

Constructor Detail

DistanceEntry

public DistanceEntry(E entry,
                     D distance,
                     int index)
Constructs a new DistanceEntry object with the specified parameters.

Parameters:
entry - the entry of the Index
distance - the distance value belonging to the entry
index - the index of the entry in its parent' child array
Method Detail

getEntry

public E getEntry()
Returns the entry of the Index.

Returns:
the entry of the Index

getDistance

public D getDistance()
Returns the distance value belonging to the entry.

Returns:
the distance value belonging to the entry

getIndex

public int getIndex()
Returns the index of this entry in its parents child array.

Returns:
the index of this entry in its parents child array

compareTo

public int compareTo(DistanceEntry<D,E> o)
Compares this object with the specified object for order.

Specified by:
compareTo in interface Comparable<DistanceEntry<D extends Distance<D>,E extends Entry>>
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:
ClassCastException - if the specified object's type prevents it from being compared to this Object.

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.

Release 0.4.0 (2011-09-20_1324)