U
- the unitR
- the relative class for referencepublic abstract class AbstractFloatScalarRel<U extends Unit<U>,R extends AbstractFloatScalarRel<U,R>> extends AbstractFloatScalar<U,R> implements Relative, MathFunctionsRel<R>, FloatMathFunctions<R>
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
si
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.
|
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.
|
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
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit
byteValue, shortValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
public AbstractFloatScalarRel(float value, U unit)
value
- float; the value of the new Relative Immutable FloatScalarunit
- U; the unit of the new Relative Immutable FloatScalarpublic AbstractFloatScalarRel(R value)
value
- R, a relative typed FloatScalar; the referencepublic abstract R instantiateRel(float value, U unit)
value
- float; the float valueunit
- U; the unitpublic final R plus(R increment)
increment
- R, a relative typed FloatScalar; amount by which the value is incrementedpublic final R minus(R decrement)
decrement
- R, a relative typed FloatScalar; amount by which the value is decrementedpublic R abs()
abs
in interface MathFunctionsRel<R extends AbstractFloatScalarRel<U,R>>
public R ceil()
ceil
in interface MathFunctionsAbs<R extends AbstractFloatScalarRel<U,R>>
public R floor()
floor
in interface MathFunctionsAbs<R extends AbstractFloatScalarRel<U,R>>
public R rint()
rint
in interface MathFunctionsAbs<R extends AbstractFloatScalarRel<U,R>>
public R round()
round
in interface MathFunctionsAbs<R extends AbstractFloatScalarRel<U,R>>
public R neg()
neg
in interface MathFunctionsRel<R extends AbstractFloatScalarRel<U,R>>
public R multiplyBy(float constant)
multiplyBy
in interface FloatMathFunctions<R extends AbstractFloatScalarRel<U,R>>
constant
- float; the multiplierpublic R divideBy(float constant)
divideBy
in interface FloatMathFunctions<R extends AbstractFloatScalarRel<U,R>>
constant
- float; the divisorCopyright © 2015–2019 Delft University of Technology. All rights reserved.