public class Descending extends DataComparator
DataComparator
for comparing two arrays of
column values at a defined index for descending order.Constructor and Description |
---|
Descending(int col)
Creates a new Descending object sorting according to the specified
column.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Comparable<?>[] row1,
java.lang.Comparable<?>[] row2)
Compares the values of two rows at the specified column for order and
returns a corresponding integer:
a negative value means
row1 is larger than row2
0 means row1 is equal to row2
a positive value means row1 is smaller than row2
|
getColumn
public Descending(int col)
col
- Column index to be comparedpublic int compare(java.lang.Comparable<?>[] row1, java.lang.Comparable<?>[] row2)
Compares the values of two rows at the specified column for order and returns a corresponding integer:
row1
is larger than row2
row1
is equal to row2
row1
is smaller than row2
row1
- First valuerow2
- Second valuerow1
is larger than row2
,
0 if row1
is equal to row2
,
a positive value if row1
is smaller than row2
,