U
- Unit; the unit of this DoubleScalarpublic abstract class DoubleScalar<U extends Unit<U>> extends Scalar<U>
This file was generated by the OpenTrafficSim value classes generator, 09 mrt, 2015
Copyright (c) 2014 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Class and Description |
---|---|
static class |
DoubleScalar.Abs<U extends Unit<U>> |
static class |
DoubleScalar.Rel<U extends Unit<U>> |
Modifier | Constructor and Description |
---|---|
protected |
DoubleScalar(U unit)
Construct a new Immutable DoubleScalar.
|
Modifier and Type | Method and Description |
---|---|
static MutableDoubleScalar.Abs<SIUnit> |
divide(DoubleScalar.Abs<?> left,
DoubleScalar.Abs<?> right)
Divide two values; the result is a new instance with a different (existing or generated) SI unit.
|
static MutableDoubleScalar.Rel<SIUnit> |
divide(DoubleScalar.Rel<?> left,
DoubleScalar.Rel<?> right)
Divide two values; the result is a new instance with a different (existing or generated) SI unit.
|
double |
doubleValue() |
boolean |
equals(Object obj) |
float |
floatValue() |
double |
getInUnit()
Retrieve the value in the original unit.
|
double |
getInUnit(U targetUnit)
Retrieve the value converted into some specified unit.
|
double |
getSI()
Retrieve the value in the underlying SI unit.
|
int |
hashCode() |
protected void |
initialize(double value)
Initialize the valueSI field (performing conversion to the SI standard unit if needed).
|
protected void |
initialize(DoubleScalar<U> value)
Initialize the valueSI field.
|
static <U extends Unit<U>> |
interpolate(DoubleScalar.Abs<U> zero,
DoubleScalar.Abs<U> one,
double ratio)
Interpolate between or extrapolate over two values.
|
static <U extends Unit<U>> |
interpolate(DoubleScalar.Rel<U> zero,
DoubleScalar.Rel<U> one,
double ratio)
Interpolate between or extrapolate over two values.
|
int |
intValue() |
long |
longValue() |
static <U extends Unit<U>> |
minus(DoubleScalar.Abs<U> valueAbs1,
DoubleScalar.Abs<U> valueAbs2)
Subtract two absolute values.
|
static <U extends Unit<U>> |
minus(DoubleScalar.Abs<U> left,
DoubleScalar.Rel<U> right)
Subtract a Relative value from an absolute value.
|
static <U extends Unit<U>> |
minus(DoubleScalar.Rel<U> left,
DoubleScalar.Rel<U> right)
Subtract a relative value from a relative value.
|
static MutableDoubleScalar.Abs<SIUnit> |
multiply(DoubleScalar.Abs<?> left,
DoubleScalar.Abs<?> right)
Multiply two values; the result is a new instance with a different (existing or generated) SI unit.
|
static MutableDoubleScalar.Rel<SIUnit> |
multiply(DoubleScalar.Rel<?> left,
DoubleScalar.Rel<?> right)
Multiply two values; the result is a new instance with a different (existing or generated) SI unit.
|
abstract MutableDoubleScalar<U> |
mutable()
Create a mutable version of this DoubleScalar.
|
static <U extends Unit<U>> |
plus(DoubleScalar.Abs<U> left,
DoubleScalar.Rel<U> right)
Add a Relative value to an Absolute value.
|
static <U extends Unit<U>> |
plus(DoubleScalar.Rel<U> left,
DoubleScalar.Rel<U> right)
Add a Relative value to a Relative value.
|
protected void |
setValueSI(double value)
Set the value in the underlying SI unit.
|
String |
toString() |
String |
toString(boolean verbose,
boolean withUnit)
Print this DoubleScalar with optional type and unit information.
|
String |
toString(U displayUnit)
Print this DoubleScalar with the value expressed in the specified unit.
|
String |
toString(U displayUnit,
boolean verbose,
boolean withUnit)
Print this DoubleScalar with the value expressed in the specified unit.
|
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative
byteValue, shortValue
protected DoubleScalar(U unit)
unit
- U; the unit of the new DoubleScalarpublic abstract MutableDoubleScalar<U> mutable()
protected final void initialize(double value)
value
- double; the value in the unit of this DoubleScalarprotected final void initialize(DoubleScalar<U> value)
value
- DoubleScalar<U>; the value to use for initializationpublic final double getSI()
protected final void setValueSI(double value)
value
- double; the new value in the underlying SI unitpublic final double getInUnit()
public final double getInUnit(U targetUnit)
targetUnit
- U; the unit to convert the value intopublic final float floatValue()
floatValue
in class Number
public final double doubleValue()
doubleValue
in class Number
public final String toString(U displayUnit)
displayUnit
- U; the unit into which the value is converted for displaypublic final String toString(boolean verbose, boolean withUnit)
verbose
- boolean; if true; include type info; if false; exclude type infowithUnit
- boolean; if true; include the unit; of false; exclude the unitpublic final String toString(U displayUnit, boolean verbose, boolean withUnit)
displayUnit
- U; the unit into which the value is converted for displayverbose
- boolean; if true; include type info; if false; exclude type infowithUnit
- boolean; if true; include the unit; of false; exclude the unitpublic static <U extends Unit<U>> MutableDoubleScalar.Abs<U> plus(DoubleScalar.Abs<U> left, DoubleScalar.Rel<U> right)
U
- Unit; the unit of the parameters and the resultleft
- DoubleScalar.Abs<U>; the left argumentright
- DoubleScalar.Rel<U>; the right argumentpublic static <U extends Unit<U>> MutableDoubleScalar.Rel<U> plus(DoubleScalar.Rel<U> left, DoubleScalar.Rel<U> right)
U
- Unit; the unit of the parameters and the resultleft
- DoubleScalar.Rel<U>; the left argumentright
- DoubleScalar.Rel<U>; the right argumentpublic static <U extends Unit<U>> MutableDoubleScalar.Abs<U> minus(DoubleScalar.Abs<U> left, DoubleScalar.Rel<U> right)
U
- Unit; the unit of the parameters and the resultleft
- DoubleScalar.Abs<U>; the left valueright
- DoubleScalar.Rel<U>; the right valuepublic static <U extends Unit<U>> MutableDoubleScalar.Rel<U> minus(DoubleScalar.Rel<U> left, DoubleScalar.Rel<U> right)
U
- Unit; the unit of the parameters and the resultleft
- DoubleScalar.Rel<U>; the left valueright
- DoubleScalar.Rel<U>; the right valuepublic static <U extends Unit<U>> MutableDoubleScalar.Rel<U> minus(DoubleScalar.Abs<U> valueAbs1, DoubleScalar.Abs<U> valueAbs2)
U
- Unit; the unit of the parameters and the resultvalueAbs1
- DoubleScalar.Abs<U>; value 1valueAbs2
- DoubleScalar.Abs<U>; value 2public static MutableDoubleScalar.Abs<SIUnit> multiply(DoubleScalar.Abs<?> left, DoubleScalar.Abs<?> right)
left
- DoubleScalar.Abs<?>; the left operandright
- DoubleScalar.Abs<?>; the right operandpublic static MutableDoubleScalar.Rel<SIUnit> multiply(DoubleScalar.Rel<?> left, DoubleScalar.Rel<?> right)
left
- DoubleScalar.Rel<?>; the left operandright
- DoubleScalar.Rel<?>; the right operandpublic static MutableDoubleScalar.Abs<SIUnit> divide(DoubleScalar.Abs<?> left, DoubleScalar.Abs<?> right)
left
- DoubleScalar.Abs<?>; the left operandright
- DoubleScalar.Abs<?>; the right operandpublic static MutableDoubleScalar.Rel<SIUnit> divide(DoubleScalar.Rel<?> left, DoubleScalar.Rel<?> right)
left
- DoubleScalar.Rel<?>; the left operandright
- DoubleScalar.Rel<?>; the right operandpublic static <U extends Unit<U>> MutableDoubleScalar.Abs<U> interpolate(DoubleScalar.Abs<U> zero, DoubleScalar.Abs<U> one, double ratio)
U
- Unit; the unit of the parameters and the resultzero
- DoubleScalar.Abs<U>; zero reference (returned when ratio == 0)one
- DoubleScalar.Abs<U>; one reference (returned when ratio == 1)ratio
- double; the ratio that determines where between (or outside) zero and one the result liespublic static <U extends Unit<U>> MutableDoubleScalar.Rel<U> interpolate(DoubleScalar.Rel<U> zero, DoubleScalar.Rel<U> one, double ratio)
U
- Unit; the unit of the parameters and the resultzero
- DoubleScalar.Rel<U>; zero reference (returned when ratio == 0)one
- DoubleScalar.Rel<U>; one reference (returned when ratio == 1)ratio
- double; the ratio that determines where between (or outside) zero and one the result liesCopyright © 2014–2015 Delft University of Technology. All rights reserved.