| 构造器和说明 |
|---|
SingletonStack(T instance) |
| 限定符和类型 | 方法和说明 |
|---|---|
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
|
public SingletonStack(T instance)
public T getCurrent()
StackgetCurrent 在接口中 Stack<T>public T getPrevious()
StackgetPrevious 在接口中 Stack<T>public int depth()
Stackpublic boolean isEmpty()
Stackpublic void clear()
Stackpublic void visitCurrentFirst(Consumer<T> action)
StackvisitCurrentFirst 在接口中 Stack<T>Copyright © 2020. All rights reserved.