insensa.commands
Class CommandManager

java.lang.Object
  extended by insensa.commands.CommandManager

public class CommandManager
extends java.lang.Object


Field Summary
private  java.util.Stack<ModelCommand> commandStack
           
private  java.lang.Exception exception
           
private static CommandManager instance
           
static int STATUS_FAIL
           
static int STATUS_SUCCESS
           
private  java.util.Stack<ModelCommand> undoStack
           
 
Constructor Summary
private CommandManager()
           
 
Method Summary
 void addCommand(ModelCommand command)
          Adds the command to the beginning of the stack.
 void clearCommands()
           
 int executeCommands()
           
 java.lang.Exception getException()
           
static CommandManager getInstance()
           
 ModelCommand getLastCommand()
           
 void pushCommand(ModelCommand command)
          Adds the command to the end of the stack.
 int undoCommands()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static CommandManager instance

commandStack

private java.util.Stack<ModelCommand> commandStack

undoStack

private java.util.Stack<ModelCommand> undoStack

exception

private java.lang.Exception exception

STATUS_SUCCESS

public static final int STATUS_SUCCESS
See Also:
Constant Field Values

STATUS_FAIL

public static final int STATUS_FAIL
See Also:
Constant Field Values
Constructor Detail

CommandManager

private CommandManager()
Method Detail

getInstance

public static CommandManager getInstance()
Returns:

addCommand

public void addCommand(ModelCommand command)
Adds the command to the beginning of the stack.

Parameters:
command -

clearCommands

public void clearCommands()

executeCommands

public int executeCommands()
Returns:

getException

public java.lang.Exception getException()
Returns:

getLastCommand

public ModelCommand getLastCommand()
Returns:

pushCommand

public void pushCommand(ModelCommand command)
Adds the command to the end of the stack.

Parameters:
command -

undoCommands

public int undoCommands()
Returns: