Class SortByRankOption

java.lang.Object
javatro.manager.options.SortByRankOption
All Implemented Interfaces:
Option

public class SortByRankOption extends Object implements Option
Organizes card display using rank-based sorting (Ace high to Two low). Updates both the data model and display when executed.
  • Constructor Details

    • SortByRankOption

      public SortByRankOption(CardSelectScreen screen)
      Creates a rank sorting option for specified card screen.
      Parameters:
      screen - Card display interface to modify
      Throws:
      NullPointerException - if screen is null
  • Method Details

    • getDescription

      public String getDescription()
      Retrieves a description of the command. This method has a default implementation returning an empty string.
      Specified by:
      getDescription in interface Option
      Returns:
      Constant description "Sort cards by Rank"
    • execute

      public void execute() throws JavatroException
      Executes the command. Implementing classes must define specific behavior. Applies rank-based sorting and refreshes display.
      Specified by:
      execute in interface Option
      Throws:
      JavatroException - if display update fails