API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util. Stack View Source
Author(s)
Jonathan Payne
Since
JDK1.0
Version
1.30, 11/17/05
Serial
Hierarchy
 Object
      AbstractCollection
          AbstractList
              Vector
                  Stack
Implements
Subclasses
Description
public class Stack
  The Stack class represents a last-in-first-out (LIFO) stack of objects.
See also:   
Constructors
public Stack ()
Creates an empty Stack.
Methods
Hide/Show inherited methods
publicsynchronized boolean add ( E e) [Inherited From Vector]
  Appends the specified element to the end of this Vector.
public void add (int index, E element) [Inherited From Vector]
  Inserts the specified element at the specified position in this Vector.
publicsynchronized boolean addAll (Collection<Object> c) [Inherited From Vector]
  Appends all of the elements in the specified Collection to the end of this Vector, in the order that they are returned by the specified Collection's Iterator.
publicsynchronized boolean addAll (int index, Collection<Object> c) [Inherited From Vector]
  Inserts all of the elements in the specified Collection into this Vector at the specified position.
publicsynchronized void addElement ( E obj) [Inherited From Vector]
  Adds the specified component to the end of this vector, increasing its size by one.
publicsynchronized int capacity () [Inherited From Vector]
  Returns the current capacity of this vector.
public void clear () [Inherited From Vector]
  Removes all of the elements from this Vector.
publicsynchronized Object clone () [Inherited From Vector]
  Returns a clone of this vector.
public boolean contains (Object o) [Inherited From Vector]
  Returns true if this vector contains the specified element.
publicsynchronized boolean containsAll (Collection<Object> c) [Inherited From Vector]
  Returns true if this Vector contains all of the elements in the specified Collection.
publicsynchronized void copyInto (Object anArray) [Inherited From Vector]
  Copies the components of this vector into the specified array.
publicsynchronized E elementAt (int index) [Inherited From Vector]
  Returns the component at the specified index.
public Enumeration< E> elements () [Inherited From Vector]
  Returns an enumeration of the components of this vector.
public boolean empty ()
  Tests if this stack is empty.
publicsynchronized void ensureCapacity (int minCapacity) [Inherited From Vector]
  Increases the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.
publicsynchronized boolean equals (Object o) [Inherited From Vector]
  Compares the specified Object with this Vector for equality.
publicsynchronized E firstElement () [Inherited From Vector]
  Returns the first component (the item at index 0) of this vector.
publicsynchronized E get (int index) [Inherited From Vector] [Specified in AbstractList]
  Returns the element at the specified position in this Vector.
publicsynchronized int hashCode () [Inherited From Vector]
Returns the hash code value for this Vector.
public int indexOf (Object o) [Inherited From Vector]
  Returns the index of the first occurrence of the specified element in this vector, or -1 if this vector does not contain the element.
publicsynchronized int indexOf (Object o, int index) [Inherited From Vector]
  Returns the index of the first occurrence of the specified element in this vector, searching forwards from index, or returns -1 if the element is not found.
publicsynchronized void insertElementAt ( E obj, int index) [Inherited From Vector]
  Inserts the specified object as a component in this vector at the specified index.
publicsynchronized boolean isEmpty () [Inherited From Vector]
  Tests if this vector has no components.
public Iterator< E> iterator () [Inherited From AbstractList] [Specified in AbstractCollection]
  Returns an iterator over the elements in this list in proper sequence.
publicsynchronized E lastElement () [Inherited From Vector]
  Returns the last component of the vector.
publicsynchronized int lastIndexOf (Object o) [Inherited From Vector]
  Returns the index of the last occurrence of the specified element in this vector, or -1 if this vector does not contain the element.
publicsynchronized int lastIndexOf (Object o, int index) [Inherited From Vector]
  Returns the index of the last occurrence of the specified element in this vector, searching backwards from index, or returns -1 if the element is not found.
public ListIterator< E> listIterator () [Inherited From AbstractList]
  Returns a list iterator over the elements in this list (in proper sequence).
public ListIterator< E> listIterator (int index) [Inherited From AbstractList]
  Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.
publicsynchronized E peek ()
  Looks at the object at the top of this stack without removing it from the stack.
publicsynchronized E pop ()
  Removes the object at the top of this stack and returns that object as the value of this function.
public E push ( E item)
  Pushes an item onto the top of this stack.
publicsynchronized E remove (int index) [Inherited From Vector]
  Removes the element at the specified position in this Vector.
public boolean remove (Object o) [Inherited From Vector]
  Removes the first occurrence of the specified element in this Vector If the Vector does not contain the element, it is unchanged.
publicsynchronized boolean removeAll (Collection<Object> c) [Inherited From Vector]
  Removes from this Vector all of its elements that are contained in the specified Collection.
publicsynchronized void removeAllElements () [Inherited From Vector]
  Removes all components from this vector and sets its size to zero.
publicsynchronized boolean removeElement (Object obj) [Inherited From Vector]
  Removes the first (lowest-indexed) occurrence of the argument from this vector.
publicsynchronized void removeElementAt (int index) [Inherited From Vector]
  Deletes the component at the specified index.
protectedsynchronized void removeRange (int fromIndex, int toIndex) [Inherited From Vector]
  Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.
publicsynchronized boolean retainAll (Collection<Object> c) [Inherited From Vector]
  Retains only the elements in this Vector that are contained in the specified Collection.
publicsynchronized int search (Object o)
  Returns the 1-based position where an object is on this stack.
publicsynchronized E set (int index, E element) [Inherited From Vector]
  Replaces the element at the specified position in this Vector with the specified element.
publicsynchronized void setElementAt ( E obj, int index) [Inherited From Vector]
  Sets the component at the specified index of this vector to be the specified object.
publicsynchronized void setSize (int newSize) [Inherited From Vector]
  Sets the size of this vector.
publicsynchronized int size () [Inherited From Vector] [Specified in AbstractCollection]
  Returns the number of components in this vector.
publicsynchronized List< E> subList (int fromIndex, int toIndex) [Inherited From Vector]
  Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive.
publicsynchronized Object toArray () [Inherited From Vector]
  Returns an array containing all of the elements in this Vector in the correct order.
publicsynchronized T toArray ( T a) [Inherited From Vector]
  Returns an array containing all of the elements in this Vector in the correct order; the runtime type of the returned array is that of the specified array.
publicsynchronized String toString () [Inherited From Vector]
Returns a string representation of this Vector, containing the String representation of each element.
publicsynchronized void trimToSize () [Inherited From Vector]
  Trims the capacity of this vector to be the vector's current size.
Fields
Hide/Show inherited fields
protected int capacityIncrement [Inherited From Vector]
  The amount by which the capacity of the vector is automatically incremented when its size becomes greater than its capacity.
protected int elementCount [Inherited From Vector]
  The number of valid components in this Vector object.
protected Object elementData [Inherited From Vector]
  The array buffer into which the components of the vector are stored.
protectedtransient int modCount [Inherited From AbstractList]
  The number of times this list has been structurally modified.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar