| java.util.AbstractList com.ecyrd.jspwiki.util.PriorityList
PriorityList | public class PriorityList extends AbstractList (Code) | | Builds a simple, priority-based List implementation. The list
will be sorted according to the priority. If two items are
inserted with the same priority, their order is the insertion order - i.e. the new one
is appended last in the insertion list.
Priority is an integer, and the list is sorted in descending order
(that is, 100 is before 10 is before 0 is before -40).
author: Janne Jalkanen |
Field Summary | |
final public static int | DEFAULT_PRIORITY This is the default priority, which is used if no priority
is defined. |
Method Summary | |
public void | add(Object o, int priority) Adds an object to its correct place in the list, using the
given priority. | public boolean | add(Object o) Adds an object using the default priority to the List.
Parameters: o - Object to add. | public Object | get(int index) Returns the object at index "index".
Parameters: index - The index. | public int | size() Returns the current size of the list. |
DEFAULT_PRIORITY | final public static int DEFAULT_PRIORITY(Code) | | This is the default priority, which is used if no priority
is defined. It's current value is zero.
|
add | public void add(Object o, int priority)(Code) | | Adds an object to its correct place in the list, using the
given priority.
Parameters: o - Object to add. Parameters: priority - Priority. |
add | public boolean add(Object o)(Code) | | Adds an object using the default priority to the List.
Parameters: o - Object to add. true, as per the general Collections.add contract. |
get | public Object get(int index)(Code) | | Returns the object at index "index".
Parameters: index - The index. The object at the list at the position "index". |
size | public int size()(Code) | | Returns the current size of the list.
size of the list. |
Fields inherited from java.util.AbstractList | protected transient int modCount(Code)(Java Doc)
|
|
|