Package javatro.manager.options
Class SortBySuitOption
java.lang.Object
javatro.manager.options.SortBySuitOption
- All Implemented Interfaces:
Option
Organizes card display using suit-based sorting (Spades, Hearts, Clubs, Diamonds). Updates both
the data model and display when executed.
-
Constructor Summary
ConstructorsConstructorDescriptionSortBySuitOption(CardSelectScreen screen) Creates a suit sorting option for specified card screen. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Executes the command.Retrieves a description of the command.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javatro.manager.options.Option
setDescription
-
Constructor Details
-
SortBySuitOption
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
Retrieves a description of the command. This method has a default implementation returning an empty string.- Specified by:
getDescriptionin interfaceOption- Returns:
- Constant description "Sort cards by Suit"
-
execute
Executes the command. Implementing classes must define specific behavior. Applies suit-based sorting and refreshes display.- Specified by:
executein interfaceOption- Throws:
JavatroException- if display update fails
-