@Deprecated public class Stacks extends Object
| Modifier | Constructor and Description |
|---|---|
private |
Stacks()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
peek(int n,
List<T> stack)
Deprecated.
Returns the
nth most recently added element in the stack. |
static <T> T |
peek(List<T> stack)
Deprecated.
Returns the most recently added element in the stack.
|
static <T> T |
pop(List<T> stack)
Deprecated.
Removes an element from the stack and returns it.
|
static <T> void |
pop(List<T> stack,
T element)
Deprecated.
Removes an element from the stack.
|
static <T> void |
push(List<T> stack,
T element)
Deprecated.
Adds an element to the stack.
|
public static <T> T peek(List<T> stack)
public static <T> T peek(int n,
List<T> stack)
nth most recently added element in the stack.
Throws if the stack is empty.public static <T> void push(List<T> stack, T element)
public static <T> void pop(List<T> stack, T element)
public static <T> T pop(List<T> stack)
Throws if the stack is empty.
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.