|
Scribble Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Generic Queue Interface. Allows insertion/deletion at either end.
Copyright (c) 1998 Massachusetts Institute of Technology
Field Summary | |
static int |
BACK
|
static int |
FRONT
|
Method Summary | |
java.lang.Object |
dequeue()
Removes and returns the Object at the tail of the queue. |
java.lang.Object |
dequeue(int end)
Removes and returns the Object at the specified end of the queue. |
java.util.Enumeration |
elements()
Returns an Enumeration of the Objects in the queue. |
void |
enqueue(java.lang.Object obj)
Puts obj into the front the queue. |
void |
enqueue(java.lang.Object obj,
int end)
Puts obj into the specified end of the queue. |
boolean |
isEmpty()
Tests whether the queue is empty. |
java.lang.Object |
peek()
Gets the tail object from the queue without removing it. |
java.lang.Object |
peek(int end)
Gets the object from the specified end of the queue without removing it. |
int |
size()
Returns the number of elements in this. |
Field Detail |
public static final int FRONT
public static final int BACK
Method Detail |
public int size()
public java.lang.Object peek()
public java.lang.Object peek(int end)
public void enqueue(java.lang.Object obj)
public void enqueue(java.lang.Object obj, int end)
public java.lang.Object dequeue()
public java.lang.Object dequeue(int end)
public boolean isEmpty()
public java.util.Enumeration elements()
Note: Do not modify the queue while enumerating--unpredictable behavior may result.
Enumeration
|
Scribble Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |