| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public void | |
| public E | |
| public E | |
| public List | popMark()
Return an ordered list of stack elements starting with the element that was on top of the stack when mark was called. |
| public E |
| items | back to summary |
|---|---|
| private List<E> items | |
| marks | back to summary |
|---|---|
| private List<Integer> marks | |
| MarkStack | back to summary |
|---|---|
| public MarkStack() | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Return true iff the stack is empty. | |
| mark | back to summary |
|---|---|
| public void mark() Record the current position in the stack for a subsequent popMark call. This allow marking the start of a related group of items on the stack that can be popped together later by popMark. Multiple mark calls are supported. | |
| peek | back to summary |
|---|---|
| public E peek() Return the top element of the stack. Does not change the stack.
| |
| pop | back to summary |
|---|---|
| public E pop() Return the top element of the stack and remove it from the stack.
| |
| popMark | back to summary |
|---|---|
| public List Return an ordered list of stack elements starting with the element that was on top of the stack when mark was called. | |
| push | back to summary |
|---|---|
| public E push(E elem) | |