org.jawk.util
Class LinkedListStackImpl<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList<E>
                  extended by org.jawk.util.LinkedListStackImpl<E>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.Queue<E>, MyStack<E>

public class LinkedListStackImpl<E>
extends java.util.LinkedList<E>
implements MyStack<E>

A simple delegate to a LinkedList. Unlike the java.util.Stack, this implementation is non-synchronized to improve performance.

It performs slower than the ArrayStackImpl version.

There is no maximum capacity which is enforced, nor is there any checks if pop() is executed on an empty stack.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
LinkedListStackImpl()
           
 
Method Summary
 E pop()
          Pop an item off the stack and return that item to the callee.
 void push(E o)
          Push an item onto the stack.
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, peek, poll, remove, 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 org.jawk.util.MyStack
clear, peek, size
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

LinkedListStackImpl

public LinkedListStackImpl()
Method Detail

push

public void push(E o)
Description copied from interface: MyStack
Push an item onto the stack.

Specified by:
push in interface MyStack<E>
Parameters:
o - The item to push onto the stack.

pop

public E pop()
Description copied from interface: MyStack
Pop an item off the stack and return that item to the callee.

Specified by:
pop in interface MyStack<E>
Returns:
The top of the stack, which is subsequently removed from the stack.