Class CommandHistory

java.lang.Object
com.realtime.crossfire.jxclient.settings.CommandHistory

public class CommandHistory extends Object
Manages a list of previously entered commands.
  • Constructor Details

    • CommandHistory

      public CommandHistory(@NotNull @NotNull String ident)
      Creates a new instance.
      Parameters:
      ident - the identification string for backing up to file
  • Method Details

    • addCommand

      public void addCommand(@NotNull @NotNull String command)
      Adds a new command.
      Parameters:
      command - the command to add
    • up

      @Nullable public @Nullable String up()
      Returns the previous command.
      Returns:
      the previous command or null if no previous command exists
    • down

      @Nullable public @Nullable String down()
      Returns the next command.
      Returns:
      the next command or null if no previous command exists
    • last

      @Nullable public @Nullable String 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 null if the index is invalid