Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## dataStructures
Class VectorStack

    java.lang.Object
      |
      +--java.util.AbstractCollection
            |
            +--java.util.AbstractList
                  |
                  +--java.util.Vector
                        |
                        +--dataStructures.VectorStack

public class VectorStack
extends java.util.Vector
implements Stack

See Also:
  Serialized Form

Fields inherited from class java.util.Vector
`capacityIncrement, elementCount, elementData`

Fields inherited from class java.util.AbstractList
`modCount`

Constructor Summary
`VectorStack()` create a stack with initial capacity 10
`VectorStack(int initialCapacity)` create a stack with the given initial capacity

Method Summary
`boolean` | `empty()`
`static void` | `main(java.lang.String[] args)` test program
`java.lang.Object` | `peek()`
`java.lang.Object` | `pop()` remove top element of stack and return it
`void` | `push(java.lang.Object theElement)` add theElement to the top of the stack

Methods inherited from class java.util.Vector
`add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize`

Methods inherited from class java.util.AbstractList
`iterator, listIterator, listIterator`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### VectorStack

    public VectorStack(int initialCapacity)

  create a stack with the given initial capacity

### VectorStack

    public VectorStack()

  create a stack with initial capacity 10

Method Detail

### empty

    public boolean empty()

  Specified by:
    empty in interface Stack
  Returns:
    true iff stack is empty

### peek

    public java.lang.Object peek()

  Specified by:
    peek in interface Stack
  Returns:
    top element of stack

### push

    public void push(java.lang.Object theElement)

  add theElement to the top of the stack
  Specified by:
    push in interface Stack

### pop

    public java.lang.Object pop()

  remove top element of stack and return it
  Specified by:
    pop in interface Stack

### main

    public static void main(java.lang.String[] args)

  test program

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD