public class Ascending extends DataComparator
DataComparator
for comparing two arrays of
column values at a defined index for ascending order.Constructor and Description |
---|
Ascending(int col)
Creates a new Ascending object for sorting according to the specified
column.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Comparable<?>[] row1,
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 smaller than row2
0 means row1 is equal to row2
a positive value means row1 is larger than row2
|
getColumn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals
public Ascending(int col)
col
- Column index to be compared.public int compare(Comparable<?>[] row1, Comparable<?>[] row2)
Compares the values of two rows at the specified column for order and returns a corresponding integer:
row1
is smaller than row2
row1
is equal to row2
row1
is larger than row2
row1
- First valuerow2
- Second valuerow1
is smaller than row2
,
0 if row1
is equal to row2
,
a positive value if row1
is larger than row2
,Copyright © 2009-2013. All Rights Reserved.