The SortModel class groups a set of {@link Sort} objects. This class also provides a set of methodsfor interacting with a group of {@link Sort} objects.
The list of {@link Sort} objects in a SortModel are ordered. The first sort in group is known as the"primary" sort and subsequent Sorts are "secondary". The interpretation of using Sorts into to order a data set is left to implementations of sort algoritms. For example, one possible sort implementation could order the sorts such that the secondary sort occurs inside the data ordered by the primary sort and so on.
In addition to accessing the Sort objects, the SortModel provides a the ability to plug a simple state machine that controls how to change a sort direction when cycling through the set of sort directions. For example, when using a data grid to sort columns of data, a column may start off unsorted, change to {@link SortDirection#ASCENDING}, to {@link SortDirection#DESCENDING}, and finally back to {@link SortDirection#NONE}. The {@link SortStrategy} allows this strategy to be changed so that thesorts can change from {@link SortDirection#NONE} to {@link SortDirection#DESCENDING}, to {@link SortDirection#ASCENDING}, and finally back to {@link SortDirection#NONE}.
|
|
|
|
|
|