Copyright 2002 by aragost

com.aragost.util
Class LifoQueue

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.AbstractSequentialList
                    |
                    +--java.util.LinkedList
                          |
                          +--com.aragost.util.LifoQueue
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, Queue, java.io.Serializable

public class LifoQueue
extends java.util.LinkedList
implements Queue

A LIFO implemetation

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
LifoQueue()
           
 
Method Summary
 java.lang.Object peek()
          Return the next Object from the queue, that is the Object that will be returned by the remove method.
 java.lang.Object remove()
          Remove the next Object from the queue.
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, remove, remove, removeFirst, removeLast, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.aragost.util.Queue
add
 
Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

LifoQueue

public LifoQueue()
Method Detail

remove

public java.lang.Object remove()
Remove the next Object from the queue. If the queue is empty then throw an NoSuchElementException.

Specified by:
remove in interface Queue
Returns:
Return the Object removed.

peek

public java.lang.Object peek()
Return the next Object from the queue, that is the Object that will be returned by the remove method. This method is optional, if it is not supported an UnsupportedOperationException should be thrown.

Specified by:
peek in interface Queue

Copyright 2002 by aragost