|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Stack
This class provides a stack that changes implementation dynamically. Initially, the implementation is an array of integers. If, during the execution of a client, the stack overflows, the array implementation is replaced by a linked list implementation.
Field Summary | |
private StackImpl |
stack
|
Constructor Summary | |
Stack()
|
Method Summary | |
private void |
copy(StackImpl from,
StackImpl to)
|
(package private) int |
pop()
Pop the stack. |
void |
push(int val)
Push an integer onto the stack. |
(package private) int |
size()
Return the number of elements contained in the stack. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private StackImpl stack
Constructor Detail |
public Stack()
Method Detail |
public void push(int val)
val
- The integer value pushed onto the stack.int pop()
int size()
private void copy(StackImpl from, StackImpl to)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |