public interface History extends java.lang.Iterable<Command>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
History.Listener
Listens to history changes.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAndExecute(Command command)
Appends the given command after the last executed one and execute it.
|
void |
addListener(History.Listener listener)
Appends a new listener to this history.
|
boolean |
contains(Command command)
Returns
true if this list contains the specified element. |
boolean |
executeNext()
Executes the next (most recently rolled back) command.
|
Command |
getNext()
Returns the next (most recently rolled back) command.
|
Command |
getPrevious()
Returns the previous (most recently executed) command.
|
boolean |
hasNext()
Returns
true if there is a next (most recently rolled back) command. |
boolean |
hasPrevious()
Returns
true if there is a previous (most recently executed) command. |
boolean |
isEmpty()
Returns
true if this history contains no commands. |
java.util.Iterator<Command> |
iterator()
Returns an iterator which iterates through the last executed path's commands.
|
boolean |
moveAfter(Command command)
Moves the internal pointer after the given command.
|
boolean |
moveBefore(Command command)
Moves the internal pointer before the given command.
|
boolean |
removeListener(History.Listener listener)
Removes a listener from this history.
|
boolean |
rollBackPrevious()
Rolls back the previous (most recently executed) command.
|
java.util.Iterator<Command> iterator()
iterator in interface java.lang.Iterable<Command>boolean isEmpty()
true if this history contains no commands.true if this history contains no commandsboolean contains(Command command)
true if this list contains the specified element.command - the command whose presence in this list is to be testedtrue if this history contains the specified commandboolean addAndExecute(Command command)
true if the command successfully executed and insertedboolean hasNext()
true if there is a next (most recently rolled back) command.true if there is a next commandCommand getNext()
boolean executeNext()
true if a next command is successfully executedboolean hasPrevious()
true if there is a previous (most recently executed) command.true if there is a previous commandCommand getPrevious()
boolean rollBackPrevious()
true if a previous command is successfully rolled backboolean moveBefore(Command command)
true if the command found and pointer successfully movedboolean moveAfter(Command command)
true if the command found and pointer successfully movedvoid addListener(History.Listener listener)
listener - the new listenerboolean removeListener(History.Listener listener)
true if the listener found and removed