org.djunits.value.vdouble.scalar

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

• ### Fields inherited from class org.djunits.value.vdouble.scalar.AbstractDoubleScalar

`si`
• ### Fields inherited from class org.djunits.value.Scalar

`NUMBER_PATTERN`
• ### Fields inherited from interface org.djunits.value.vdouble.DoubleMathFunctions

`ABS, ACOS, ASIN, ATAN, CBRT, CEIL, COS, COSH, EXP, EXPM1, FLOOR, INV, LOG, LOG10, LOG1P, NEG, RINT, ROUND, SIGNUM, SIN, SINH, SQRT, TAN, TANH`
• ### Constructor Summary

Constructors
Constructor and Description
```AbstractDoubleScalarRel(double value, U unit)```
Construct a new Relative Immutable DoubleScalar.
`AbstractDoubleScalarRel(R value)`
Construct a new Relative Immutable DoubleScalar from an existing Relative Immutable DoubleScalar.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`R` `abs()`
Set the value(s) to their absolute value.
`R` `ceil()`
Set the value(s) to the smallest (closest to negative infinity) value(s) that are greater than or equal to the argument and equal to a mathematical integer.
`R` `divideBy(double constant)`
Scale the value(s) by the inverse of a factor; i.e.
`R` `floor()`
Set the value(s) to the largest (closest to positive infinity) value(s) that are less than or equal to the argument and equal to a mathematical integer.
`abstract R` ```instantiateRel(double value, U unit)```
Construct a new Relative Immutable DoubleScalar of the right type.
`static <U extends Unit<U>,R extends AbstractDoubleScalarRel<U,R>>R` ```interpolate(R zero, R one, double ratio)```
Interpolate between two values.
`R` `minus(R decrement)`
Decrement the value by the supplied value and return the result.
`R` `multiplyBy(double constant)`
Scale the value(s) by a factor.
`R` `neg()`
Set the value(s) to the minus value.
`R` `plus(R increment)`
Increment the value by the supplied value and return the result.
`R` `rint()`
Set the value(s) to the value(s) that are closest in value to the argument and equal to a mathematical integer.
`R` `round()`
Set the value(s) to the closest long to the argument with ties rounding up.
• ### Methods inherited from class org.djunits.value.vdouble.scalar.AbstractDoubleScalar

`compareTo, doubleValue, eq, eq0, equals, floatValue, ge, ge0, getInUnit, getInUnit, getSI, gt, gt0, hashCode, intValue, le, le0, longValue, lt, lt0, ne, ne0, toString, toString, toString, toString`
• ### Methods inherited from class org.djunits.value.Scalar

`expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocale`
• ### Methods inherited from class java.lang.Number

`byteValue, shortValue`
• ### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`
• ### Methods inherited from interface org.djunits.value.vdouble.DoubleMathFunctions

`DIV, MULT, POW`
• ### 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

• #### instantiateRel

```public abstract R instantiateRel(double value,
U unit)```
Construct a new Relative Immutable DoubleScalar of the right type. Each extending class must implement this method.
Parameters:
`value` - double; the double value
`unit` - U; the unit
Returns:
R a new relative instance of the DoubleScalar of the right type
• #### plus

`public final R plus(R increment)`
Increment the value by the supplied value and return the result. If the units are equal, the result is expressed in that unit. If the units are unequal, the result is expressed in the standard (often SI) unit.
Parameters:
`increment` - R, a relative typed DoubleScalar; amount by which the value is incremented
Returns:
Absolute DoubleScalar
• #### minus

`public final R minus(R decrement)`
Decrement the value by the supplied value and return the result. If the units are equal, the result is expressed in that unit. If the units are unequal, the result is expressed in the standard (often SI) unit.
Parameters:
`decrement` - R, a relative typed DoubleScalar; amount by which the value is decremented
Returns:
Relative DoubleScalar
• #### interpolate

```public static <U extends Unit<U>,R extends AbstractDoubleScalarRel<U,R>> R interpolate(R zero,
R one,
double ratio)```
Interpolate between two values.
Type Parameters:
`U` - the unit
`R` - the Relative class for reference purposes
Parameters:
`zero` - Duration; the low value
`one` - Duration; the high value
`ratio` - double; the ratio between 0 and 1, inclusive
Returns:
a Scalar at the ratio between
• #### abs

`public R abs()`
Set the value(s) to their absolute value.
Specified by:
`abs` in interface `MathFunctionsRel<R extends AbstractDoubleScalarRel<U,R>>`
Returns:
T; the modified T
• #### ceil

`public R ceil()`
Set the value(s) to the smallest (closest to negative infinity) value(s) that are greater than or equal to the argument and equal to a mathematical integer.
Specified by:
`ceil` in interface `MathFunctionsAbs<R extends AbstractDoubleScalarRel<U,R>>`
Returns:
T; the modified T
• #### floor

`public R floor()`
Set the value(s) to the largest (closest to positive infinity) value(s) that are less than or equal to the argument and equal to a mathematical integer.
Specified by:
`floor` in interface `MathFunctionsAbs<R extends AbstractDoubleScalarRel<U,R>>`
Returns:
T; the modified T
• #### rint

`public R rint()`
Set the value(s) to the value(s) that are closest in value to the argument and equal to a mathematical integer.
Specified by:
`rint` in interface `MathFunctionsAbs<R extends AbstractDoubleScalarRel<U,R>>`
Returns:
T; the modified T
• #### round

`public R round()`
Set the value(s) to the closest long to the argument with ties rounding up.
Specified by:
`round` in interface `MathFunctionsAbs<R extends AbstractDoubleScalarRel<U,R>>`
Returns:
T; the modified T
• #### neg

`public R neg()`
Set the value(s) to the minus value.
Specified by:
`neg` in interface `MathFunctionsRel<R extends AbstractDoubleScalarRel<U,R>>`
Returns:
T; the modified T
• #### multiplyBy

`public R multiplyBy(double constant)`
Scale the value(s) by a factor.
Specified by:
`multiplyBy` in interface `DoubleMathFunctions<R extends AbstractDoubleScalarRel<U,R>>`
Parameters:
`constant` - double; the multiplier
Returns:
T; the modified T
• #### divideBy

`public R divideBy(double constant)`
Scale the value(s) by the inverse of a factor; i.e. a divisor.
Specified by:
`divideBy` in interface `DoubleMathFunctions<R extends AbstractDoubleScalarRel<U,R>>`
Parameters:
`constant` - double; the divisor
Returns:
T; the modified T