1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.gui.table;
21
22 /***
23 * Defines the requirements for tables that can be sorted.
24 *
25 * @see TableHeaderHandler
26 */
27 public interface SortableModel
28 {
29
30 /***
31 * Returns the class of the data objects in column at
32 * <code>index</code>.
33 *
34 * @see TableHeaderHandler#sortByColumn(int)
35 */
36 Class getColumnClass(int index);
37
38 /***
39 * Returns the index of the column that was sorted last.
40 */
41 int getSortedColumn();
42
43 /***
44 * Returns true, if the table is sorted in ascending order.
45 */
46 boolean isSortedAscending();
47
48 /***
49 * Sets the maintain sort order flag.
50 */
51 void setMaintainSortOrder(boolean maintainSortOrder);
52
53 /***
54 * Sort the table by <code>column</code>.
55 *
56 * @param column the column to sort
57 * @param ascending true, if table needs to be sorted in ascending order;
58 * false, if in descending order
59 * @param revert automatically revert sort order
60 * @return true, if table was sorted ascending; false, if descending
61 */
62 boolean sortByColumn(int column, boolean ascending, boolean revert);
63
64 }