|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--VectorStackSolution
IStack implementation using a Java Vector to hold its elements.
Field Summary | |
protected Vector |
elements
Vector used to hold the elements on this. |
Constructor Summary | |
VectorStackSolution()
Constructs a new Java stack. |
Method Summary | |
boolean |
isEmpty()
Returns whether or not this is empty. |
Object |
pop()
Removes and returns the top object on this. |
void |
push(Object anObject)
Pushes the given object onto this. |
int |
size()
Returns the number of objects on this. |
Object |
top()
Returns the top object on this. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Vector elements
Constructor Detail |
public VectorStackSolution()
Method Detail |
public void push(Object anObject)
push
in interface IStack
anObject
- object to pushpublic Object pop()
pop
in interface IStack
public Object top()
top
in interface IStack
public int size()
size
in interface IStack
public boolean isEmpty()
isEmpty
in interface IStack
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |