| Modifier and Type | Field and Description |
|---|---|
| private T[] | |
| private int | |
| private Class |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Implements org. |
| public int | depth()
Implements org. |
| public <X> X | findCurrentFirst(Function<T, X> function)
Implements org. |
| public <X, Y> X | findCurrentFirstWithParameter(Y
a parameter to be passed to the (bi)funtion parameter, BiFunction<T, Y, X> a (bi)function taking as input parameter Y and each of the T
from the current stack, and return type of X. biFunction)Implements org. |
| public T | getCurrent()
Implements org. |
| public T | getRoot()
Implements org. |
| private void | |
| private void | |
| public boolean | isEmpty()
Implements org. |
| public T | peek(int offsetFromTop)
Implements org. |
| public T | pop()
Implements org. |
| public void | push(T e)
Implements org. |
| public void | visitRootFirst(Consumer<T> action)
Implements org. |
| elements | back to summary |
|---|---|
| private T[] elements | |
| top | back to summary |
|---|---|
| private int top | |
| type | back to summary |
|---|---|
| private Class<T> type | |
| StandardStack | back to summary |
|---|---|
| public StandardStack(Class<T> type) | |
| StandardStack | back to summary |
|---|---|
| public StandardStack(Class<T> type, T initial) | |
| clear | back to summary |
|---|---|
| public void clear() Implements org. Doc from org. Remove all elements from the stack
| |
| depth | back to summary |
|---|---|
| public int depth() Implements org. Doc from org. How many elements are currently on the stack?
| |
| findCurrentFirst | back to summary |
|---|---|
| public <X> X findCurrentFirst(Function<T, X> function) Implements org. Doc from org. Find an element on the stack and return a value. The first non-null element returned from `action` stops the iteration and is returned from here
| |
| findCurrentFirstWithParameter | back to summary |
|---|---|
| public <X, Y> X findCurrentFirstWithParameter(Y parameter, BiFunction<T, Y, X> biFunction) Implements org. Doc from org. Runs a function on each couple defined as {Y,T} in which Y is fixed, and T is each instance of this stack. Not all Ts might be presented as the iteration is interrupted as soon as the first non-null value is returned by the (bi)function, which is then returned from this function.
| |
| getCurrent | back to summary |
|---|---|
| public T getCurrent() Implements org. Doc from org. The element currently at the top of the stack
| |
| getRoot | back to summary |
|---|---|
| public T getRoot() Implements org. Doc from org. The element currently at the bottom of the stack
| |
| grow | back to summary |
|---|---|
| private void grow() | |
| init | back to summary |
|---|---|
private void init()
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements org. Doc from org. Are there no elements currently in the stack?
| |
| peek | back to summary |
|---|---|
| public T peek(int offsetFromTop) Implements org. Doc from org. The element at the given offset, relative to the top of the stack
| |
| pop | back to summary |
|---|---|
| public T pop() Implements org. Doc from org. Pop (remove and return) the current element off the stack
| |
| push | back to summary |
|---|---|
| public void push(T e) Implements org. Doc from org. Push the new element on the top of the stack
| |
| visitRootFirst | back to summary |
|---|---|
| public void visitRootFirst(Consumer<T> action) Implements org. Doc from org. Visit all elements in the stack, starting with the root and working "forward"
| |