|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.almendra.janet.cas.schedulers.PriorityQueue
public class PriorityQueue
Field Summary | |
---|---|
protected EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock |
lock
|
protected java.util.LinkedList[] |
queues
|
protected int |
size
|
Constructor Summary | |
---|---|
PriorityQueue()
|
|
PriorityQueue(int numQueues)
|
Method Summary | |
---|---|
protected boolean |
add(IPrioritizedObject prioritizedObject)
|
boolean |
add(java.lang.Object object)
Add an object to the queue. |
java.lang.Object |
getNext()
Remove the first object from the queue and return it. |
boolean |
hasNext()
Answer whether ther is at least another object in the queue. |
protected void |
init(int numQueues)
|
boolean |
isEmpty()
Answer true in case the queue is empty otherwise false. |
java.util.Iterator |
iterator()
Return an iterator with which to iterate over the queue objects. |
java.lang.Object |
remove(java.lang.Object object)
Remove object from aPriorityQueue. |
int |
size()
Answer the number of objects in the queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.LinkedList[] queues
protected int size
protected EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock lock
Constructor Detail |
---|
public PriorityQueue()
public PriorityQueue(int numQueues)
Method Detail |
---|
public boolean add(java.lang.Object object)
IQueue
add
in interface IQueue
object
- the object to be added
protected boolean add(IPrioritizedObject prioritizedObject)
public java.lang.Object getNext()
IQueue
getNext
in interface IQueue
protected void init(int numQueues)
public boolean isEmpty()
IQueue
isEmpty
in interface IQueue
public int size()
IQueue
size
in interface IQueue
public java.lang.Object remove(java.lang.Object object)
remove
in interface IQueue
public boolean hasNext()
IQueue
hasNext
in interface IQueue
public java.util.Iterator iterator()
IQueue
iterator
in interface IQueue
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |