public class CommandHistory
extends java.lang.Object
Constructor and Description |
---|
CommandHistory(@NotNull java.lang.String ident)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addCommand(@NotNull java.lang.String command)
Adds a new command.
|
@Nullable java.lang.String |
down()
Returns the next command.
|
@Nullable java.lang.String |
last(int index)
Returns the last executed command.
|
@Nullable java.lang.String |
up()
Returns the previous command.
|
public CommandHistory(@NotNull @NotNull java.lang.String ident)
ident
- the identification string for backing up to filepublic void addCommand(@NotNull @NotNull java.lang.String command)
command
- the command to add@Nullable public @Nullable java.lang.String up()
null
if no previous command
exists@Nullable public @Nullable java.lang.String down()
null
if no previous command exists@Nullable public @Nullable java.lang.String last(int index)
index
- the index of the command; 0=last command, 1=second to last,
etc.null
if the index is invalid