AU
- the absolute unitA
- the Absolute class for reference purposesRU
- the relative unitR
- the Relative class for reference purposespublic abstract class AbstractDoubleScalarAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends AbstractDoubleScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends AbstractDoubleScalarRel<RU,R>> extends AbstractDoubleScalar<AU,A> implements Absolute, MathFunctionsAbs<A>, DoubleMathFunctions<A>
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 |
---|
AbstractDoubleScalarAbs(A value)
Construct a new Absolute Immutable DoubleScalar from an existing Absolute Immutable DoubleScalar.
|
AbstractDoubleScalarAbs(double value,
AU unit)
Construct a new Absolute Immutable DoubleScalar.
|
Modifier and Type | Method and Description |
---|---|
A |
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.
|
A |
divideBy(double constant)
Scale the value(s) by the inverse of a factor; i.e.
|
A |
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 A |
instantiateAbs(double value,
AU unit)
Construct a new Absolute Immutable DoubleScalar of the right type.
|
abstract R |
instantiateRel(double value,
RU unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
static <AU extends AbsoluteLinearUnit<AU,RU>,A extends AbstractDoubleScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends AbstractDoubleScalarRel<RU,R>> |
interpolate(A zero,
A one,
double ratio)
Interpolate between two values.
|
R |
minus(A decrement)
Decrement the value by the supplied value and return the result using the relative unit belonging to the unit of the
Absolute value.
|
A |
minus(R decrement)
Decrement the value by the supplied value and return the result using the current unit of the Absolute value.
|
A |
multiplyBy(double constant)
Scale the value(s) by a factor.
|
A |
plus(R increment)
Increment the value by the supplied value and return the result using the current unit of the Absolute value.
|
A |
rint()
Set the value(s) to the value(s) that are closest in value to the argument and equal to a mathematical integer.
|
A |
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 AbstractDoubleScalarAbs(double value, AU unit)
value
- double; the value of the new Absolute Immutable DoubleScalarunit
- AU; the unit of the new Absolute Immutable DoubleScalarpublic AbstractDoubleScalarAbs(A value)
value
- A, an absolute typed DoubleScalar; the referencepublic abstract A instantiateAbs(double value, AU unit)
value
- double; the double valueunit
- AU; the unitpublic abstract R instantiateRel(double value, RU unit)
value
- double; the double valueunit
- RU; the unitpublic final A plus(R increment)
increment
- R, a relative typed DoubleScalar; amount by which the value is incrementedpublic final A minus(R decrement)
decrement
- R, a relative typed DoubleScalar; amount by which the value is decrementedpublic final R minus(A decrement)
decrement
- A, an absolute typed DoubleScalar; amount by which the value is decrementedpublic static <AU extends AbsoluteLinearUnit<AU,RU>,A extends AbstractDoubleScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends AbstractDoubleScalarRel<RU,R>> A interpolate(A zero, A one, double ratio)
AU
- the absolute unitA
- the Absolute class for reference purposesRU
- the relative unitR
- the Relative class for reference purposeszero
- Duration; the low valueone
- Duration; the high valueratio
- double; the ratio between 0 and 1, inclusivepublic A ceil()
ceil
in interface MathFunctionsAbs<A extends AbstractDoubleScalarAbs<AU,A,RU,R>>
public A floor()
floor
in interface MathFunctionsAbs<A extends AbstractDoubleScalarAbs<AU,A,RU,R>>
public A rint()
rint
in interface MathFunctionsAbs<A extends AbstractDoubleScalarAbs<AU,A,RU,R>>
public A round()
round
in interface MathFunctionsAbs<A extends AbstractDoubleScalarAbs<AU,A,RU,R>>
public A multiplyBy(double constant)
multiplyBy
in interface DoubleMathFunctions<A extends AbstractDoubleScalarAbs<AU,A,RU,R>>
constant
- double; the multiplierpublic A divideBy(double constant)
divideBy
in interface DoubleMathFunctions<A extends AbstractDoubleScalarAbs<AU,A,RU,R>>
constant
- double; the divisorCopyright © 2015–2019 Delft University of Technology. All rights reserved.