|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.kwfgrid.gwes.util.Queue
public class Queue
Code modified from Data Structures & Problem Solving Using Java by Mark Allen Weiss, 1998.
| Field Summary | |
|---|---|
Object |
enqueueSync
|
Object |
isEmptySync
|
| Constructor Summary | |
|---|---|
Queue()
Construct the queue. |
|
| Method Summary | |
|---|---|
Object |
dequeue()
Return and remove the least recently inserted item from the queue. |
void |
enqueue(Object x)
Insert a new item into the queue. |
int |
getCurrentSize()
Get the current size of the queue |
Object |
getFront()
Get the least recently inserted item in the queue. |
boolean |
isEmpty()
Test if the queue is logically empty. |
void |
makeEmpty()
Make the queue logically empty. |
void |
waitForEnqueue()
Wait for queue to be filled |
void |
waitUntilEmpty()
Wait for queue to be empty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final Object enqueueSync
public final Object isEmptySync
| Constructor Detail |
|---|
public Queue()
| Method Detail |
|---|
public boolean isEmpty()
public Object getFront()
public Object dequeue()
public void enqueue(Object x)
x - the item to insert.public void makeEmpty()
public int getCurrentSize()
public void waitUntilEmpty()
throws InterruptedException
InterruptedException
public void waitForEnqueue()
throws InterruptedException
InterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||