Code example for Stack

Methods: removeAllElements

0
        command.execute();
        executedCommands.push( command );
    } 
 
  public void execute( Command command ) {
        unexecutedCommands.removeAllElements();
        _execute( command );
    } 
 
  public void unexecute() { 
        Command command = (Command)executedCommands.pop();
        command.unexecute();
        unexecutedCommands.push( command );
    } 
 
  public void reexecute() { 
        Command command = (Command)unexecutedCommands.pop();
        _execute( command );
    } 
 
  public void reset() {