Class StandardStack<T>
- java.lang.Object
-
- org.hibernate.internal.util.collections.StandardStack<T>
-
-
Constructor Summary
Constructors Constructor Description StandardStack()
StandardStack(T initial)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Remove all elements from the stackint
depth()
How many elements are currently on the stack?<X> X
findCurrentFirst(Function<T,X> function)
Find an element on the stack and return a value.T
getCurrent()
The element currently at the top of the stackboolean
isEmpty()
Are there no elements currently in the stack?T
pop()
Pop (remove and return) the current element off the stackvoid
push(T newCurrent)
Push the new element on the top of the stackvoid
visitRootFirst(Consumer<T> action)
Visit all elements in the stack, starting with the root and working "forward"
-
-
-
Constructor Detail
-
StandardStack
public StandardStack()
-
StandardStack
public StandardStack(T initial)
-
-
Method Detail
-
push
public void push(T newCurrent)
Description copied from interface:Stack
Push the new element on the top of the stack
-
pop
public T pop()
Description copied from interface:Stack
Pop (remove and return) the current element off the stack
-
getCurrent
public T getCurrent()
Description copied from interface:Stack
The element currently at the top of the stack- Specified by:
getCurrent
in interfaceStack<T>
-
depth
public int depth()
Description copied from interface:Stack
How many elements are currently on the stack?
-
isEmpty
public boolean isEmpty()
Description copied from interface:Stack
Are there no elements currently in the stack?
-
clear
public void clear()
Description copied from interface:Stack
Remove all elements from the stack
-
visitRootFirst
public void visitRootFirst(Consumer<T> action)
Description copied from interface:Stack
Visit all elements in the stack, starting with the root and working "forward"- Specified by:
visitRootFirst
in interfaceStack<T>
-
findCurrentFirst
public <X> X findCurrentFirst(Function<T,X> function)
Description copied from interface:Stack
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- Specified by:
findCurrentFirst
in interfaceStack<T>
-
-