|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.marringtons.number.IntegerStack
This is an implement a stack for integer primatives.
stack = new IntegerStack(); stack.push( 1); stack.isEmpty() == false; stack.size() == 1; stack.push( 2); stack.peek() == 2; stack.pop() == 2; stack.peek() == 1; stack.clear(); stack.isEmpty() == true; int[] stackArray = stack.getStack();
| Constructor Summary | |
IntegerStack()
|
|
| Method Summary | |
void |
clear()
Empty stack - releasing all references. |
boolean |
isEmpty()
Check to see if the stack has entries. |
int |
peek()
Return the string on the top of the stack (without changint the stack pointer). |
int |
pop()
Pop a string from the stack. |
void |
push(int item)
Push a string onto the stack (enlarging it if necessary). |
int |
size()
Find out how many entries are on the stack. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public IntegerStack()
| Method Detail |
public void push(int item)
item - to pushpublic int pop()
public int peek()
public int size()
public boolean isEmpty()
public void clear()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||