/** * Compare 2 complete rows of values with each other. Strings are compared in a case insensitive way * * @param r * the row to compare with * @return -1 if the row is smaller, 0 if both rows are equal, 1 if the row is larger. */ public int compare( Row r ) { return compare( r, true ); }
@Override public boolean equals( Object r ) { Row row = (Row) r; return ( compare( row ) == 0 ); }
@Override public int compare( Row one, Row two ) { return one.compare( two, fieldNumbers, ascending ); } };
/** * Compare 2 rows with each other using certain values in the rows and also considering an ascending clause. * * @param r * The row to compare with * @param fieldnrs * The indexes of the values to compare * @param ascending * an entry for each value to compare where true means and normal compare, false the reverse. * @return -1 if the row is smaller, 0 if they are equal and 1 if the row is larger. */ public int compare( Row r, int[] fieldnrs, boolean[] ascending ) { return compare( r, fieldnrs, ascending, null ); }
@Override public int compareTo( Row obj ) { return compare( obj ); }
public int compare( Row r, int[] fieldnrs, boolean[] ascending, boolean[] caseInsensitive ) { return compare( r, fieldnrs, fieldnrs, ascending, caseInsensitive ); }