The SortModel class groups a set of
Sort objects. This class also provides a set of methods
for interacting with a group of
Sort objects.
The list of
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
SortDirection.ASCENDING , to
SortDirection.DESCENDING , and finally back to
SortDirection.NONE . The
SortStrategy allows this strategy to be changed so that the
sorts can change from
SortDirection.NONE to
SortDirection.DESCENDING , to
SortDirection.ASCENDING , and finally back to
SortDirection.NONE .
|