|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.cmd.stack.QueuingStack
public class QueuingStack
CommandProcessorStack implementation that will queue commands that cannot be executed by the top entry. When a new command processor becomes the top entry, and saved commands are reprocessed. This implementation is also its own environment which theoretically should make it easier to provide custom root-level environment properties.
Constructor Summary | |
---|---|
QueuingStack()
Creates an empty command processor stack. |
Method Summary | |
---|---|
void |
clearQueue()
Clears the queue of commands waiting to be run. |
Result |
execute(Command cmd)
Executes the specified command using the top command processor in the stack if possible. |
int |
getQueueSize()
Returns the number of commands that are waiting for a command processor that can run them. |
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 QueuingStack()
Method Detail |
---|
public int getQueueSize()
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
public void clearQueue()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |