|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectedu.trinity.cs.bmassing.adt1.FixedArrayQueue<E>
public class FixedArrayQueue<E>
Class for fixed-size array-based queues.
| Constructor Summary | |
|---|---|
FixedArrayQueue(int size)
Constructs a new FixedArrayQueue of the specified size. |
|
| Method Summary | |
|---|---|
E |
dequeue()
Removes an element from the queue. |
boolean |
empty()
Tells whether queue is empty. |
void |
enqueue(E x)
Adds an element to the end of the queue. |
E |
front()
Gets the front element of the queue (but does not remove it). |
static void |
main(java.lang.String[] args)
Performs minimal testing/demo of other functions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FixedArrayQueue(int size)
size - maximum number of elements| Method Detail |
|---|
public boolean empty()
empty in interface SimpleQueue<E>
public void enqueue(E x)
throws QueueFullException
enqueue in interface SimpleQueue<E>x - element to add
QueueFullException - if queue is already full
public E dequeue()
throws QueueEmptyException
dequeue in interface SimpleQueue<E>QueueEmptyException - if queue is empty
public E front()
throws QueueEmptyException
front in interface SimpleQueue<E>QueueEmptyException - if queue is emptypublic static void main(java.lang.String[] args)
args - command-line arguments (unused)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||