public final class FastStack extends Object implements Serializable, Cloneable
Constructor and Description |
---|
FastStack()
Creates a new empty stack.
|
FastStack(int size)
Creates a new empty stack with the specified initial storage size.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the stack.
|
Object |
clone()
Returns a clone of the stack.
|
Object |
get(int index)
Returns the item at the specified slot in the stack.
|
boolean |
isEmpty()
Returns
true if the stack is empty, and false
otherwise. |
Object |
peek()
Returns the object at the top of the stack without removing it.
|
Object |
pop()
Removes and returns the object from the top of the stack.
|
void |
push(Object o)
Pushes an object onto the stack.
|
int |
size()
Returns the number of elements in the stack.
|
public FastStack()
public FastStack(int size)
size
- the initial storage elements.public boolean isEmpty()
true
if the stack is empty, and false
otherwise.public int size()
public void push(Object o)
o
- the object.public Object peek()
public Object pop()
public Object clone()
public void clear()
public Object get(int index)
index
- the index.Copyright © 2001–2018 JFree.org. All rights reserved.