Class AbstractQuantity.Equalizer

  • Enclosing class:
    AbstractQuantity<Q extends javax.measure.Quantity<Q>>

    protected static final class AbstractQuantity.Equalizer
    extends java.lang.Object
    Utility class for number comparison and equality
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Equalizer()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Equalizer

        protected Equalizer()
    • 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 a Number of either Double, Float, Integer, Long, Short or Byte it is compared using the respective *value() method of Number. Otherwise it is checked, if BigDecimal.compareTo(Object) is equal to zero.
        Parameters:
        valueA - the value a
        valueB - the value B
        Returns:
        BigDecimal.compareTo(Object) == zero