Package org.apache.calcite.util
Class Stacks
- java.lang.Object
-
- org.apache.calcite.util.Stacks
-
@Deprecated public class Stacks extends java.lang.Object
Deprecated.Utilities to make vanilla lists look like stacks.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Stacks()
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T> T
peek(int n, java.util.List<T> stack)
Deprecated.Returns then
th most recently added element in the stack.static <T> T
peek(java.util.List<T> stack)
Deprecated.Returns the most recently added element in the stack.static <T> T
pop(java.util.List<T> stack)
Deprecated.Removes an element from the stack and returns it.static <T> void
pop(java.util.List<T> stack, T element)
Deprecated.Removes an element from the stack.static <T> void
push(java.util.List<T> stack, T element)
Deprecated.Adds an element to the stack.
-
-
-
Method Detail
-
peek
public static <T> T peek(java.util.List<T> stack)
Deprecated.Returns the most recently added element in the stack. Throws if the stack is empty.
-
peek
public static <T> T peek(int n, java.util.List<T> stack)
Deprecated.Returns then
th most recently added element in the stack. Throws if the stack is empty.
-
push
public static <T> void push(java.util.List<T> stack, T element)
Deprecated.Adds an element to the stack.
-
pop
public static <T> void pop(java.util.List<T> stack, T element)
Deprecated.Removes an element from the stack. Asserts of the element is not the one last added; throws if the stack is empty.
-
pop
public static <T> T pop(java.util.List<T> stack)
Deprecated.Removes an element from the stack and returns it.Throws if the stack is empty.
-
-