Interface ComparableQuantity<Q extends javax.measure.Quantity<Q>>

    • Method Detail

      • add

        ComparableQuantity<Q> add​(javax.measure.Quantity<Q> that)
        Specified by:
        add in interface javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>
        See Also:
        Quantity.add(Quantity)
      • subtract

        ComparableQuantity<Q> subtract​(javax.measure.Quantity<Q> that)
        Specified by:
        subtract in interface javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>
        See Also:
        Quantity.subtract(Quantity)
      • divide

        ComparableQuantity<?> divide​(javax.measure.Quantity<?> that)
        Specified by:
        divide in interface javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>
        See Also:
        Quantity.divide(Quantity)
      • divide

        ComparableQuantity<Q> divide​(java.lang.Number that)
        Specified by:
        divide in interface javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>
        See Also:
        Quantity.divide(Number)
      • multiply

        ComparableQuantity<?> multiply​(javax.measure.Quantity<?> multiplier)
        Specified by:
        multiply in interface javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>
        See Also:
        Quantity.multiply(Quantity)
      • multiply

        ComparableQuantity<Q> multiply​(java.lang.Number multiplier)
        Specified by:
        multiply in interface javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>
        See Also:
        Quantity.multiply(Number)
      • inverse

        ComparableQuantity<?> inverse()
        Specified by:
        inverse in interface javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>
        See Also:
        Quantity.inverse()
      • inverse

        <T extends javax.measure.Quantity<T>> ComparableQuantity<T> inverse​(java.lang.Class<T> quantityClass)
        invert and already cast to defined quantityClass
        Parameters:
        quantityClass - Quantity to be converted
        See Also:
        Quantity.inverse(), Quantity.asType(Class)
      • to

        ComparableQuantity<Q> to​(javax.measure.Unit<Q> unit)
        Specified by:
        to in interface javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>
        Specified by:
        to in interface tech.uom.lib.common.function.QuantityConverter<Q extends javax.measure.Quantity<Q>>
        See Also:
        Quantity.to(Unit)
      • asType

        <T extends javax.measure.Quantity<T>> ComparableQuantity<T> asType​(java.lang.Class<T> type)
                                                                    throws java.lang.ClassCastException
        Specified by:
        asType in interface javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>
        Throws:
        java.lang.ClassCastException
        See Also:
        Quantity.asType(Class)
      • isGreaterThan

        boolean isGreaterThan​(javax.measure.Quantity<Q> that)
        Compares two instances of . Conversion of unit can happen if necessary
        Parameters:
        that - the quantity<Q> to be compared with this instance.
        Returns:
        true if that > this.
        Throws:
        java.lang.NullPointerException - if the that is null
      • isGreaterThanOrEqualTo

        boolean isGreaterThanOrEqualTo​(javax.measure.Quantity<Q> that)
        Compares two instances of , doing the conversion of unit if necessary.
        Parameters:
        that - the quantity<Q> to be compared with this instance.
        Returns:
        true if that >= this.
        Throws:
        java.lang.NullPointerException - if the that is null
      • isLessThan

        boolean isLessThan​(javax.measure.Quantity<Q> that)
        Compares two instances of , doing the conversion of unit if necessary.
        Parameters:
        that - the quantity<Q> to be compared with this instance.
        Returns:
        true if that < this.
        Throws:
        java.lang.NullPointerException - if the quantity is null
      • isLessThanOrEqualTo

        boolean isLessThanOrEqualTo​(javax.measure.Quantity<Q> that)
        Compares two instances of , doing the conversion of unit if necessary.
        Parameters:
        that - the quantity<Q> to be compared with this instance.
        Returns:
        true if that < this.
        Throws:
        java.lang.NullPointerException - if the quantity is null
      • isEquivalentOf

        boolean isEquivalentOf​(javax.measure.Quantity<Q> that)
        Compares two instances of , doing the conversion of unit if necessary.
        Parameters:
        that - the quantity<Q> to be compared with this instance.
        Returns:
        true if that < this.
        Throws:
        java.lang.NullPointerException - if the quantity is null
      • divide

        <T extends javax.measure.Quantity<T>,​E extends javax.measure.Quantity<E>> ComparableQuantity<E> divide​(javax.measure.Quantity<T> that,
                                                                                                                     java.lang.Class<E> asTypeQuantity)
        Multiply and cast the ComparableQuantity
        Parameters:
        that - quantity to be multiplied
        asTypeQuantity - quantity to be converted
        Returns:
        the QuantityOperations multiplied and converted
        Throws:
        java.lang.NullPointerException
        See Also:
        Quantity.divide(Quantity), Quantity.asType(Class)
      • multiply

        <T extends javax.measure.Quantity<T>,​E extends javax.measure.Quantity<E>> ComparableQuantity<E> multiply​(javax.measure.Quantity<T> that,
                                                                                                                       java.lang.Class<E> asTypeQuantity)
        Divide and cast the ComparableQuantity
        Parameters:
        that - quantity to be divided
        asTypeQuantity - quantity to be converted
        Returns:
        the QuantityOperations multiplied and converted
        Throws:
        java.lang.NullPointerException
        See Also:
        QuantityOperations, QuantityOperations#of(Quantity, Class), Quantity.asType(Class), Quantity.multiply(Quantity)