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