org.djunits.value.vfloat.scalar

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

• ### Fields inherited from class org.djunits.value.vfloat.scalar.AbstractFloatScalar

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

`NUMBER_PATTERN`
• ### Fields inherited from interface org.djunits.value.vfloat.FloatMathFunctions

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

Constructors
Constructor and Description
```AbstractFloatScalarRel(float value, U unit)```
Construct a new Relative Immutable FloatScalar.
`AbstractFloatScalarRel(R value)`
Construct a new Relative Immutable FloatScalar from an existing Relative Immutable FloatScalar.
• ### 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(float 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(float value, U unit)```
Construct a new Relative Immutable FloatScalar of the right type.
`R` `minus(R decrement)`
Decrement the value by the supplied value and return the result.
`R` `multiplyBy(float 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.vfloat.scalar.AbstractFloatScalar

`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.vfloat.FloatMathFunctions

`DIV, MULT, POW`
• ### Constructor Detail

• #### AbstractFloatScalarRel

```public AbstractFloatScalarRel(float value,
U unit)```
Construct a new Relative Immutable FloatScalar.
Parameters:
`value` - float; the value of the new Relative Immutable FloatScalar
`unit` - U; the unit of the new Relative Immutable FloatScalar
• #### AbstractFloatScalarRel

`public AbstractFloatScalarRel(R value)`
Construct a new Relative Immutable FloatScalar from an existing Relative Immutable FloatScalar.
Parameters:
`value` - R, a relative typed FloatScalar; the reference
• ### Method Detail

• #### instantiateRel

```public abstract R instantiateRel(float value,
U unit)```
Construct a new Relative Immutable FloatScalar of the right type. Each extending class must implement this method.
Parameters:
`value` - float; the float value
`unit` - U; the unit
Returns:
R a new relative instance of the FloatScalar 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 FloatScalar; amount by which the value is incremented
Returns:
Absolute FloatScalar
• #### 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 FloatScalar; amount by which the value is decremented
Returns:
Relative FloatScalar
• #### abs

`public R abs()`
Set the value(s) to their absolute value.
Specified by:
`abs` in interface `MathFunctionsRel<R extends AbstractFloatScalarRel<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 AbstractFloatScalarRel<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 AbstractFloatScalarRel<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 AbstractFloatScalarRel<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 AbstractFloatScalarRel<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 AbstractFloatScalarRel<U,R>>`
Returns:
T; the modified T
• #### multiplyBy

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

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