|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibis.util.Queue
A simple queue class. Objects can be enqueued, dequeued, or dequeued with a deadline.
Constructor Summary | |
Queue()
Constructs a new queue. |
Method Summary | |
java.lang.Object |
dequeue()
Dequeues the head of the queue. |
java.lang.Object |
dequeue(long deadline)
Dequeues the head of the queue. |
void |
enqueue(java.lang.Object o)
Enqueues the specified object, and notifies: if there are threads waiting, a single one is notified. |
int |
size()
Returns the length of the queue. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Queue()
Method Detail |
public void enqueue(java.lang.Object o)
o
- the object to be enqueued.public java.lang.Object dequeue()
public java.lang.Object dequeue(long deadline)
deadline
- the deadline expressed in milliseconds
since 1-1-1970. a value of "0" will cause this
function to wait forever, on -1 it will not wait
at all.
public int size()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |