|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--DynamicStack
DynamicStacks of ints can store a potentially unbounded # of integers.
| Field Summary | |
protected int |
curSize
|
protected int |
nFree
|
| Constructor Summary | |
DynamicStack()
Default constructor with initial stack size set to defaultInitialSize |
|
DynamicStack(int initSize)
Constructor. |
|
| Method Summary | |
int |
pop()
Pops the topmost item from the stack. |
void |
push(int item)
Should never overflow unless you need to buy more memory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int curSize
protected int nFree
| Constructor Detail |
public DynamicStack(int initSize)
initSize - specifies how big the initial stack should bepublic DynamicStack()
| Method Detail |
public void push(int item)
push in interface IntStackitem - the thing to be pushedpublic int pop()
IntStack
pop in interface IntStack
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||