|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Queue
An iterface used to implement a first-in, first-out container.
Field Summary | |
---|---|
static int |
UNLIMITED_MAXIMUM_SIZE
Unlimited maximum queue size identifier. |
Method Summary | |
---|---|
boolean |
add(Object obj)
Enqueue an object onto the queue. |
Object |
getBack()
Get the object at the back of the queue. |
Object |
getFront()
Get the object at the front of the queue. |
int |
getMaximumSize()
Get the maximum size of the queue. |
boolean |
isEmpty()
Check if the queue is empty. |
boolean |
isFull()
Check if the queue is full. |
Object |
remove()
Dequeue an object from the queue. |
void |
setMaximumSize(int size)
Set the maximum size of the queue. |
Methods inherited from interface java.util.Collection |
---|
addAll, clear, contains, containsAll, equals, hashCode, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Field Detail |
---|
static final int UNLIMITED_MAXIMUM_SIZE
Method Detail |
---|
int getMaximumSize()
UNLIMITED_MAXIMUM_SIZE
.void setMaximumSize(int size) throws IllegalArgumentException
size
- New maximim pool size or UNLIMITED_MAXIMUM_SIZE
.
IllegalArgumentException
- Illegal size.boolean isFull()
boolean isEmpty()
isEmpty
in interface Collection
boolean add(Object obj) throws FullCollectionException
add
in interface Collection
obj
- Object to enqueue.
FullCollectionException
- The queue is full.Object remove() throws EmptyCollectionException
EmptyCollectionException
- The queue is empty.Object getFront() throws EmptyCollectionException
EmptyCollectionException
- The queue is empty.Object getBack() throws EmptyCollectionException
EmptyCollectionException
- The queue is empty.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |