|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xnap.util.PriorityQueue
public class PriorityQueue
A list of Object
objects that is sorted descending by priority.
This class is thread safe.
Field Summary | |
---|---|
protected java.util.LinkedList |
queue
|
Constructor Summary | |
---|---|
PriorityQueue()
|
Method Summary | |
---|---|
void |
add(java.lang.Object o,
int priority)
Adds o . |
boolean |
addUnique(java.lang.Object o,
int priority)
Adds o if not already in queue. |
void |
clear()
|
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
java.lang.Object |
peek()
Returns the item with the highest priority without removing it. |
java.lang.Object |
pop()
Removes and returns the item with the highest priority. |
boolean |
remove(java.lang.Object o)
|
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.LinkedList queue
Constructor Detail |
---|
public PriorityQueue()
Method Detail |
---|
public void add(java.lang.Object o, int priority)
o
.
public boolean addUnique(java.lang.Object o, int priority)
o
if not already in queue.
public void clear()
public boolean isEmpty()
public java.util.Iterator iterator()
public java.lang.Object peek()
public java.lang.Object pop()
public boolean remove(java.lang.Object o)
public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |