|
||||||||||
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
messif.objects.util.DoubleSortedCollection
public abstract class DoubleSortedCollection
This class resorts the ranked objects according to new distances (returned by method implemented in the child classes). It keeps the original distances in order to return correctly the threshold distance.
Field Summary | |
---|---|
protected java.util.Map<RankedAbstractObject,java.lang.Float> |
originalDistances
Distances to be used for pivot filtering - the original distances without the new sorting distances. |
protected RankedAbstractObject |
thresholdObject
Object from the collectio with the threshold distance for pivot filtering - this distance cannot be simply the last distance including the keywords distance, because the keywords ditance cannot be considered for filtering. |
Constructor Summary | |
---|---|
DoubleSortedCollection(int initialCapacity,
int maximalCapacity)
Creates new sorted collection sorted according to pixmac shape+color distance + weighted keywords distance |
Method Summary | |
---|---|
boolean |
add(RankedAbstractObject e)
Adds the specified element to this list. |
boolean |
add(RankedAbstractObject newObject,
float oldDistance)
Adds the specified element to this list. |
abstract float |
getNewDistance(AbstractObject origObject,
float origDistance)
Given an object, this method should return the new distance this collection is sorted according to. |
float |
getThresholdDistance()
Returns the threshold distance for this collection. |
protected boolean |
remove(int index)
Removes the element at the specified position in this collection. |
Methods inherited from class messif.objects.util.RankedSortedCollection |
---|
getLastDistance |
Methods inherited from class messif.utility.SortedCollection |
---|
addAll, clear, clone, compare, contains, containsAll, get, getMaximalCapacity, isEmpty, isFull, iterator, iterator, popLast, 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 |
Field Detail |
---|
protected final java.util.Map<RankedAbstractObject,java.lang.Float> originalDistances
protected RankedAbstractObject thresholdObject
Constructor Detail |
---|
public DoubleSortedCollection(int initialCapacity, int maximalCapacity) throws java.lang.IllegalArgumentException
initialCapacity
- capacity of the collection to allocate initiallymaximalCapacity
- max capacity of the collection
java.lang.IllegalArgumentException
Method Detail |
---|
public abstract float getNewDistance(AbstractObject origObject, float origDistance)
origObject
- the original objectorigDistance
- the original distance
public boolean add(RankedAbstractObject e)
SortedCollection
add
in interface java.util.Collection<RankedAbstractObject>
add
in class SortedCollection<RankedAbstractObject>
e
- element to be appended to this list
Collection.add(E)
)public boolean add(RankedAbstractObject newObject, float oldDistance)
newObject
- the element to add to this listoldDistance
- old ranking distance (used for keeping the threshold)
Collection.add(E)
)protected boolean remove(int index)
SortedCollection
remove
in class SortedCollection<RankedAbstractObject>
index
- index of the element to remove
public float getThresholdDistance()
RankedSortedCollection
LocalAbstractObject.MAX_DISTANCE
is returned.
Otherwise, the distance of the last object of this collection is returned.
getThresholdDistance
in class RankedSortedCollection
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 |