|
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.QueueDynamicSize
A dynamically resizable queue. Array-based wrap-around implementation.
This software is distributed under the Berkeley Software License.
Revisions: - GUIRLib-v1.0-1.0.0, Dec 20 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 | |
QueueDynamicSize()
Constructor to create a new Dynamic Queue. |
|
QueueDynamicSize(int iQueueCapacity)
Constructor to set the initial 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. |
static void |
setDefaultInitialCapacity(int capacity)
|
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 QueueDynamicSize()
setDefaultInitialCapacity(int)public QueueDynamicSize(int iQueueCapacity)
iQueueCapacity - is the Capacity of the queue to set to. The
capacity must be greater than 0.| Method Detail |
public static void setDefaultInitialCapacity(int capacity)
public void clear()
Queueclear in interface Queue
public void enqueue(Object obj)
throws FullException
Queueenqueue in interface Queueedu.berkeley.guir.lib.collection.Queueo - is the Object to add to the queue.QueueFullException - if the queue is full
public Object dequeue()
throws EmptyException
Queuedequeue in interface Queueedu.berkeley.guir.lib.collection.QueueQueueEmptyException - if the Queue is emptypublic Object peek()
Queuepeek in interface Queueedu.berkeley.guir.lib.collection.Queuepublic boolean isEmpty()
QueueisEmpty in interface Queueedu.berkeley.guir.lib.collection.Queuepublic boolean isFull()
QueueisFull in interface Queueedu.berkeley.guir.lib.collection.Queuepublic int size()
Queuesize in interface Queueedu.berkeley.guir.lib.collection.Queuepublic int capacity()
Queuecapacity in interface Queueedu.berkeley.guir.lib.collection.Queuepublic String toString()
toString in class Object
|
Copyright Information | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||