|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
org.jboss.util.collection.AbstractQueue
An abstract implementation of a Queue. Sub-classes must provide methods
for addLast(Object)
and removeFirst()
.
Field Summary | |
static int |
DEFAULT_MAXIMUM_SIZE
Default maximum queue size |
protected int |
maximumSize
Maximum queue size |
Fields inherited from interface org.jboss.util.collection.Queue (src) |
UNLIMITED_MAXIMUM_SIZE |
Constructor Summary | |
protected |
AbstractQueue()
Initializes the AbstractQueue. |
protected |
AbstractQueue(int maxSize)
Initializes the AbstractQueue. |
Method Summary | |
boolean |
add(java.lang.Object obj)
Append and object to the underling list. |
protected abstract boolean |
addLast(java.lang.Object obj)
Appends the given element to the end of the queue |
void |
clear()
Removes all of the elements from this 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. |
java.lang.Object |
remove()
Remove and return the first object in the queue. |
protected abstract java.lang.Object |
removeFirst()
Remove the first object in the queue |
void |
setMaximumSize(int size)
Set the maximum size of the queue |
Methods inherited from class java.util.AbstractCollection |
addAll, contains, containsAll, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jboss.util.collection.Queue (src) |
getBack, getFront |
Methods inherited from interface java.util.Collection |
addAll, contains, containsAll, equals, hashCode, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Field Detail |
public static int DEFAULT_MAXIMUM_SIZE
protected int maximumSize
Constructor Detail |
protected AbstractQueue()
protected AbstractQueue(int maxSize)
maxSize
- Maximum queue size.
java.lang.IllegalArgumentException
- Illegal size.Method Detail |
public int getMaximumSize()
getMaximumSize
in interface Queue (src)
Queue.UNLIMITED_MAXIMUM_SIZE
.public void setMaximumSize(int size)
setMaximumSize
in interface Queue (src)
size
- New maximim queue size or Queue.UNLIMITED_MAXIMUM_SIZE
.
java.lang.IllegalArgumentException
- Illegal size.public boolean isFull()
isFull
in interface Queue (src)
public boolean isEmpty()
isEmpty
in interface Queue (src)
public boolean add(java.lang.Object obj) throws FullCollectionException (src)
add
in interface Queue (src)
obj
- Object to enqueue.
FullCollectionException (src)
- The queue is full.public java.lang.Object remove() throws EmptyCollectionException (src)
remove
in interface Queue (src)
EmptyCollectionException (src)
- The queue is empty.public void clear()
clear
in interface java.util.Collection
protected abstract boolean addLast(java.lang.Object obj)
obj
- Object to append
protected abstract java.lang.Object removeFirst()
|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |