|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.cmd.stack.ForwardingStack
public class ForwardingStack
CommandProcessorStack implementation that will forward commands to the next entry in the stack if they cannot be run by the top entry. If no processors in the stack can handle the command then an exception is thrown. This implementation is also its own environment which theoretically should make it easier to provide custom root-level environment properties.
Constructor Summary | |
---|---|
ForwardingStack()
Creates an empty command processor stack. |
Method Summary | |
---|---|
Result |
execute(Command cmd)
Executes the specified command using the top command processor in the stack if possible. |
StackableCommandProcessor |
peekCommandProcessor()
Returns the current top command processor. |
StackableCommandProcessor |
popCommandProcessor()
Pops the current command processor. |
void |
pushCommandProcessor(StackableCommandProcessor cmdProc)
Pushes a new command processor onto the stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ForwardingStack()
Method Detail |
---|
public Result execute(Command cmd)
execute
in interface CommandProcessor
cmd
- The command to invoke.
public void pushCommandProcessor(StackableCommandProcessor cmdProc)
pushCommandProcessor
in interface CommandProcessorStack
public StackableCommandProcessor popCommandProcessor()
popCommandProcessor
in interface CommandProcessorStack
public StackableCommandProcessor peekCommandProcessor()
peekCommandProcessor
in interface CommandProcessorStack
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |