D
- Distance typepublic class GenericDistanceResultPair<D extends Distance<D>> extends Pair<D,DBID> implements DistanceResultPair<D>
Constructor and Description |
---|
GenericDistanceResultPair(D first,
DBID second)
Canonical constructor
|
Modifier and Type | Method and Description |
---|---|
int |
compareByDistance(DistanceResultPair<D> o)
Compare value, but by distance only.
|
int |
compareDBID(DBIDRef other)
Compare two objects by the value of the referenced DBID.
|
int |
compareTo(DistanceResultPair<D> o) |
boolean |
equals(Object obj)
Simple equals statement.
|
DBID |
getDBID()
Getter for second element in pair
|
D |
getDistance()
Getter for first
|
int |
getIntegerID()
Return the integer value of the object ID, if possible.
|
boolean |
sameDBID(DBIDRef other)
Compare the current value of two referenced DBIDs.
|
void |
setDistance(D first)
Setter for first
|
void |
setID(DBID second)
Setter for second
|
String |
toString()
Canonical toString operator
|
getFirst, getSecond, hashCode, newPairArray, setFirst, setSecond
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFirst, getSecond
public final D getDistance()
getDistance
in interface DistanceResultPair<D extends Distance<D>>
public final void setDistance(D first)
setDistance
in interface DistanceResultPair<D extends Distance<D>>
first
- new value for first elementpublic final DBID getDBID()
public int getIntegerID()
DBIDRef
getIntegerID
in interface DBIDRef
public boolean sameDBID(DBIDRef other)
DBIDRef
public int compareDBID(DBIDRef other)
DBIDRef
compareDBID
in interface DBIDRef
other
- Other DBID or objectpublic final void setID(DBID second)
setID
in interface DistanceResultPair<D extends Distance<D>>
second
- new value for second elementpublic int compareByDistance(DistanceResultPair<D> o)
DistanceResultPair
compareByDistance
in interface DistanceResultPair<D extends Distance<D>>
o
- Other objectpublic int compareTo(DistanceResultPair<D> o)
compareTo
in interface Comparable<DistanceResultPair<D extends Distance<D>>>
public boolean equals(Object obj)
Pair
Pair.first
and Pair.second
element of
this Pair equal the Pair.first
and Pair.second
element,
respectively, of the other Pair.