|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.gmbal.generic.MarkStack<E>
public final class MarkStack<E>
A stack with additional operations that support recording the current top of stack as a mark, and then later popping all items pushed since the last mark call.
| Constructor Summary | |
|---|---|
MarkStack()
|
|
| Method Summary | |
|---|---|
boolean |
isEmpty()
Return true iff the stack is empty. |
void |
mark()
Record the current position in the stack for a subsequent popMark call. |
E |
peek()
Return the top element of the stack. |
E |
pop()
Return the top element of the stack and remove it from the stack. |
List<E> |
popMark()
Return an ordered list of stack elements starting with the element that was on top of the stack when mark was called. |
E |
push(E elem)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MarkStack()
| Method Detail |
|---|
public E push(E elem)
public E pop()
EmptyStackException - is thrown if the stack is empty.
IllegalStateException - if an attempt is made to pop
past the top mark.public boolean isEmpty()
public E peek()
EmptyStackException - is thrown if the stack is empty.public void mark()
public List<E> popMark()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||