public class RankedSortedMultiCollection extends RankedSortedCollection implements CollectionProvider<RankedAbstractObject>
RankedAbstractMetaObject
by
the respective sub-distance.Modifier and Type | Class and Description |
---|---|
static class |
RankedSortedMultiCollection.RankedSortedMultiCollectionComparator
Comparator based on the sub-distances assigned to
RankedAbstractMetaObject . |
DEFAULT_INITIAL_CAPACITY, UNLIMITED_CAPACITY
Constructor and Description |
---|
RankedSortedMultiCollection(int initialCapacity,
int maximalCapacity,
int sublistCount)
Constructs an empty collection with the specified initial and maximal capacity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(RankedAbstractObject e)
Adds the specified element to this list.
|
boolean |
addAll(java.util.Collection<? extends RankedAbstractObject> c)
Add all of the elements in the specified collection to this list.
|
void |
clear()
Removes all of the elements from this list.
|
SortedCollection<RankedAbstractObject> |
clone(boolean copyData)
Returns a shell or shallow copy of this SortedCollection instance.
|
java.util.Collection<RankedAbstractObject> |
getCollection(int index)
Returns the collection with the given index.
|
int |
getCollectionCount()
Returns the number of collections.
|
java.lang.Class<? extends RankedAbstractObject> |
getCollectionValueClass()
Returns the class of the objects stored in the collections.
|
float |
getLastDistance(int subListIndex) |
java.util.Comparator<? super RankedAbstractObject> |
getSublistComparator(int sublistIndex)
Returns the comparator used by the particular sub-collection.
|
int |
getSublistCount()
Returns the number of additional collections.
|
float |
getThresholdDistance(int subListIndex) |
protected boolean |
remove(int index)
Removes the element at the specified position in this collection.
|
add, add, isEqual, isIgnoringDuplicates, rankObject, remove, removeFirst, removeLast, setIgnoringDuplicates, setMaximalCapacity, toArray, toArray
getLastDistance, getThresholdDistance, iteratorDistanceRestricted, iteratorDistanceRestricted
addAllSortedArray, 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 RankedSortedMultiCollection(int initialCapacity, int maximalCapacity, int sublistCount) throws java.lang.IllegalArgumentException
initialCapacity
- the initial capacity of the collectionmaximalCapacity
- the maximal capacity of the collectionsublistCount
- number of additional collectionsjava.lang.IllegalArgumentException
- if the specified initial or maximal capacity is invalidpublic java.util.Comparator<? super RankedAbstractObject> getSublistComparator(int sublistIndex)
sublistIndex
- index of the particular sublistpublic boolean addAll(java.util.Collection<? extends RankedAbstractObject> c)
SortedCollection
SortedCollection
over the same type, then it is assumed that
it is ordered by the same comparator and these lists are effectively merged.addAll
in interface java.util.Collection<RankedAbstractObject>
addAll
in class SortedCollection<RankedAbstractObject>
c
- collection containing elements to be added to this listpublic boolean add(RankedAbstractObject e) throws java.lang.IllegalArgumentException
SortedCollection
add
in interface java.util.Collection<RankedAbstractObject>
add
in interface java.util.Queue<RankedAbstractObject>
add
in class RankedSortedCollection
e
- element to be appended to this listjava.lang.IllegalArgumentException
protected boolean remove(int index)
SortedCollection
remove
in class RankedSortedCollection
index
- index of the element to removepublic void clear()
SortedCollection
clear
in interface java.util.Collection<RankedAbstractObject>
clear
in class RankedSortedCollection
public SortedCollection<RankedAbstractObject> clone(boolean copyData) throws java.lang.CloneNotSupportedException
SortedCollection
copyData
parameter is false, only the collection shell
is copied but no data, i.e. this creates a new instance of an empty collection
with the same settings as the original one. Otherwise, the data are also copied
as references.
The comparator is shared with the new instance.clone
in class SortedCollection<RankedAbstractObject>
copyData
- if true the collection data are copied as references, otherwise,
only the collection shell is copied but no data, i.e. this creates a new instance of
an empty collection with the same settings as the original onejava.lang.CloneNotSupportedException
- if there was a problem cloning this collectionpublic int getCollectionCount()
CollectionProvider
getCollectionCount
in interface CollectionProvider<RankedAbstractObject>
public java.util.Collection<RankedAbstractObject> getCollection(int index) throws java.lang.IndexOutOfBoundsException
CollectionProvider
getCollection
in interface CollectionProvider<RankedAbstractObject>
index
- the index of the collection to returnjava.lang.IndexOutOfBoundsException
- if the given index is negative or
greater or equal to CollectionProvider.getCollectionCount()
public java.lang.Class<? extends RankedAbstractObject> getCollectionValueClass()
CollectionProvider
getCollectionValueClass
in interface CollectionProvider<RankedAbstractObject>
public int getSublistCount()
public float getThresholdDistance(int subListIndex)
public float getLastDistance(int subListIndex) throws java.util.NoSuchElementException
java.util.NoSuchElementException