Package javatro.manager.options
Class SortByRankOption
java.lang.Object
javatro.manager.options.SortByRankOption
- All Implemented Interfaces:
Option
Organizes card display using rank-based sorting (Ace high to Two low). Updates both the data
model and display when executed.
-
Constructor Summary
ConstructorsConstructorDescriptionSortByRankOption(CardSelectScreen screen) Creates a rank 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
-
SortByRankOption
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
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 Rank"
-
execute
Executes the command. Implementing classes must define specific behavior. Applies rank-based sorting and refreshes display.- Specified by:
executein interfaceOption- Throws:
JavatroException- if display update fails
-