public final class ByteStack extends Object
| 构造器和说明 |
|---|
ByteStack()
Creates a new empty instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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()
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()
Copyright © 2022. All rights reserved.