Class SortBySuitOption

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

public class SortBySuitOption extends Object implements Option
Organizes card display using suit-based sorting (Spades, Hearts, Clubs, Diamonds). Updates both the data model and display when executed.
  • Constructor Details

    • SortBySuitOption

      public SortBySuitOption(CardSelectScreen screen)
      Creates a suit 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 Suit"
    • execute

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