Package tech.units.indriya
Class AbstractQuantity.Equalizer
java.lang.Object
tech.units.indriya.AbstractQuantity.Equalizer
- Enclosing class:
- AbstractQuantity<Q extends javax.measure.Quantity<Q>>
Utility class for number comparison and equality
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
hasEquality
(Number valueA, Number valueB) Check if the both value has equality number, in other words, 1 is equals to 1.0000 and 1.0.
-
Constructor Details
-
Equalizer
protected Equalizer()
-
-
Method Details
-
hasEquality
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
-