|
|||||||||
| 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
org.ceryle.util.Queue
public class Queue
Queue extends java.util.Stack (a class that represents a last-in-first-out (LIFO) stack of objects) to allow to rotate its contents up (top element --> bottom) or down (bottom element --> top).
As a queue, it also adds enqueue (a synonym for 'add') and dequeue(), which extracts items from the bottom of the Stack rather than the top, in first-in-first-out (FIFO) fashion.
Stack,
Serialized Form| Field Summary |
|---|
| Fields inherited from class java.util.Vector |
|---|
capacityIncrement, elementCount, elementData |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
Queue()
|
|
| Method Summary | |
|---|---|
Object |
dequeue()
Treats the Stack (backed up by a Vector) as a first-in-first-out (FIFO) queue, dequeue retrieving the bottom (zero-eth) element. |
boolean |
enqueue(Object o)
Treats the Stack (backed up by a Vector) as a first-in-first-out (FIFO) queue, enqueue a synonym for java.util.Vector's add or java.util.Stack's push, all of which add the new Object o to the top of the underlying Vector. |
void |
rotateDown()
Rotates the Stack by removing the first element and pushing it to the end of the Stack. |
void |
rotateDown(int count)
Rotates the Stack count times by repeatedly removing the first element and pushing it to the end of the Stack. |
void |
rotateUp()
Rotates the Stack by popping the last element and inserting it at the beginning of the Stack. |
void |
rotateUp(int count)
Rotates the Stack count times by repeatedly popping the last element and inserting it at the beginning of the Stack. |
| Methods inherited from class java.util.Stack |
|---|
empty, peek, 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, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
iterator, listIterator, listIterator |
| Constructor Detail |
|---|
public Queue()
| Method Detail |
|---|
public void rotateUp(int count)
throws EmptyStackException
EmptyStackException
public void rotateUp()
throws EmptyStackException
EmptyStackException
public void rotateDown(int count)
throws EmptyStackException
EmptyStackException
public void rotateDown()
throws EmptyStackException
EmptyStackExceptionpublic boolean enqueue(Object o)
public Object dequeue()
throws EmptyStackException
EmptyStackException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||