U
- Unit; the unit of this FloatScalarpublic abstract class FloatScalar<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 |
FloatScalar.Abs<U extends Unit<U>> |
static class |
FloatScalar.Rel<U extends Unit<U>> |
Modifier | Constructor and Description |
---|---|
protected |
FloatScalar(U unit)
Construct a new Immutable FloatScalar.
|
Modifier and Type | Method and Description |
---|---|
static MutableFloatScalar.Abs<SIUnit> |
divide(FloatScalar.Abs<?> left,
FloatScalar.Abs<?> right)
Divide two values; the result is a new instance with a different (existing or generated) SI unit.
|
static MutableFloatScalar.Rel<SIUnit> |
divide(FloatScalar.Rel<?> left,
FloatScalar.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() |
float |
getInUnit()
Retrieve the value in the original unit.
|
float |
getInUnit(U targetUnit)
Retrieve the value converted into some specified unit.
|
float |
getSI()
Retrieve the value in the underlying SI unit.
|
int |
hashCode() |
protected void |
initialize(float value)
Initialize the valueSI field (performing conversion to the SI standard unit if needed).
|
protected void |
initialize(FloatScalar<U> value)
Initialize the valueSI field.
|
static <U extends Unit<U>> |
interpolate(FloatScalar.Abs<U> zero,
FloatScalar.Abs<U> one,
float ratio)
Interpolate between or extrapolate over two values.
|
static <U extends Unit<U>> |
interpolate(FloatScalar.Rel<U> zero,
FloatScalar.Rel<U> one,
float ratio)
Interpolate between or extrapolate over two values.
|
int |
intValue() |
long |
longValue() |
static <U extends Unit<U>> |
minus(FloatScalar.Abs<U> valueAbs1,
FloatScalar.Abs<U> valueAbs2)
Subtract two absolute values.
|
static <U extends Unit<U>> |
minus(FloatScalar.Abs<U> left,
FloatScalar.Rel<U> right)
Subtract a Relative value from an absolute value.
|
static <U extends Unit<U>> |
minus(FloatScalar.Rel<U> left,
FloatScalar.Rel<U> right)
Subtract a relative value from a relative value.
|
static MutableFloatScalar.Abs<SIUnit> |
multiply(FloatScalar.Abs<?> left,
FloatScalar.Abs<?> right)
Multiply two values; the result is a new instance with a different (existing or generated) SI unit.
|
static MutableFloatScalar.Rel<SIUnit> |
multiply(FloatScalar.Rel<?> left,
FloatScalar.Rel<?> right)
Multiply two values; the result is a new instance with a different (existing or generated) SI unit.
|
abstract MutableFloatScalar<U> |
mutable()
Create a mutable version of this FloatScalar.
|
static <U extends Unit<U>> |
plus(FloatScalar.Abs<U> left,
FloatScalar.Rel<U> right)
Add a Relative value to an Absolute value.
|
static <U extends Unit<U>> |
plus(FloatScalar.Rel<U> left,
FloatScalar.Rel<U> right)
Add a Relative value to a Relative value.
|
protected void |
setValueSI(float value)
Set the value in the underlying SI unit.
|
String |
toString() |
String |
toString(boolean verbose,
boolean withUnit)
Print this FloatScalar with optional type and unit information.
|
String |
toString(U displayUnit)
Print this FloatScalar with the value expressed in the specified unit.
|
String |
toString(U displayUnit,
boolean verbose,
boolean withUnit)
Print this FloatScalar with the value expressed in the specified unit.
|
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative
byteValue, shortValue
protected FloatScalar(U unit)
unit
- U; the unit of the new FloatScalarpublic abstract MutableFloatScalar<U> mutable()
protected final void initialize(float value)
value
- float; the value in the unit of this FloatScalarprotected final void initialize(FloatScalar<U> value)
value
- FloatScalar<U>; the value to use for initializationpublic final float getSI()
protected final void setValueSI(float value)
value
- float; the new value in the underlying SI unitpublic final float getInUnit()
public final float 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>> MutableFloatScalar.Abs<U> plus(FloatScalar.Abs<U> left, FloatScalar.Rel<U> right)
U
- Unit; the unit of the parameters and the resultleft
- FloatScalar.Abs<U>; the left argumentright
- FloatScalar.Rel<U>; the right argumentpublic static <U extends Unit<U>> MutableFloatScalar.Rel<U> plus(FloatScalar.Rel<U> left, FloatScalar.Rel<U> right)
U
- Unit; the unit of the parameters and the resultleft
- FloatScalar.Rel<U>; the left argumentright
- FloatScalar.Rel<U>; the right argumentpublic static <U extends Unit<U>> MutableFloatScalar.Abs<U> minus(FloatScalar.Abs<U> left, FloatScalar.Rel<U> right)
U
- Unit; the unit of the parameters and the resultleft
- FloatScalar.Abs<U>; the left valueright
- FloatScalar.Rel<U>; the right valuepublic static <U extends Unit<U>> MutableFloatScalar.Rel<U> minus(FloatScalar.Rel<U> left, FloatScalar.Rel<U> right)
U
- Unit; the unit of the parameters and the resultleft
- FloatScalar.Rel<U>; the left valueright
- FloatScalar.Rel<U>; the right valuepublic static <U extends Unit<U>> MutableFloatScalar.Rel<U> minus(FloatScalar.Abs<U> valueAbs1, FloatScalar.Abs<U> valueAbs2)
U
- Unit; the unit of the parameters and the resultvalueAbs1
- FloatScalar.Abs<U>; value 1valueAbs2
- FloatScalar.Abs<U>; value 2public static MutableFloatScalar.Abs<SIUnit> multiply(FloatScalar.Abs<?> left, FloatScalar.Abs<?> right)
left
- FloatScalar.Abs<?>; the left operandright
- FloatScalar.Abs<?>; the right operandpublic static MutableFloatScalar.Rel<SIUnit> multiply(FloatScalar.Rel<?> left, FloatScalar.Rel<?> right)
left
- FloatScalar.Rel<?>; the left operandright
- FloatScalar.Rel<?>; the right operandpublic static MutableFloatScalar.Abs<SIUnit> divide(FloatScalar.Abs<?> left, FloatScalar.Abs<?> right)
left
- FloatScalar.Abs<?>; the left operandright
- FloatScalar.Abs<?>; the right operandpublic static MutableFloatScalar.Rel<SIUnit> divide(FloatScalar.Rel<?> left, FloatScalar.Rel<?> right)
left
- FloatScalar.Rel<?>; the left operandright
- FloatScalar.Rel<?>; the right operandpublic static <U extends Unit<U>> MutableFloatScalar.Abs<U> interpolate(FloatScalar.Abs<U> zero, FloatScalar.Abs<U> one, float ratio)
U
- Unit; the unit of the parameters and the resultzero
- FloatScalar.Abs<U>; zero reference (returned when ratio == 0)one
- FloatScalar.Abs<U>; one reference (returned when ratio == 1)ratio
- float; the ratio that determines where between (or outside) zero and one the result liespublic static <U extends Unit<U>> MutableFloatScalar.Rel<U> interpolate(FloatScalar.Rel<U> zero, FloatScalar.Rel<U> one, float ratio)
U
- Unit; the unit of the parameters and the resultzero
- FloatScalar.Rel<U>; zero reference (returned when ratio == 0)one
- FloatScalar.Rel<U>; one reference (returned when ratio == 1)ratio
- float; the ratio that determines where between (or outside) zero and one the result liesCopyright © 2014–2015 Delft University of Technology. All rights reserved.