|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.util.swing.DefaultRowComparator
This class is to be used with JCRowSortModel
. It sorts rows by the
list of columns specified. By default it only sorts on the first column
Field Summary | |
static int |
FORWARD
Valid value for SortOrder |
protected int[] |
keyColumns
|
protected int |
order
|
static int |
REVERSE
Valid value for SortOrder |
Constructor Summary | |
DefaultRowComparator(int order)
Creates a JCRowComparator that sorts columns by the natural
order of the values in the first column. |
|
DefaultRowComparator(int order,
int[] keyColumns)
Creates a JCRowComparator that sorts columns according with
the list of columns specified. |
Method Summary | |
int |
compare(com.klg.jclass.util.swing.JCComparableRow row1,
com.klg.jclass.util.swing.JCComparableRow row2)
Compares its two arguments for order. |
int[] |
getKeyColumns()
Gets a list of columns by which to sort. |
int |
getSortOrder()
Gets a sorting order. |
void |
setKeyColumns(int[] keyColumns)
Sets a list of columns by which to sort. |
void |
setSortOrder(int order)
Sets a sorting order. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FORWARD
public static final int REVERSE
protected int order
protected int[] keyColumns
Constructor Detail |
public DefaultRowComparator(int order)
JCRowComparator
that sorts columns by the natural
order of the values in the first column.
order
- The sort order (FORWARD or REVERSE)public DefaultRowComparator(int order, int[] keyColumns)
JCRowComparator
that sorts columns according with
the list of columns specified.
order
- The sort order (FORWARD or REVERSE)keyColumns
- A list of columns by which to sortMethod Detail |
public void setKeyColumns(int[] keyColumns)
setKeyColumns
in interface JCRowComparator
keyColumns
- The new list of columns by which to sortpublic int[] getKeyColumns()
getKeyColumns
in interface JCRowComparator
public void setSortOrder(int order)
setSortOrder
in interface JCRowComparator
order
- The new sort order (FORWARD or REVERSE)public int getSortOrder()
getSortOrder
in interface JCRowComparator
public int compare(com.klg.jclass.util.swing.JCComparableRow row1, com.klg.jclass.util.swing.JCComparableRow row2)
compare
in interface JCRowComparator
row1
- The row of the first argument in the comparerow2
- The row of the second argument in the compare
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |