Package tech.units.indriya
Class AbstractQuantity.Equalizer
- java.lang.Object
-
- tech.units.indriya.AbstractQuantity.Equalizer
-
- Enclosing class:
- AbstractQuantity<Q extends javax.measure.Quantity<Q>>
protected static final class AbstractQuantity.Equalizer extends java.lang.ObjectUtility class for number comparison and equality
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedEqualizer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanhasEquality(java.lang.Number valueA, java.lang.Number valueB)Check if the both value has equality number, in other words, 1 is equals to 1.0000 and 1.0.
-
-
-
Method Detail
-
hasEquality
public static boolean hasEquality(java.lang.Number valueA, java.lang.Number valueB)Check if the both value has equality number, in other words, 1 is equals to 1.0000 and 1.0. If the first value is aNumber of eitherDouble ,Float ,Integer ,Long ,Short orByte it is compared using the respective*value()method ofNumber . Otherwise it is checked, ifBigDecimal.compareTo(Object)is equal to zero.- Parameters:
valueA- the value avalueB- the value B- Returns:
BigDecimal.compareTo(Object)== zero
-
-