public final class CommandHistoryObj extends java.lang.Object implements CommandHistory
Constructor and Description |
---|
CommandHistoryObj() |
Modifier and Type | Method and Description |
---|---|
void |
add(Command cmd)
Add command
undoable and clear redoable . |
boolean |
redo()
Pop command from
redoable , redo it, then push it
onto undoable . |
boolean |
undo()
Pop command from
undoable , undo it, then push it
onto redoable . |
public CommandHistoryObj()
public void add(Command cmd)
CommandHistory
undoable
and clear redoable
.add
in interface CommandHistory
cmd
- the command to be run.public boolean undo()
CommandHistory
undoable
, undo it, then push it
onto redoable
.undo
in interface CommandHistory
public boolean redo()
CommandHistory
redoable
, redo it, then push it
onto undoable
.redo
in interface CommandHistory