|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucr.core.BoundedQueue
A Queue supporting standard enqueue/dequeue operations with a maximum permitted size. Having a maximum size guards against unrestricted memory usage
| Field Summary | |
private int |
maxSize
|
private java.util.LinkedList |
queue
|
| Constructor Summary | |
BoundedQueue(int maxSize)
Constructs a BoundedQueue with a max size |
|
| Method Summary | |
java.lang.Object |
dequeue()
Removes an object from the queue |
boolean |
empty()
Check if the queue is empty |
boolean |
enqueue(java.lang.Object o)
Enqueue an object |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int maxSize
private java.util.LinkedList queue
| Constructor Detail |
public BoundedQueue(int maxSize)
BoundedQueue with a max size
maxSize - for queue| Method Detail |
public boolean enqueue(java.lang.Object o)
public java.lang.Object dequeue()
public boolean empty()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||