public class LinearUnitTempUnitComparator extends java.lang.Object implements java.util.Comparator<Unit>
Note: this comparator imposes orderings that are inconsistent with equals.
In order to overcome the inconsistency with equals this comparator allows the introduction of a sub-comparator which is applied in cases of equality. I.e. if the two compared units are either both normal units or both temp units, instead of 0 the result of the unit sub-comparator's comparison is returned.
|Modifier and Type||Field and Description|
|Constructor and Description|
Creates a new LinearUnitTempUnitComparator object.
|Modifier and Type||Method and Description|
Compares its two arguments for order according to their types.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected java.util.Comparator<? super Unit> subCmp
public LinearUnitTempUnitComparator(java.util.Comparator<? super Unit> unitSubComparator)
unitSubComparator- if two units are of the same type (standard or temp unit), this sub-comparator is applied if it is not null.