|
JBoss Common Classes 2.2.17.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
org.jboss.util.collection.AbstractQueue<E>
E
- the element typepublic abstract class AbstractQueue<E>
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 |
---|
UNLIMITED_MAXIMUM_SIZE |
Constructor Summary | |
---|---|
protected |
AbstractQueue()
Initializes the AbstractQueue. |
protected |
AbstractQueue(int maxSize)
Initializes the AbstractQueue. |
Method Summary | |
---|---|
boolean |
add(E obj)
Append and object to the underling list. |
protected abstract boolean |
addLast(E 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. |
E |
remove()
Remove and return the first object in the queue. |
protected abstract E |
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 |
---|
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.
IllegalArgumentException
- Illegal size.Method Detail |
---|
public int getMaximumSize()
getMaximumSize
in interface Queue<E>
Queue.UNLIMITED_MAXIMUM_SIZE
.public void setMaximumSize(int size)
setMaximumSize
in interface Queue<E>
size
- New maximim queue size or Queue.UNLIMITED_MAXIMUM_SIZE
.
IllegalArgumentException
- Illegal size.public boolean isFull()
isFull
in interface Queue<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in interface Queue<E>
isEmpty
in class AbstractCollection<E>
public boolean add(E obj) throws FullCollectionException
add
in interface Collection<E>
add
in interface Queue<E>
add
in class AbstractCollection<E>
obj
- Object to enqueue.
FullCollectionException
- The queue is full.public E remove() throws EmptyCollectionException
remove
in interface Queue<E>
EmptyCollectionException
- The queue is empty.public void clear()
clear
in interface Collection<E>
clear
in class AbstractCollection<E>
protected abstract boolean addLast(E obj)
obj
- Object to append
protected abstract E removeFirst()
|
JBoss Common Classes 2.2.17.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |