Extension SDK 10.1.2

oracle.javatools.parser.util
Class SimpleStack

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended byoracle.javatools.parser.util.SimpleStack
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class SimpleStack
extends java.util.ArrayList

SimpleStack is an unsynchronized stack container based off of ArrayList. This is useful since java.util.Stack is based off of Vector and thus carries the performance cost of synchronization.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SimpleStack()
          Constructs an empty list.
SimpleStack(java.util.Collection c)
          Constructs a stack containing the elements of the specified collection, pushed in the order they are returned by the collection's iterator.
SimpleStack(int initialCapacity)
          Constructs an empty stack with the specified initial capacity.
 
Method Summary
 java.lang.Object peek()
          Retrieves the object at the top of the stack without removing it.
 java.lang.Object pop()
          Pops the object off the top of the stack.
 void push(java.lang.Object o)
          Pushes the object onto the top of the stack by appending it to the end of this list.
 
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

SimpleStack

public SimpleStack()
Constructs an empty list.


SimpleStack

public SimpleStack(java.util.Collection c)
Constructs a stack containing the elements of the specified collection, pushed in the order they are returned by the collection's iterator.


SimpleStack

public SimpleStack(int initialCapacity)
Constructs an empty stack with the specified initial capacity.

Method Detail

pop

public java.lang.Object pop()
Pops the object off the top of the stack.

Returns:
the Object popped from the stack

push

public void push(java.lang.Object o)
Pushes the object onto the top of the stack by appending it to the end of this list.

Parameters:
o - the Object to be pushed.

peek

public java.lang.Object peek()
Retrieves the object at the top of the stack without removing it.

Returns:
Object at the top of the stack.

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.