|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--FixedStack
This class implements interface StackImpl with a stack represented by an array. Obviously, the stack has a fixed size and may overflow.
Field Summary | |
private int[] |
data
|
private int |
pnt
|
private int |
size
|
Constructor Summary | |
FixedStack()
|
Method Summary | |
int |
pop()
Pop the stack. |
void |
push(int val)
Push an integer onto the stack. |
int |
size()
Return the number of elements contained in the stack. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private final int size
private int[] data
private int pnt
Constructor Detail |
public FixedStack()
Method Detail |
public void push(int val)
val
- The integer value pushed onto the stack.public int pop()
public int size()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |