|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object stack.StackInt
public class StackInt
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 |
---|
public StackInt()
public StackInt(int n)
Method Detail |
---|
public boolean empty()
public int peek()
public int pop()
public int push(int item)
public int search(int o)
public int howMany()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |