|
TPTP 4.2.0 Platform Project Public API Specification |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.hyades.collection.correlation.Stack
This class offers a simple and efficient implementation of a thread-safe, growable stack.
| Field Summary | |
|---|---|
protected int |
increment
The size by which the stack grows if more space is required. |
java.lang.Object |
privateStorage
Any private storage that may be necessary for this class. |
protected java.lang.Object[] |
stack
The stack of objects. |
protected int |
top
The top-most item on the stack. |
| Constructor Summary | |
|---|---|
Stack(int size,
int increment)
Creates an empty stack of size with an increment for holding Objects. |
|
| Method Summary | |
|---|---|
java.lang.Object |
peek()
Peeks at the top-most item on the stack, or returns null if the stack is empty. |
java.lang.Object |
peek(int offset)
Peeks at the offsetth item from the top of the stack, with the top-most item being 0. |
java.lang.Object |
pop()
Pops the top-most item off the stack, or null if the stack if empty. |
void |
push(java.lang.Object item)
Pushes an item onto the stack. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.Object[] stack
protected int top
protected int increment
public java.lang.Object privateStorage
| Constructor Detail |
public Stack(int size,
int increment)
size with an increment for holding Objects.
size - the initial size of the stackincrement - the size by which the stack grows if its current capacity is insufficient| Method Detail |
public java.lang.Object peek()
null if the stack is empty.
null if the stack is empty.public java.lang.Object peek(int offset)
offsetth item from the top of the stack, with the top-most item being 0.
offset - any non-negative value indicating the desired item on the stack
offsetth item from the top of the stack, or null if the offset
is out of range.public void push(java.lang.Object item)
increment, after which the item is pushed onto the new stack.
item - the object to be pushed onto the stackpublic java.lang.Object pop()
null if the stack if empty.
null if the stack is empty.
|
TPTP 4.2.0 Platform Project Public API Specification |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||