org.pentaho.reporting.libraries.base.util
public final class FastStack extends Object implements Serializable, Cloneable
| Constructor Summary | |
|---|---|
| FastStack()
Creates a new stack with an initial size and growth of 10 items. | |
| FastStack(int size)
Creates a new stack with an initial size and growth as specified.
| |
| Method Summary | |
|---|---|
| void | clear()
Removes all contents from the stack. |
| Object | clone()
Creates a shallow copy of the stack.
|
| Object | get(int index)
Returns the element from the stack at the given index-position.
|
| boolean | isEmpty()
Checks whether the stack is empty. |
| Object | peek()
Loads the top-most element from the stack, without removing it from the stack.
|
| Object | pop()
Loads the top-most element from the stack and removes it from the stack at the same time.
|
| void | push(Object o)
Pushes a new object on the stack. |
| int | size()
Returns the number of elements in the stack.
|
Parameters: size the initial size and growth.
Returns: the cloned stack.
Parameters: index the element's index.
Returns: the object.
Throws: IndexOutOfBoundsException if the index given is greater than the number of objects in the stack.
Returns: true, if the stack is empty, false otherwise.
Returns: the top-most object.
Throws: EmptyStackException if the stack is empty.
Returns: the top-most object.
Throws: EmptyStackException if the stack is empty.
Parameters: o the object, maybe null.
Returns: the stack size.