public class ListComparator
extends java.lang.Object
implements java.util.Comparator<java.util.List<java.lang.Object>>, java.io.Serializable
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(java.util.List<java.lang.Object> o1,
java.util.List<java.lang.Object> o2)
Compare two lists.
|
static int |
compareNumbers(java.lang.Number n1,
java.lang.Number n2)
Compares 2 Objects implementing Interface Number, even if they are different types
|
static int |
compareObjects(java.lang.Object first,
java.lang.Object second) |
public ListComparator(int column, boolean ascending)
column
- sort columnascending
- true if sort ascendingpublic 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 columnspublic int compare(java.util.List<java.lang.Object> o1, java.util.List<java.lang.Object> o2)
compare
in interface java.util.Comparator<java.util.List<java.lang.Object>>
public static int compareObjects(java.lang.Object first, java.lang.Object second)
public static int compareNumbers(java.lang.Number n1, java.lang.Number n2)
@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.