|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.java.util.collections.AbstractCollection | +--com.sun.java.util.collections.AbstractList | +--com.sun.java.util.collections.ArrayList | +--com.imaginary.util.LifoStack
An unsynchronized LIFO stack. This class provides easy access to pushing
and popping objects to and from a stack where the rule is that the last
object in is the first object out. As with most Java collections, this
class is wholly unsynchronized.
Last modified $Date: 1999/11/06 19:50:52 $
Fields inherited from class com.sun.java.util.collections.AbstractList |
modCount |
Constructor Summary | |
LifoStack()
Constructs an empty LIFO stack. |
Method Summary | |
java.lang.Object |
peek()
Provides a look at the last object placed on the stack, since it will be the first one out. |
java.lang.Object |
pop()
Pops the last object placed on the stack off of it and returns it. |
java.lang.Object |
push(java.lang.Object ob)
Pushes a new object onto the stack. |
int |
search(java.lang.Object ob)
Searches the stack for the specified object. |
Methods inherited from class com.sun.java.util.collections.ArrayList |
add,
add,
addAll,
addAll,
clear,
clone,
contains,
ensureCapacity,
get,
indexOf,
isEmpty,
lastIndexOf,
remove,
removeRange,
set,
size,
toArray,
toArray,
trimToSize |
Methods inherited from class com.sun.java.util.collections.AbstractList |
equals,
hashCode,
iterator,
listIterator,
listIterator,
subList |
Methods inherited from class com.sun.java.util.collections.AbstractCollection |
containsAll,
remove,
removeAll,
retainAll,
toString |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public LifoStack()
Method Detail |
public java.lang.Object peek()
peek()
followed by a pop()
returns the
same value.public java.lang.Object pop()
public java.lang.Object push(java.lang.Object ob)
ob
- the new objectpublic int search(java.lang.Object ob)
ob
- the object being sought
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |