public final class ByteStack
extends java.lang.Object
| Constructor and Description |
|---|
ByteStack()
Creates a new empty instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isEmpty()
Returns
true if this stack is empty. |
int |
peek(int defaultValue)
Looks at the item at the top of this stack without removing it.
|
int |
poll(int defaultValue)
Removes the item at the top of this stack and returns that item.
|
byte |
pop()
Removes the item at the top of this stack and returns that item.
|
void |
push(byte item)
Pushes an item onto the top of this stack.
|
int |
size()
Returns the number of items in this stack.
|
public void push(byte item)
item - the item to pushpublic byte pop()
java.util.NoSuchElementException - if stack is emptypublic int poll(int defaultValue)
defaultValue - value to return if stack is emptypublic int peek(int defaultValue)
defaultValue - value to return if stack is emptypublic boolean isEmpty()
true if this stack is empty.true if this stack is emptypublic int size()