public interface CommandHistory
Logically, the functionality is described in terms of two stacks:
undoable and redoable, both initially empty.
| 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. |