T - The type of things stored in the stackpublic interface Stack<T>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
Remmove all elements from the stack
|
int |
depth()
How many elements are currently on the stack?
|
<X> X |
findCurrentFirst(Function<T,X> action)
Find an element on the stack and return a value.
|
T |
getCurrent()
The element currently at the top of the stack
|
T |
getPrevious()
The element previously at the top of the stack before the current one
|
boolean |
isEmpty()
Are there no elements currently in the stack?
|
T |
pop()
Pop (remove and return) the current element off the stack
|
void |
push(T newCurrent)
Push the new element on the top of the stack
|
void |
visitCurrentFirst(Consumer<T> action)
Visit all elements in the stack, starting with the current and working back
|
void push(T newCurrent)
T pop()
T getCurrent()
T getPrevious()
int depth()
boolean isEmpty()
void clear()
void visitCurrentFirst(Consumer<T> action)
Copyright © 2020. All rights reserved.