Class AbstractDoubleScalarRel<U extends Unit<U>,​R extends AbstractDoubleScalarRel<U,​R>>

    • Constructor Detail

      • AbstractDoubleScalarRel

        public AbstractDoubleScalarRel​(double value,
                                       U unit)
        Construct a new Relative Immutable DoubleScalar.
        Parameters:
        value - double; the value of the new Relative Immutable DoubleScalar
        unit - U; the unit of the new Relative Immutable DoubleScalar
      • AbstractDoubleScalarRel

        public AbstractDoubleScalarRel​(R value)
        Construct a new Relative Immutable DoubleScalar from an existing Relative Immutable DoubleScalar.
        Parameters:
        value - R, a relative typed DoubleScalar; the reference
    • Method Detail

      • plus

        public final R plus​(R increment)
        Add a Relative value to this Relative value. A new value is returned due to immutability.
        Specified by:
        plus in interface Scalar.Rel<U extends Unit<U>,​R extends AbstractDoubleScalarRel<U,​R>>
        Parameters:
        increment - R; the value to add
        Returns:
        R; the sum of this value and the operand as a new object
      • minus

        public final R minus​(R decrement)
        Subtract a Relative value from this Relative value. A new value is returned due to immutability.
        Specified by:
        minus in interface Scalar.Rel<U extends Unit<U>,​R extends AbstractDoubleScalarRel<U,​R>>
        Parameters:
        decrement - R; the value to subtract
        Returns:
        R; the difference of this value and the operand
      • times

        public SIScalar times​(AbstractDoubleScalarRel<?,​?> otherScalar)
        Multiply this scalar by another scalar and create a new scalar.
        Parameters:
        otherScalar - AbstractDoubleScalarRel<?, ?>; the value by which this scalar is multiplied
        Returns:
        DoubleScalar<?>; a new scalar instance with correct SI dimensions
      • reciprocal

        public abstract AbstractDoubleScalarRel<?,​?> reciprocal()
        Create the reciprocal of this scalar with the correct dimensions.
        Returns:
        DoubleScalar<?>; a new scalar instance with correct SI dimensions
      • divide

        public SIScalar divide​(AbstractDoubleScalarRel<?,​?> otherScalar)
        Divide this scalar by another scalar and create a new scalar.
        Parameters:
        otherScalar - AbstractDoubleScalarRel<?, ?>; the value by which this scalar is divided
        Returns:
        DoubleScalar<?>; a new scalar instance with correct SI dimensions
      • ceil

        public R ceil()
        Return a new Scalar/Vector/Matrix with the nearest integer value(s) above the current value(s).
        Specified by:
        ceil in interface ValueFunctions<U extends Unit<U>,​R extends AbstractDoubleScalarRel<U,​R>>
        Returns:
        R; a new R with absolute value(s)
      • floor

        public R floor()
        Return a new Scalar/Vector/Matrix with the nearest integer value(s) below the current value(s).
        Specified by:
        floor in interface ValueFunctions<U extends Unit<U>,​R extends AbstractDoubleScalarRel<U,​R>>
        Returns:
        R; a new R with absolute value(s)
      • rint

        public R rint()
        Return a new Scalar/Vector/Matrix with the nearest integer value(s). When the value is exactly in the middle between two integer values, the even one is returned.
        Specified by:
        rint in interface ValueFunctions<U extends Unit<U>,​R extends AbstractDoubleScalarRel<U,​R>>
        Returns:
        R; a new R with absolute value(s)
      • times

        public R times​(double constant)
        Returns a new scalar/vector/matrix with value(s) multiplied by a factor.
        Specified by:
        times in interface Relative<U extends Unit<U>,​R extends AbstractDoubleScalarRel<U,​R>>
        Parameters:
        constant - double; the multiplier
        Returns:
        T; a new scalar/vector/matrix
      • divide

        public R divide​(double constant)
        Returns a new scalar/vector/matrix with value(s) divided by a factor.
        Specified by:
        divide in interface Relative<U extends Unit<U>,​R extends AbstractDoubleScalarRel<U,​R>>
        Parameters:
        constant - double; the divisor
        Returns:
        T; the modified T
      • times

        public R times​(float constant)
        Returns a new scalar/vector/matrix with value(s) multiplied by a factor.
        Specified by:
        times in interface Relative<U extends Unit<U>,​R extends AbstractDoubleScalarRel<U,​R>>
        Parameters:
        constant - float; the multiplier
        Returns:
        T; a new scalar/vector/matrix
      • divide

        public R divide​(float constant)
        Returns a new scalar/vector/matrix with value(s) divided by a factor.
        Specified by:
        divide in interface Relative<U extends Unit<U>,​R extends AbstractDoubleScalarRel<U,​R>>
        Parameters:
        constant - float; the divisor
        Returns:
        T; the modified T