|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pentaho.reporting.libraries.base.util.FastStack
public final class FastStack
A very simple unsynchronized stack. This one is faster than the java.util-Version, which is based on the synchronized java.util.Vector class.
| 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. |
java.lang.Object |
clone()
Creates a shallow copy of the stack. |
java.lang.Object |
get(int index)
Returns the element from the stack at the given index-position. |
boolean |
isEmpty()
Checks whether the stack is empty. |
java.lang.Object |
peek()
Loads the top-most element from the stack, without removing it from the stack. |
java.lang.Object |
pop()
Loads the top-most element from the stack and removes it from the stack at the same time. |
void |
push(java.lang.Object o)
Pushes a new object on the stack. |
int |
size()
Returns the number of elements in the stack. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FastStack()
public FastStack(int size)
size - the initial size and growth.| Method Detail |
|---|
public boolean isEmpty()
public int size()
public void push(java.lang.Object o)
o - the object, maybe null.public java.lang.Object peek()
java.util.EmptyStackException - if the stack is empty.public java.lang.Object pop()
java.util.EmptyStackException - if the stack is empty.public java.lang.Object clone()
clone in class java.lang.Objectpublic void clear()
public java.lang.Object get(int index)
index - the element's index.
java.lang.IndexOutOfBoundsException - if the index given is greater than the number of objects in the stack.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||