public interface PureStack<E>
| Modifier and Type | Method and Description |
|---|---|
boolean |
isEmpty()
Determines if this PureStack object has no elements.
|
E |
peek()
Returns the top element on this PureStack object.
|
E |
pop()
Removes the top element from this PureStack object.
|
void |
push(E element)
Inserts a specified element on the top of this PureStack object.
|
int |
size()
Determines the number of elements in this PureStack object.
|
int size()
boolean isEmpty()
void push(E element)
element - - the element to be pushed.E pop()
NoSuchElementException - - if this PureStack object is empty.E peek()
NoSuchElementException - - if this PureStack object is empty.