Package app.babylon.table.column
Class ColumnsComparator
java.lang.Object
app.babylon.table.column.ColumnsComparator
- All Implemented Interfaces:
Comparator<Integer>
Row comparator that compares table rows by a sequence of columns.
-
Constructor Summary
ConstructorsConstructorDescriptionColumnsComparator(TableColumnar table, ColumnName... x) Creates a comparator over the supplied table columns. -
Method Summary
Modifier and TypeMethodDescriptionintintcompareRows(int row1, int row2) Compares two row indexes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
ColumnsComparator
Creates a comparator over the supplied table columns.- Parameters:
table- source tablex- columns to compare in order
-
-
Method Details
-
compareRows
public int compareRows(int row1, int row2) Compares two row indexes.- Parameters:
row1- first row indexrow2- second row index- Returns:
- comparison result
-
compare
- Specified by:
comparein interfaceComparator<Integer>
-