public interface BoundedStack<E>
Modifier and Type | Method and Description |
---|---|
int |
capacity()
Reports the capacity of this bounded stack.
|
boolean |
isEmpty()
Reports whether the stack is currently empty without changing it.
|
E |
peek()
Reports the top element of the stack without changing it.
|
E |
pop()
Removes an element from the top of the stack and reports it.
|
void |
push(E x)
Pushes a new entry onto the stack.
|
void push(E x) throws StackFullException
x
- the object to be pushed onto the stackStackFullException
- if the Stack is already full
E peek()
java.util.NoSuchElementException
- if the stack is empty
E pop()
java.util.NoSuchElementException
- if the stack is already empty
boolean isEmpty()
int capacity()