站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.4 API 英文版文档

Stack - JBOSS Portal 2.4 API 英文版文档


org.jboss.portal.format.util
Class Stack

java.lang.Object
  extended byorg.jboss.portal.format.util.Stack

public abstract class Stack
extends java.lang.Object

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

ptr

protected int ptr
The stack pointer which always points the first available element.


stack

protected Stack.Key[] stack
The stack holder.

Constructor Detail

Stack

public Stack(int initalCapacity)
Create a new stack with a specified depth.

Method Detail

reset

public final void reset()
Reset the stack state.


push

public final Stack.Key push()
Push a key on the stack.


peek

public Stack.Key peek(int level)
Peek a key on the stack.


pop

public final java.util.Iterator pop(Stack.Key candidate)
Pop keys until it finds the good one.


createKey

protected abstract Stack.Key createKey()
The implementation must provide a reusable key.


equals

protected abstract boolean equals(Stack.Key key1,
                                  Stack.Key key2)
The implementation must test keys equality.


enlarge

protected void enlarge()
Enlarge the key stack. For now it simply add 3 keys to the actual length


toString

public java.lang.String toString()