stack
Class StackInt

java.lang.Object
  extended by stack.StackInt

public class StackInt
extends java.lang.Object


Constructor Summary
StackInt()
          Creates an empty Stack of max 10 ints.
StackInt(int n)
          Creates an empty Stack of max N ints.
 
Method Summary
 boolean empty()
          Tests if this stack is empty.
 int howMany()
          Returns the number of elements inside the Stack.
 int peek()
          Looks at the object at the top of this stack without removing it from the stack.
 int pop()
          Removes the object at the top of this stack and returns that object as the value of this function.
 int push(int item)
          Pushes an item onto the top of this stack.
 int search(int o)
          Returns the 1-based position where an object is on this stack.
 java.lang.String toString()
          Return a String representation of the Stack and its content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StackInt

public StackInt()
Creates an empty Stack of max 10 ints.


StackInt

public StackInt(int n)
Creates an empty Stack of max N ints.

Method Detail

empty

public boolean empty()
Tests if this stack is empty.


peek

public int peek()
Looks at the object at the top of this stack without removing it from the stack.


pop

public int pop()
Removes the object at the top of this stack and returns that object as the value of this function.


push

public int push(int item)
Pushes an item onto the top of this stack.


search

public int search(int o)
Returns the 1-based position where an object is on this stack.


howMany

public int howMany()
Returns the number of elements inside the Stack.


toString

public java.lang.String toString()
Return a String representation of the Stack and its content.

Overrides:
toString in class java.lang.Object