|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.ds.ListComparator
public class ListComparator
Compare two lists. This class is used for sorting tables, where aech table row is a list.
| Constructor Summary | |
|---|---|
ListComparator(int[] sortcols)
Construct a list comparator with an array of sort columns. |
|
ListComparator(int column,
boolean ascending)
Construct a list comparator with a sort column and a boolean for sort direction. |
|
ListComparator(int column,
boolean ascending,
int column2,
boolean ascending2)
Construct a list comparator with two sort columns and booleans for sort direction. |
|
| Method Summary | |
|---|---|
int |
compare(List<Object> o1,
List<Object> o2)
Compare two lists. |
static int |
compareNumbers(Number n1,
Number n2)
Compares 2 Objects implementing Interface Number, even if they are different types |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Constructor Detail |
|---|
public ListComparator(int column,
boolean ascending)
column - sort columnascending - true if sort ascending
public ListComparator(int column,
boolean ascending,
int column2,
boolean ascending2)
column - sort columnascending - true if sort ascendingcolumn2 - sort column2ascending2 - true if sort column2 ascendingpublic ListComparator(int[] sortcols)
sortcols - array of sort columns| Method Detail |
|---|
public int compare(List<Object> o1,
List<Object> o2)
compare in interface Comparator<List<Object>>
public static int compareNumbers(Number n1,
Number n2)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||