|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.portal.format.util.Stack
The goal of this class is to ensure that any event with open/close well formdness semantics are respected. This class maintain a stack of keys. To be operational this class must be subclassed to provide semantics that the user wants to give to the key identities.
Nested Class Summary | |
static interface |
Stack.Key
A key for the stack. |
class |
Stack.KeyIterator
Iterates over the poped keys. |
Field Summary | |
protected int |
ptr
The stack pointer which always points the first available element. |
protected Stack.Key[] |
stack
The stack holder. |
Constructor Summary | |
Stack(int initalCapacity)
Create a new stack with a specified depth. |
Method Summary | |
protected abstract Stack.Key |
createKey()
The implementation must provide a reusable key. |
protected void |
enlarge()
Enlarge the key stack. |
protected abstract boolean |
equals(Stack.Key key1,
Stack.Key key2)
The implementation must test keys equality. |
Stack.Key |
peek(int level)
Peek a key on the stack. |
java.util.Iterator |
pop(Stack.Key candidate)
Pop keys until it finds the good one. |
Stack.Key |
push()
Push a key on the stack. |
void |
reset()
Reset the stack state. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int ptr
protected Stack.Key[] stack
Constructor Detail |
public Stack(int initalCapacity)
Method Detail |
public final void reset()
public final Stack.Key push()
public Stack.Key peek(int level)
public final java.util.Iterator pop(Stack.Key candidate)
protected abstract Stack.Key createKey()
protected abstract boolean equals(Stack.Key key1, Stack.Key key2)
protected void enlarge()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |