Interface ITypedQuantity<U extends TypedUnit<U>>

    • Method Detail

      • getUnit

        U getUnit()
        Specified by:
        getUnit in interface IQuantity
        Returns:
        the unit in which this quantity is expressed
      • in

        ITypedQuantity<U> in​(U targetUnit)
        Get this quantity expressed in the unit targetUnit. Note that as a result of this conversion, precision may be lost. Note that this method differs from IQuantity.in(IUnit) only by stricter typing.
        Returns:
        a quantity, with approximately the same value as this quantity, expressed in targetUnit
        Throws:
        java.lang.IllegalArgumentException - if targetUnit is not of the same kind of quantity
      • multiply

        ITypedQuantity<U> multiply​(long factor)
                            throws java.lang.UnsupportedOperationException
        Description copied from interface: IQuantity
        Returns a new quantity that is this quantity multiplied with factor, if this is a linear quantity. Otherwise, this operation is undefined and UnsupportedOperationException will be thrown.
        Specified by:
        multiply in interface IQuantity
        Returns:
        this quantity multiplied with factor
        Throws:
        java.lang.UnsupportedOperationException - if this quantity is not linear
      • multiply

        ITypedQuantity<U> multiply​(double factor)
                            throws java.lang.UnsupportedOperationException
        Description copied from interface: IQuantity
        Returns a new quantity that is this quantity multiplied with factor, if this is a linear quantity. Otherwise, this operation is undefined and UnsupportedOperationException will be thrown.
        Specified by:
        multiply in interface IQuantity
        Returns:
        this quantity multiplied with factor
        Throws:
        java.lang.UnsupportedOperationException - if this quantity is not linear
      • interactiveFormat

        java.lang.String interactiveFormat​(boolean allowCustomUnit)
      • localizedFormat

        java.lang.String localizedFormat​(boolean useBreakingSpace,
                                         boolean allowCustomUnit)