Plexus v0.13.1

com.phoenixst.collections
Class SimpleStack

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by com.phoenixst.collections.SimpleStack
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess

public final class SimpleStack
extends ArrayList

A simple stack data structure, basically a convenience extension of ArrayList.

Since:
1.0
Version:
$Revision: 1.2 $
Author:
Ray A. Conner
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SimpleStack()
          Creates a new SimpleStack.
SimpleStack(Collection collection)
          Creates a new SimpleStack.
SimpleStack(int initialCapacity)
          Creates a new SimpleStack.
 
Method Summary
 Object peek()
          Return the top element of this SimpleStack.
 Object pop()
          Pops an object off of this SimpleStack.
 void push(Object object)
          Pushes an object onto this SimpleStack.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

SimpleStack

public SimpleStack()
Creates a new SimpleStack.


SimpleStack

public SimpleStack(Collection collection)
Creates a new SimpleStack.


SimpleStack

public SimpleStack(int initialCapacity)
Creates a new SimpleStack.

Method Detail

push

public void push(Object object)
Pushes an object onto this SimpleStack.


pop

public Object pop()
           throws EmptyStackException
Pops an object off of this SimpleStack.

Throws:
EmptyStackException

peek

public Object peek()
            throws EmptyStackException
Return the top element of this SimpleStack.

Throws:
EmptyStackException

Plexus v0.13.1

See the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.