|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.common.util.objects.PriorityQueue
public class PriorityQueue
Implements a priority aware queue (FIFO structure).
Field Summary | |
---|---|
protected static Logger |
LOGGER
|
Constructor Summary | |
---|---|
PriorityQueue()
Constructs a queue with 5 priority levels. |
|
PriorityQueue(int levelNb)
Constucts a queue with the specified number of priority levels. |
Method Summary | |
---|---|
boolean |
add(Object o)
Adds an element to the queue. |
boolean |
add(Object o,
int priority)
Adds an element to the queue with the specified priority. |
boolean |
addAll(Collection c)
Adds all the elments of a collection to the queue. |
void |
clear()
Clears all the queue. |
boolean |
contains(Object o)
Checks if the object is in the queue. |
boolean |
containsAll(Collection c)
Checks if all the element are in the queue. |
boolean |
equals(Object o)
Checks if the queue is equals to another one. |
boolean |
isEmpty()
Checks if the queue is empty. |
Iterator |
iterator()
Iterator without a valid remove method ! |
Object |
popFirst()
Pops the first var in the queue. |
boolean |
remove(Object o)
Removes the specified object. |
boolean |
removeAll(Collection c)
Removes all the specified objects. |
boolean |
retainAll(Collection c)
Not yet implemented. |
int |
size()
Returns the size of the queue. |
Object[] |
toArray()
Returns an array with all the objects in the queue. |
Object[] |
toArray(Object[] a)
Not yet implemented. |
void |
updatePriority(Object o)
Updates the location of the element in the list. |
void |
updatePriority(Object o,
int priority)
Updates the location of the element in the list with the specified priority. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Logger LOGGER
Constructor Detail |
---|
public PriorityQueue(int levelNb)
public PriorityQueue()
Method Detail |
---|
public boolean add(Object o)
IPrioritizable
object.
public boolean add(Object o, int priority)
public boolean addAll(Collection c)
public void clear()
public boolean contains(Object o)
public boolean containsAll(Collection c)
public boolean equals(Object o)
equals
in class Object
public boolean isEmpty()
public Iterator iterator()
public Object popFirst()
public boolean remove(Object o)
public boolean removeAll(Collection c)
public boolean retainAll(Collection c)
public int size()
public Object[] toArray()
public Object[] toArray(Object[] a)
public void updatePriority(Object o)
IPrioritizable
.
public void updatePriority(Object o, int priority)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |