Class CommandHistory
- java.lang.Object
-
- com.realtime.crossfire.jxclient.settings.CommandHistory
-
public class CommandHistory extends java.lang.ObjectManages a list of previously entered commands.
-
-
Constructor Summary
Constructors Constructor Description CommandHistory(@NotNull java.lang.String ident)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCommand(@NotNull java.lang.String command)Adds a new command.@Nullable java.lang.Stringdown()Returns the next command.@Nullable java.lang.CharSequencelast(int index)Returns the last executed command.@Nullable java.lang.Stringup()Returns the previous command.
-
-
-
Method Detail
-
addCommand
public void addCommand(@NotNull @NotNull java.lang.String command)Adds a new command.- Parameters:
command- the command to add
-
up
@Nullable public @Nullable java.lang.String up()
Returns the previous command.- Returns:
- the previous command or
nullif no previous command exists
-
down
@Nullable public @Nullable java.lang.String down()
Returns the next command.- Returns:
- the next command or
nullif no previous command exists
-
last
@Nullable public @Nullable java.lang.CharSequence last(int index)
Returns the last executed command.- Parameters:
index- the index of the command; 0=last command, 1=second to last, etc.- Returns:
- the last executed command or
nullif the index is invalid
-
-