/** * Compare two values with the current comparison mode. The values may be of different type. * * @param a the first value * @param b the second value * @return 0 if both values are equal, -1 if the first value is smaller, and 1 otherwise */ public int compareTypeSave(Value a, Value b) { if (a == b) { return 0; } int dataType = Value.getHigherOrder(a.getType(), b.getType()); a = a.convertTo(dataType); b = b.convertTo(dataType); return a.compareTypeSave(b, compareMode); }