Constructor and Description |
---|
Stack() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(T element)
Returns true if the stack contains element, false otherwise.
|
static <T> Stack<T> |
create()
Creates a new Stack for type
T . |
boolean |
isEmpty()
Returns true if the stack is empty false otherwise.
|
Iterator<T> |
iterator() |
T |
peek()
Returns the top of the stack.
|
T |
pop()
Returns the top of the stack and removes it.
|
List<T> |
pop(int count)
Pops
count elements from the stack and returns them as a list with to top of the stack
last. |
void |
push(T value) |
int |
size()
Returns the number of elements in the stack (including pushed nulls).
|
public int size()
public boolean contains(T element)
public boolean isEmpty()
public T peek()
public T pop()
public List<T> pop(int count)
count
elements from the stack and returns them as a list with to top of the stack
last.public void push(T value)
public static <T> Stack<T> create()
T
.Copyright © 2018. All rights reserved.