|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
~mohammad/public_html/classes/csc241/Queue/Queue.java This is an ADT for Queue class. A Queue holds objects. There is no code, private variables, or constructors designed for Queue as it is an Interface. We are postponing its implementation, so that we could have an array version and a linked list version. Notice that there is no constructor and instead of {} for the methods with simply have ';'.
Method Summary | |
void |
dequeue()
remove an element from the front of the queue. |
boolean |
empty()
return true if queue is empty, otherwise, return false |
void |
enqueue(java.lang.Object x)
add an element to the back of the queue. |
boolean |
full()
return true if queue is full, otherwise, return false |
java.lang.Object |
peek()
return value - the object in front of the queue; null if queue is empty. |
Method Detail |
public boolean empty()
public boolean full()
public void enqueue(java.lang.Object x) throws queueException
-
- queueException if queue is full
queueException
public void dequeue() throws queueException
-
- queueException if queue is empty.
queueException
public java.lang.Object peek()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |