com.infomatiq.jsi.rtree
Class SortedList
java.lang.Object
com.infomatiq.jsi.rtree.SortedList
public class SortedList
- extends Object
Sorted List, backed by a TArrayList.
The elements in the list are always ordered by priority.
Methods exists to remove elements with the highest and lowest priorities.
If more than one element has the highest priority, they will
all be removed by calling removeHighest. Ditto for the lowest priority.
The list has a preferred maximum size. If possible, entries with the lowest priority
will be removed to limit the maximum size. Note that entries with the lowest priority
will not be removed if this would leave fewer than the preferred maximum number
of entries.
This class is not optimised for large values of preferredMaximumSize. Values greater than,
say, 5, are not recommended.
Method Summary |
void |
add(int id,
float priority)
|
void |
forEachId(gnu.trove.TIntProcedure v)
|
float |
getLowestPriority()
return the lowest priority currently stored, or float.NEGATIVE_INFINITY if no
entries are stored |
void |
init(int preferredMaximumSize)
|
void |
reset()
|
int[] |
toNativeArray()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SortedList
public SortedList()
init
public void init(int preferredMaximumSize)
reset
public void reset()
add
public void add(int id,
float priority)
getLowestPriority
public float getLowestPriority()
- return the lowest priority currently stored, or float.NEGATIVE_INFINITY if no
entries are stored
forEachId
public void forEachId(gnu.trove.TIntProcedure v)
toNativeArray
public int[] toNativeArray()
Copyright © 2012. All Rights Reserved.