|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.berkeley.guir.lib.collection.QueueFixedSize
A statically sized queue that does not resize itself.
This software is distributed under the Berkeley Software License.
Revisions: - GUIRLib-v1.0-1.0.0, Nov 25 1997, JH Created class - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH Touched for GUIRLib release - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH Touched for GUIRLib release - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH Touched for GUIRLib release
Constructor Summary | |
QueueFixedSize(int iQueueCapacity)
Constructor to set the capacity of the Queue. |
Method Summary | |
int |
capacity()
Get the current maximum capacity of the queue. |
void |
clear()
Clears out all elements in the Queue. |
Object |
dequeue()
Remove and return the first element in the queue. |
void |
enqueue(Object obj)
Add an element to the end of the queue. |
boolean |
isEmpty()
Checks if the queue is empty. |
boolean |
isFull()
Check if the queue is full. |
Object |
peek()
Return the first element in the queue without removing it. |
int |
size()
Gets the size of the queue (the current number of elements in the queue). |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public QueueFixedSize(int iQueueCapacity)
iQueueCapacity
- is the Capacity of the queue to set to. The
capacity must be greater than 0.Method Detail |
public void clear()
Queue
clear
in interface Queue
public void enqueue(Object obj) throws FullException
Queue
enqueue
in interface Queue
edu.berkeley.guir.lib.collection.Queue
o
- is the Object to add to the queue.QueueFullException
- if the queue is fullpublic Object dequeue() throws EmptyException
Queue
dequeue
in interface Queue
edu.berkeley.guir.lib.collection.Queue
QueueEmptyException
- if the Queue is emptypublic Object peek()
Queue
peek
in interface Queue
edu.berkeley.guir.lib.collection.Queue
public boolean isEmpty()
Queue
isEmpty
in interface Queue
edu.berkeley.guir.lib.collection.Queue
public boolean isFull()
Queue
isFull
in interface Queue
edu.berkeley.guir.lib.collection.Queue
public int capacity()
Queue
capacity
in interface Queue
edu.berkeley.guir.lib.collection.Queue
public int size()
Queue
size
in interface Queue
edu.berkeley.guir.lib.collection.Queue
public String toString()
toString
in class Object
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |