|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.utility.SortedArrayData<T,T>
messif.utility.SortedCollection<RankedAbstractObject>
messif.objects.util.RankedSortedCollection
public class RankedSortedCollection
Specialization of SortedCollection
that is specific for distance-ranked objects.
Constructor Summary | |
---|---|
RankedSortedCollection()
Constructs an empty collection. |
|
RankedSortedCollection(int initialCapacity,
int maximalCapacity)
Constructs an empty collection with the specified initial and maximal capacity. |
|
RankedSortedCollection(int initialCapacity,
int maximalCapacity,
java.util.Comparator<? super RankedAbstractObject> comparator)
Constructs an empty collection with the specified initial and maximal capacity. |
|
RankedSortedCollection(LocalAbstractObject referenceObject,
java.util.Iterator<? extends LocalAbstractObject> iterator)
Creates a new collection filled with objects provided by the iterator . |
|
RankedSortedCollection(LocalAbstractObject referenceObject,
ObjectProvider<? extends LocalAbstractObject> objectProvider)
Creates a new collection filled with objects provided by the objectProvider . |
Method Summary | |
---|---|
float |
getLastDistance()
Returns the distance of the last object in this collection. |
float |
getThresholdDistance()
Returns the threshold distance for this collection. |
Methods inherited from class messif.utility.SortedCollection |
---|
add, addAll, clear, clone, compare, contains, containsAll, get, getMaximalCapacity, isEmpty, isFull, iterator, iterator, popLast, remove, remove, removeAll, removeFirst, removeLast, retainAll, size, toArray, toArray, toString |
Methods inherited from class messif.utility.SortedArrayData |
---|
binarySearch, first, fullSearch, indexOf, last, mergeSort |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Constructor Detail |
---|
public RankedSortedCollection(int initialCapacity, int maximalCapacity, java.util.Comparator<? super RankedAbstractObject> comparator) throws java.lang.IllegalArgumentException
initialCapacity
- the initial capacity of the collectionmaximalCapacity
- the maximal capatity of the collectioncomparator
- the comparator that defines ordering
java.lang.IllegalArgumentException
- if the specified initial or maximal capacity is invalidpublic RankedSortedCollection(int initialCapacity, int maximalCapacity) throws java.lang.IllegalArgumentException
initialCapacity
- the initial capacity of the collectionmaximalCapacity
- the maximal capatity of the collection
java.lang.IllegalArgumentException
- if the specified initial or maximal capacity is invalidpublic RankedSortedCollection() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the specified initial or maximal capacity is invalidpublic RankedSortedCollection(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 RankedSortedCollection(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 collectionMethod Detail |
---|
public float getLastDistance() throws java.util.NoSuchElementException
java.util.NoSuchElementException
- if this collection is emptypublic float getThresholdDistance()
LocalAbstractObject.MAX_DISTANCE
is returned.
Otherwise, the distance of the last object of this collection is returned.
LocalAbstractObject.MAX_DISTANCE
if there are not enough objects.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |