|
||||||||||
| PREV CLASS (src) 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 (src)
org.jboss.util.collection.ListQueue
A ListQueue implements a first-in, first-out container using a List as a data structure.
| Field Summary | |
protected java.util.List |
list
List container |
| Fields inherited from class org.jboss.util.collection.AbstractQueue (src) |
DEFAULT_MAXIMUM_SIZE, maximumSize |
| Fields inherited from interface org.jboss.util.collection.Queue (src) |
UNLIMITED_MAXIMUM_SIZE |
| Constructor Summary | |
ListQueue()
Construct a new unconstrained ListQueue using a LinkedList for a data-structure. |
|
ListQueue(int maxSize)
Construct a new constrained ListQueue using a LinkedList for a data-structure. |
|
ListQueue(java.util.List list)
Construct a new unconstrained ListQueue. |
|
ListQueue(java.util.List list,
int maxSize)
Construct a new constrained ListQueue. |
|
| Method Summary | |
protected boolean |
addLast(java.lang.Object obj)
Appends the given element to the end of this list. |
java.lang.Object |
getBack()
Get the object at the back of the queue. |
java.lang.Object |
getFront()
Get the object at the front of the queue. |
java.util.Iterator |
iterator()
Returns an iterator over the elements in this list in proper sequence. |
protected java.lang.Object |
removeFirst()
Remove the first object in the queue. |
java.util.Iterator |
reverseIterator()
Returns an iterator over the elements in this list in reverse sequence. |
int |
size()
Get the size of the queue. |
java.lang.String |
toString()
Return a String representation of this queue. |
| Methods inherited from class org.jboss.util.collection.AbstractQueue (src) |
add, clear, getMaximumSize, isEmpty, isFull, remove, setMaximumSize |
| Methods inherited from class java.util.AbstractCollection |
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
addAll, contains, containsAll, equals, hashCode, remove, removeAll, retainAll, toArray, toArray |
| Field Detail |
protected final java.util.List list
| Constructor Detail |
public ListQueue(java.util.List list,
int maxSize)
list - The list which will be used to store queued objects.maxSize - The maximum size of the queue.
java.lang.IllegalArgumentException - List is null.public ListQueue(int maxSize)
LinkedList for a data-structure.
maxSize - The maximum size of the queue.public ListQueue(java.util.List list)
list - The list which will be used to store queued objects.
java.lang.IllegalArgumentException - List is nullpublic ListQueue()
LinkedList for a data-structure.
| Method Detail |
protected boolean addLast(java.lang.Object obj)
addLast in class AbstractQueue (src) obj - Object to append.
protected java.lang.Object removeFirst()
removeFirst in class AbstractQueue (src) public int size()
public java.util.Iterator iterator()
public java.lang.Object getFront()
throws EmptyCollectionException (src)
EmptyCollectionException (src) - The queue is empty.
public java.lang.Object getBack()
throws EmptyCollectionException (src)
EmptyCollectionException (src) - The queue is empty.public java.util.Iterator reverseIterator()
public java.lang.String toString()
|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||