|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.gjt.rec.util.ListStack
A implementation of the Stack interface that uses a list to
store its elements.
Stack,
List| Field Summary | |
static String |
REVISION
|
| Constructor Summary | |
ListStack()
Constructs a new ListStack that will use the default list type. |
|
ListStack(List list)
Constructs a new ListStack with a particular List. |
|
| Method Summary | |
void |
clear()
Removes all elements from this stack, making it empty. |
boolean |
isEmpty()
|
Object |
pop()
Removes the element on the top of this stack. |
void |
push(Object element)
Pushes a particular element on to the top of this stack. |
int |
size()
|
Object |
top()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String REVISION
| Constructor Detail |
public ListStack()
public ListStack(List list)
list - the list to use to store the elements for
this stack.
NullPointerException - if the argument supplied for the list is
null.| Method Detail |
public int size()
size in interface Stackpublic boolean isEmpty()
isEmpty in interface Stackpublic Object top()
top in interface Stackpublic void push(Object element)
Stack
push in interface Stackelement - the element to push on to the top of this stack.public Object pop()
Stack
pop in interface Stackpublic void clear()
Stack
clear in interface Stack
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||