public class Direction extends AbstractDoubleScalarAbs<DirectionUnit,Direction,AngleUnit,Angle>
DoubleScalar.Abs<DirectionUnit> value = new DoubleScalar.Abs<DirectionUnit>(100.0, DirectionUnit.SI);we can now write:
Direction value = new Direction(100.0, DirectionUnit.BASE);The compiler will automatically recognize which units belong to which quantity, and whether the quantity type and the unit used are compatible.
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-12-22 04:32:39 +0100 (Tue, 22 Dec 2015) $, @version $Revision: 180 $, by $Author: averbraeck $,
initial version Sep 1, 2015
Modifier and Type | Field and Description |
---|---|
static Direction |
ZERO
constant with value zero.
|
si
Constructor and Description |
---|
Direction(Direction value)
Construct Direction scalar.
|
Direction(double value,
DirectionUnit unit)
Construct Direction scalar.
|
Modifier and Type | Method and Description |
---|---|
static Direction |
createSI(double value)
Construct %TypeAbsl% scalar.
|
Direction |
instantiateAbs(double value,
DirectionUnit unit)
Construct a new Absolute Immutable DoubleScalar of the right type.
|
Angle |
instantiateRel(double value,
AngleUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
static Direction |
interpolate(Direction zero,
Direction one,
double ratio)
Interpolate between two values.
|
static Direction |
max(Direction a1,
Direction a2)
Return the maximum value of two absolute scalars.
|
static Direction |
max(Direction a1,
Direction a2,
Direction... an)
Return the maximum value of more than two absolute scalars.
|
static Direction |
min(Direction a1,
Direction a2)
Return the minimum value of two absolute scalars.
|
static Direction |
min(Direction a1,
Direction a2,
Direction... an)
Return the minimum value of more than two absolute scalars.
|
ceil, divideBy, floor, minus, minus, multiplyBy, plus, rint, round
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 static final Direction ZERO
public Direction(double value, DirectionUnit unit)
value
- double valueunit
- unit for the double valuepublic Direction(Direction value)
value
- Scalar from which to construct this instancepublic final Direction instantiateAbs(double value, DirectionUnit unit)
instantiateAbs
in class AbstractDoubleScalarAbs<DirectionUnit,Direction,AngleUnit,Angle>
value
- the double valueunit
- the unitpublic final Angle instantiateRel(double value, AngleUnit unit)
instantiateRel
in class AbstractDoubleScalarAbs<DirectionUnit,Direction,AngleUnit,Angle>
value
- the double valueunit
- the unitpublic static final Direction createSI(double value)
value
- double value in SI unitspublic static Direction interpolate(Direction zero, Direction one, double ratio)
zero
- the low valueone
- the high valueratio
- the ratio between 0 and 1, inclusivepublic static Direction max(Direction a1, Direction a2)
a1
- the first scalara2
- the second scalarpublic static Direction max(Direction a1, Direction a2, Direction... an)
a1
- the first scalara2
- the second scalaran
- the other scalarspublic static Direction min(Direction a1, Direction a2)
a1
- the first scalara2
- the second scalarCopyright © 2015–2018 Delft University of Technology. All rights reserved.