org.apache.avalon.excalibur.collections
Class ArrayStack

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.ArrayList
                    |
                    +--org.apache.avalon.excalibur.collections.ArrayStack
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class ArrayStack
extends java.util.ArrayList

Unsynchronized stakc.

Since:
4.0
Version:
CVS $Revision: 1.4 $ $Date: 2001/12/11 09:53:26 $
Author:
Peter Donald
See Also:
Serialized Form

Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ArrayStack()
           
 
Method Summary
 java.lang.Object pop()
          Remove element from top of stack and return it
 java.lang.Object push(java.lang.Object element)
          Adds the object to the top of the stack.
 void setSize(int size)
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, 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, remove, 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, remove, removeAll, retainAll, subList
 

Constructor Detail

ArrayStack

public ArrayStack()
Method Detail

setSize

public void setSize(int size)

push

public java.lang.Object push(java.lang.Object element)
Adds the object to the top of the stack.
Parameters:
element - object to add to stack
Returns:
the object

pop

public java.lang.Object pop()
                     throws java.util.EmptyStackException
Remove element from top of stack and return it
Returns:
the element from stack
Throws:
java.util.EmptyStackException - if no elements left on stack


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.