org.jfree.util
Class FastStack
- Cloneable, Serializable
extends java.lang.Object
implements Serializable, Cloneable
A very simple unsynchronized stack. This one is faster than the
java.util-Version.
FastStack() - Creates a new empty stack.
|
FastStack(int size) - Creates a new empty stack with the specified initial storage size.
|
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.
|
FastStack
public FastStack()
Creates a new empty stack.
FastStack
public FastStack(int size)
Creates a new empty stack with the specified initial storage size.
size
- the initial storage elements.
clear
public void clear()
Clears the stack.
clone
public Object clone()
Returns a clone of the stack.
get
public Object get(int index)
Returns the item at the specified slot in the stack.
isEmpty
public boolean isEmpty()
Returns true
if the stack is empty, and false
otherwise.
peek
public Object peek()
Returns the object at the top of the stack without removing it.
- The object at the top of the stack.
pop
public Object pop()
Removes and returns the object from the top of the stack.
push
public void push(Object o)
Pushes an object onto the stack.
size
public int size()
Returns the number of elements in the stack.