|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<E>
java.util.Stack<E>
org.apache.qpid.junit.extensions.util.StackQueue<E>
public class StackQueue<E>
The Stack class in java.util (most unhelpfully) does not implement the Queue interface. This is an adaption of that class as a queue.
Responsibilities | Collaborations |
---|---|
Turn a stack into a queue. |
Field Summary |
---|
Fields inherited from class java.util.Vector |
---|
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
StackQueue()
|
Method Summary | |
---|---|
E |
element()
Retrieves, but does not remove, the head of this queue. |
boolean |
offer(E o)
Inserts the specified element into this queue, if possible. |
E |
peek()
Retrieves, but does not remove, the head of this queue, returning null if this queue is empty. |
E |
poll()
Retrieves and removes the head of this queue, or null if this queue is empty. |
E |
remove()
Retrieves and removes the head of this queue. |
Methods inherited from class java.util.Stack |
---|
empty, pop, push, search |
Methods inherited from class java.util.Vector |
---|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Queue |
---|
add |
Methods inherited from interface java.util.Collection |
---|
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Constructor Detail |
---|
public StackQueue()
Method Detail |
---|
public E element()
element
in interface Queue<E>
public boolean offer(E o)
offer
in interface Queue<E>
o
- The data element to push onto the stack.
public E peek()
peek
in interface Queue<E>
peek
in class Stack<E>
public E poll()
poll
in interface Queue<E>
public E remove()
remove
in interface Queue<E>
NoSuchElementException
- If the stack is empty so no element can be removed from it.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |