public class UndoList
extends java.lang.Object
Constructor and Description |
---|
UndoList(int max)
Instantiates an UndoList object and initializes the maximum number of
entries
|
Modifier and Type | Method and Description |
---|---|
boolean |
addCommand(ICommand newCommand)
Adds the passed command to the list of commands.
|
ICommand |
getRedoCommand()
Moves the pointer for the next undo command to the next in the list and
returns it
|
ICommand |
getUndoCommand()
Returns the command at the undo position and moves the pointer for the
next undo command to the previous command
|
int |
size() |
public UndoList(int max)
max
- Maximum number of entriespublic boolean addCommand(ICommand newCommand)
newCommand
- the command to addpublic ICommand getUndoCommand()
public ICommand getRedoCommand()
public int size()