public class RankedAbstractObject extends DistanceRankedObject<AbstractObject> implements Clearable
AbstractObject
and its distance.
It is used as a return value for all the query operations
.comparator
Constructor and Description |
---|
RankedAbstractObject(AbstractObject object,
float distance)
Creates a new instance of RankedAbstractObject for an object and its measured distance.
|
RankedAbstractObject(LocalAbstractObject referenceObject,
LocalAbstractObject object)
Creates a new instance of RankedAbstractObject by measuring an object's distance from the reference object.
|
RankedAbstractObject(T object,
DistanceFunction<? super T> distanceFunction,
T referenceObject)
Creates a new instance of RankedAbstractObject by measuring an object's distance from the reference object
using a given distance function.
|
Modifier and Type | Method and Description |
---|---|
void |
clearSurplusData()
Clears the data stored in this object.
|
RankedAbstractObject |
clone(float newDistance)
Clone this ranked object and change the distance of the cloned one
|
compareTo, equals, getDistance, getObject, getObjectsIterator, hashCode, toString
public RankedAbstractObject(AbstractObject object, float distance)
object
- the ranked objectdistance
- the measured distance of the objectpublic RankedAbstractObject(LocalAbstractObject referenceObject, LocalAbstractObject object)
referenceObject
- the reference object from which the distance is measuredobject
- the ranked objectpublic RankedAbstractObject(T object, DistanceFunction<? super T> distanceFunction, T referenceObject) throws java.lang.NullPointerException
T
- the type of object used to measure the distanceobject
- the ranked objectdistanceFunction
- the distance function used for the measuringreferenceObject
- the reference object from which the distance is measuredjava.lang.NullPointerException
- if the distance function is nullpublic void clearSurplusData()
Clearable
clearSurplusData
in interface Clearable
public RankedAbstractObject clone(float newDistance)
DistanceRankedObject
clone
in class DistanceRankedObject<AbstractObject>
newDistance
- distance to be set for the cloned object