public class RankedSortedNoThresholdCollection extends RankedSortedCollection
RankedSortedCollection
that always returns the threshold
LocalAbstractObject.MAX_DISTANCE
.DEFAULT_INITIAL_CAPACITY, UNLIMITED_CAPACITY
Constructor and Description |
---|
RankedSortedNoThresholdCollection()
Constructs an empty collection.
|
RankedSortedNoThresholdCollection(DistanceFunction<? super T> distanceFunction,
T referenceObject,
java.util.Iterator<? extends T> iterator)
Creates a new collection filled with objects provided by the
iterator . |
RankedSortedNoThresholdCollection(DistanceFunction<? super T> distanceFunction,
T referenceObject,
ObjectProvider<? extends T> objectProvider)
Creates a new collection filled with objects provided by the
objectProvider . |
RankedSortedNoThresholdCollection(int initialCapacity,
int maximalCapacity)
Constructs an empty collection with the specified initial and maximal capacity.
|
RankedSortedNoThresholdCollection(int initialCapacity,
int maximalCapacity,
java.util.Comparator<? super RankedAbstractObject> comparator)
Constructs an empty collection with the specified initial and maximal capacity.
|
RankedSortedNoThresholdCollection(LocalAbstractObject referenceObject,
java.util.Iterator<? extends LocalAbstractObject> iterator)
Creates a new collection filled with objects provided by the
iterator . |
RankedSortedNoThresholdCollection(LocalAbstractObject referenceObject,
ObjectProvider<? extends LocalAbstractObject> objectProvider)
Creates a new collection filled with objects provided by the
objectProvider . |
RankedSortedNoThresholdCollection(RankingQueryOperation operation)
Constructor from an existing operation - all parameters are copied from the operation answer.
|
Modifier and Type | Method and Description |
---|---|
float |
getThresholdDistance()
Returns the threshold distance for this collection.
|
add, add, add, clear, isEqual, isIgnoringDuplicates, rankObject, remove, remove, removeFirst, removeLast, setIgnoringDuplicates, setMaximalCapacity, toArray, toArray
getLastDistance, iteratorDistanceRestricted, iteratorDistanceRestricted
addAll, addAllSortedArray, clone, clone, compare, contains, containsAll, element, get, getComparator, getMaximalCapacity, isEmpty, isFull, iterator, iterator, offer, peek, poll, popLast, remove, removeAll, removeAll, removeFirstN, retainAll, size, toString
binarySearch, first, fullSearch, indexOf, last, mergeSort
public RankedSortedNoThresholdCollection(int initialCapacity, int maximalCapacity, java.util.Comparator<? super RankedAbstractObject> comparator) throws java.lang.IllegalArgumentException
initialCapacity
- the initial capacity of the collectionmaximalCapacity
- the maximal capacity of the collectioncomparator
- the comparator that defines orderingjava.lang.IllegalArgumentException
- if the specified initial or maximal capacity is invalidpublic RankedSortedNoThresholdCollection(int initialCapacity, int maximalCapacity) throws java.lang.IllegalArgumentException
initialCapacity
- the initial capacity of the collectionmaximalCapacity
- the maximal capacity of the collectionjava.lang.IllegalArgumentException
- if the specified initial or maximal capacity is invalidpublic RankedSortedNoThresholdCollection() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the specified initial or maximal capacity is invalidpublic RankedSortedNoThresholdCollection(DistanceFunction<? super T> distanceFunction, T referenceObject, java.util.Iterator<? extends T> iterator)
iterator
.
Objects are ranked by the distance measured by the distanceFunction
from the given referenceObject
.T
- the type of object used to measure the distancedistanceFunction
- the distance function used for the measuringreferenceObject
- the reference object from which the distance is measurediterator
- the iterator on objects to add to the collectionpublic RankedSortedNoThresholdCollection(DistanceFunction<? super T> distanceFunction, T referenceObject, ObjectProvider<? extends T> objectProvider)
objectProvider
.
Objects are ranked by the distance measured by the distanceFunction
from the given referenceObject
.T
- the type of object used to measure the distancedistanceFunction
- the distance function used for the measuringreferenceObject
- the reference object from which the distance is measuredobjectProvider
- the provider of objects to add to the collectionpublic RankedSortedNoThresholdCollection(LocalAbstractObject referenceObject, java.util.Iterator<? extends LocalAbstractObject> iterator)
iterator
.
Objects are ranked by the distance measured from the given referenceObject
.referenceObject
- the reference object from which the distance is measurediterator
- the iterator on objects to add to the collectionpublic RankedSortedNoThresholdCollection(LocalAbstractObject referenceObject, ObjectProvider<? extends LocalAbstractObject> objectProvider)
objectProvider
.
Objects are ranked by the distance measured from the given referenceObject
.referenceObject
- the reference object from which the distance is measuredobjectProvider
- the provider of objects to add to the collectionpublic RankedSortedNoThresholdCollection(RankingQueryOperation operation)
operation
- operation with collection to copy all parameters frompublic float getThresholdDistance()
DistanceRankedSortedCollection
LocalAbstractObject.MAX_DISTANCE
is returned.
Otherwise, the distance of the last object of this collection is returned.getThresholdDistance
in class DistanceRankedSortedCollection<RankedAbstractObject>
LocalAbstractObject.MAX_DISTANCE
if there are not enough objects.