public class PriorityList<E> extends java.util.AbstractList<E>
Priority is an integer, and the list is sorted in descending order (that is, 100 is before 10 is before 0 is before -40).
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PRIORITY
This is the default priority, which is used if no priority
is defined.
|
| Constructor and Description |
|---|
PriorityList() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o)
Adds an object using the default priority to the List.
|
void |
add(E o,
int priority)
Adds an object to its correct place in the list, using the
given priority.
|
E |
get(int index)
Returns the object at index "index".
|
int |
size()
Returns the current size of the list.
|
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int DEFAULT_PRIORITY
public PriorityList()
public void add(E o, int priority)
o - Object to add.priority - Priority.Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.