de.erichseifert.gral.data.comparators
Class Ascending
- java.lang.Object
-
- de.erichseifert.gral.data.comparators.DataComparator
-
- de.erichseifert.gral.data.comparators.Ascending
-
- All Implemented Interfaces:
- java.io.Serializable, java.util.Comparator<Record>
public class Ascending extends DataComparator
Class that represents aDataComparatorfor comparing two records at a defined index for ascending order.- See Also:
DataTable.sort(DataComparator...), Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Ascending(int col)Creates a new Ascending object for sorting according to the specified column.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intcompare(Record record1, Record record2)Compares the values of two records at the specified column for order and returns a corresponding integer:-
Methods inherited from class de.erichseifert.gral.data.comparators.DataComparator
getColumn
-
-
-
-
Constructor Detail
-
Ascending
public Ascending(int col)
Creates a new Ascending object for sorting according to the specified column.- Parameters:
col- Column index to be compared.
-
-
Method Detail
-
compare
public int compare(Record record1, Record record2)
Compares the values of two records at the specified column for order and returns a corresponding integer:
- a negative value means
record1is smaller thanrecord2 - 0 means
record1is equal torecord2 - a positive value means
record1is larger thanrecord2
- Parameters:
record1- First recordrecord2- Second record- Returns:
- An integer number describing the order:
a negative value if
record1is smaller thanrecord2, 0 ifrecord1is equal torecord2, a positive value ifrecord1is larger thanrecord2,
- a negative value means
-
-
DataMelt 3.0 © DataMelt by jWork.ORG