com.tonbeller.jpivot.tags
Class StackStateManager

java.lang.Object
  extended by com.tonbeller.jpivot.tags.StackStateManager
All Implemented Interfaces:
StateManager

public class StackStateManager
extends java.lang.Object
implements StateManager

A Stack of states (name/value pairs). For every state name, there is only one value. States with different names are stacked, every name is on the stack only once. Example:

 ps = new StackStateStrategy();
 -- a1 is top of stack:
 ps.setCurrent("A", a1);
 -- replace a1 with a2:
 ps.setCurrent("A", a2);
 -- push b1 on the stack
 ps.setCurrent("B", b1);
 -- stack now contains a2, b1
 -- push c1 on the stack
 ps.setCurrent("C", c1);
 -- pop c1 and b1 and make a3 top of stack
 ps.setCurrent("A", a3);
 -- stack contains a3 only
 

Since:
15.02.2005
Author:
av

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.tonbeller.jpivot.tags.StateManager
StateManager.State
 
Constructor Summary
StackStateManager()
           
 
Method Summary
 void destroyAll()
          removes all states
 void destroyByName(java.lang.String name)
          pops and destroys all states up to and including the named one.
 StateLogger getLogger()
           
 void initializeAndShow(StateManager.State s)
          removes all properties from the stack
 void setLogger(StateLogger logger)
          logger for debug/test
 void showByName(java.lang.String name)
          pops and destroys all states up to but not including the named one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackStateManager

public StackStateManager()
Method Detail

initializeAndShow

public void initializeAndShow(StateManager.State s)
                       throws java.lang.Exception
removes all properties from the stack

Specified by:
initializeAndShow in interface StateManager
Throws:
java.lang.Exception

showByName

public void showByName(java.lang.String name)
                throws java.lang.Exception
pops and destroys all states up to but not including the named one. The named state will become the visible one.

Specified by:
showByName in interface StateManager
Throws:
java.lang.Exception
See Also:
destroyByName(java.lang.String)

destroyAll

public void destroyAll()
                throws java.lang.Exception
Description copied from interface: StateManager
removes all states

Specified by:
destroyAll in interface StateManager
Throws:
java.lang.Exception

destroyByName

public void destroyByName(java.lang.String name)
                   throws java.lang.Exception
pops and destroys all states up to and including the named one. If there is another state beneath the named one, that will become the visible one.

Specified by:
destroyByName in interface StateManager
Throws:
java.lang.Exception
See Also:
showByName(java.lang.String)

getLogger

public StateLogger getLogger()
Specified by:
getLogger in interface StateManager

setLogger

public void setLogger(StateLogger logger)
Description copied from interface: StateManager
logger for debug/test

Specified by:
setLogger in interface StateManager