D
- Distance typeclass DistanceIntegerDBIDPair<D extends Distance<D>> extends Object implements DistanceDBIDPair<D>, IntegerDBIDRef
Modifier and Type | Field and Description |
---|---|
(package private) D |
distance
The distance value.
|
(package private) int |
id
The integer DBID.
|
Modifier | Constructor and Description |
---|---|
protected |
DistanceIntegerDBIDPair(D distance,
int id)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareByDistance(DistanceDBIDPair<D> o)
Compare to another result, by distance, smaller first.
|
boolean |
equals(Object o)
WARNING: calling equality on a reference may be an indicator of incorrect
usage, as it is not clear whether the programmer meant the references to be
the same or the DBIDs.
|
D |
getDistance()
Get the distance.
|
int |
hashCode()
WARNING: Hash codes of this interface might not be stable (e.g. for
iterators).
|
int |
internalGetIndex()
Get the internal index.
|
String |
toString() |
protected DistanceIntegerDBIDPair(D distance, int id)
distance
- Distanceid
- Object IDpublic D getDistance()
DistanceDBIDPair
getDistance
in interface DistanceDBIDPair<D extends Distance<D>>
public int internalGetIndex()
DBIDRef
internalGetIndex
in interface DBIDRef
internalGetIndex
in interface IntegerDBIDRef
public int compareByDistance(DistanceDBIDPair<D> o)
DistanceDBIDPair
compareByDistance
in interface DistanceDBIDPair<D extends Distance<D>>
o
- Other resultpublic boolean equals(Object o)
DBIDRef
DBIDUtil.equal(de.lmu.ifi.dbs.elki.database.ids.DBIDRef, de.lmu.ifi.dbs.elki.database.ids.DBIDRef)
or DBIDUtil.compare(de.lmu.ifi.dbs.elki.database.ids.DBIDRef, de.lmu.ifi.dbs.elki.database.ids.DBIDRef)
!public int hashCode()
DBIDRef
DBIDUtil.deref(de.lmu.ifi.dbs.elki.database.ids.DBIDRef)
to get an object with a stable hash code!