U
- the unitR
- the Relative class for reference purposespublic abstract class AbstractDoubleScalarRel<U extends Unit<U>,R extends AbstractDoubleScalarRel<U,R>> extends AbstractDoubleScalar<U,R> implements Relative, MathFunctionsRel<R>, DoubleMathFunctions<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
NUMBER_PATTERN
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.
|
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>> |
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.
|
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, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocale
byteValue, shortValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
public AbstractDoubleScalarRel(double value, U unit)
value
- double; the value of the new Relative Immutable DoubleScalarunit
- U; the unit of the new Relative Immutable DoubleScalarpublic AbstractDoubleScalarRel(R value)
value
- R, a relative typed DoubleScalar; the referencepublic abstract R instantiateRel(double value, U unit)
value
- double; the double valueunit
- U; the unitpublic final R plus(R increment)
increment
- R, a relative typed DoubleScalar; amount by which the value is incrementedpublic final R minus(R decrement)
decrement
- R, a relative typed DoubleScalar; amount by which the value is decrementedpublic static <U extends Unit<U>,R extends AbstractDoubleScalarRel<U,R>> R interpolate(R zero, R one, double ratio)
U
- the unitR
- the Relative class for reference purposeszero
- Duration; the low valueone
- Duration; the high valueratio
- double; the ratio between 0 and 1, inclusivepublic R abs()
abs
in interface MathFunctionsRel<R extends AbstractDoubleScalarRel<U,R>>
public R ceil()
ceil
in interface MathFunctionsAbs<R extends AbstractDoubleScalarRel<U,R>>
public R floor()
floor
in interface MathFunctionsAbs<R extends AbstractDoubleScalarRel<U,R>>
public R rint()
rint
in interface MathFunctionsAbs<R extends AbstractDoubleScalarRel<U,R>>
public R round()
round
in interface MathFunctionsAbs<R extends AbstractDoubleScalarRel<U,R>>
public R neg()
neg
in interface MathFunctionsRel<R extends AbstractDoubleScalarRel<U,R>>
public R multiplyBy(double constant)
multiplyBy
in interface DoubleMathFunctions<R extends AbstractDoubleScalarRel<U,R>>
constant
- double; the multiplierpublic R divideBy(double constant)
divideBy
in interface DoubleMathFunctions<R extends AbstractDoubleScalarRel<U,R>>
constant
- double; the divisorCopyright © 2015–2019 Delft University of Technology. All rights reserved.