|
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>
org.jboss.util.collection.ListQueue<E>
E
- the element typepublic class ListQueue<E>
A ListQueue implements a first-in, first-out container using a List as a data structure.
Field Summary | |
---|---|
protected List<E> |
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<E> list)
Construct a new unconstrained ListQueue. |
|
ListQueue(List<E> list,
int maxSize)
Construct a new constrained ListQueue. |
Method Summary | |
---|---|
protected boolean |
addLast(E obj)
Appends the given element to the end of this list. |
E |
getBack()
Get the object at the back of the queue. |
E |
getFront()
Get the object at the front of the queue. |
Iterator<E> |
iterator()
Returns an iterator over the elements in this list in proper sequence. |
protected E |
removeFirst()
Remove the first object in the queue. |
Iterator<E> |
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<E> list
Constructor Detail |
---|
public ListQueue(List<E> 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<E> 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(E obj)
addLast
in class AbstractQueue<E>
obj
- Object to append.
protected E removeFirst()
removeFirst
in class AbstractQueue<E>
public int size()
size
in interface Collection<E>
size
in class AbstractCollection<E>
public Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in class AbstractCollection<E>
public E getFront() throws EmptyCollectionException
EmptyCollectionException
- The queue is empty.public E getBack() throws EmptyCollectionException
EmptyCollectionException
- The queue is empty.public Iterator<E> reverseIterator()
public String toString()
toString
in class AbstractCollection<E>
|
JBoss Common Classes 2.2.17.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |