de.erichseifert.gral.data.comparators
Class Descending
- java.lang.Object
-
- de.erichseifert.gral.data.comparators.DataComparator
-
- de.erichseifert.gral.data.comparators.Descending
-
- All Implemented Interfaces:
- java.io.Serializable, java.util.Comparator<Record>
public class Descending extends DataComparator
Class that represents aDataComparatorfor comparing two records at a defined index for descending order.- See Also:
DataTable.sort(DataComparator...), Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Descending(int col)Creates a new Descending object 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
-
Descending
public Descending(int col)
Creates a new Descending object 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 larger thanrecord2 - 0 means
record1is equal torecord2 - a positive value means
record1is smaller thanrecord2
- Parameters:
record1- First valuerecord2- Second value- Returns:
- An integer number describing the order:
a negative value if
record1is larger thanrecord2, 0 ifrecord1is equal torecord2, a positive value ifrecord1is smaller thanrecord2,
- a negative value means
-
-
DataMelt 3.0 © DataMelt by jWork.ORG