public class Force extends AbstractDoubleScalarRel<ForceUnit,Force>
DoubleScalar.Rel<ForceUnit> value = new DoubleScalar.Rel<ForceUnit>(100.0, ForceUnit.SI);we can now write:
Force value = new Force(100.0, ForceUnit.SI);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-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2019-03-03 00:53:50 +0100 (Sun, 03 Mar 2019) $, @version $Revision: 349 $, by $Author: averbraeck $,
initial version Sep 5, 2015
Modifier and Type | Field and Description |
---|---|
static Force |
NaN
constant with value NaN.
|
static Force |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static Force |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static Force |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static Force |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
static Force |
ZERO
constant with value zero.
|
si
NUMBER_PATTERN
Constructor and Description |
---|
Force(double value,
ForceUnit unit)
Construct Force scalar.
|
Force(Force value)
Construct Force scalar.
|
Modifier and Type | Method and Description |
---|---|
static Force |
createSI(double value)
Construct Force scalar.
|
Mass |
divideBy(Acceleration v)
Calculate the division of Force and Acceleration, which results in a Mass scalar.
|
Pressure |
divideBy(Area v)
Calculate the division of Force and Area, which results in a Pressure scalar.
|
LinearDensity |
divideBy(Energy v)
Calculate the division of Force and Energy, which results in a LinearDensity scalar.
|
Dimensionless |
divideBy(Force v)
Calculate the division of Force and Force, which results in a Dimensionless scalar.
|
Energy |
divideBy(LinearDensity v)
Calculate the division of Force and LinearDensity, which results in a Energy scalar.
|
Acceleration |
divideBy(Mass v)
Calculate the division of Force and Mass, which results in a Acceleration scalar.
|
Area |
divideBy(Pressure v)
Calculate the division of Force and Pressure, which results in a Area scalar.
|
Force |
instantiateRel(double value,
ForceUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
static Force |
interpolate(Force zero,
Force one,
double ratio)
Interpolate between two values.
|
static Force |
max(Force r1,
Force r2)
Return the maximum value of two relative scalars.
|
static Force |
max(Force r1,
Force r2,
Force... rn)
Return the maximum value of more than two relative scalars.
|
static Force |
min(Force r1,
Force r2)
Return the minimum value of two relative scalars.
|
static Force |
min(Force r1,
Force r2,
Force... rn)
Return the minimum value of more than two relative scalars.
|
Energy |
multiplyBy(Length v)
Calculate the multiplication of Force and Length, which results in a Energy scalar.
|
Power |
multiplyBy(Speed v)
Calculate the multiplication of Force and Speed, which results in a Power scalar.
|
static Force |
valueOf(String text)
Returns a Force representation of a textual representation of a value with a unit.
|
abs, ceil, divideBy, floor, minus, multiplyBy, neg, 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, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocale
byteValue, shortValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
public static final Force ZERO
public static final Force NaN
public static final Force POSITIVE_INFINITY
public static final Force NEGATIVE_INFINITY
public static final Force POS_MAXVALUE
public static final Force NEG_MAXVALUE
public Force(double value, ForceUnit unit)
value
- double valueunit
- unit for the double valuepublic Force(Force value)
value
- Scalar from which to construct this instancepublic final Force instantiateRel(double value, ForceUnit unit)
instantiateRel
in class AbstractDoubleScalarRel<ForceUnit,Force>
value
- double; the double valueunit
- U; the unitpublic static final Force createSI(double value)
value
- double value in SI unitspublic static Force interpolate(Force zero, Force one, double ratio)
zero
- the low valueone
- the high valueratio
- the ratio between 0 and 1, inclusivepublic static Force max(Force r1, Force r2)
r1
- the first scalarr2
- the second scalarpublic static Force max(Force r1, Force r2, Force... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static Force min(Force r1, Force r2)
r1
- the first scalarr2
- the second scalarpublic static Force min(Force r1, Force r2, Force... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static Force valueOf(String text) throws IllegalArgumentException
text
- String; the textual representation to parse into a ForceIllegalArgumentException
- when the text cannot be parsedpublic final Dimensionless divideBy(Force v)
v
- Force scalarpublic final Energy multiplyBy(Length v)
v
- Force scalarpublic final Energy divideBy(LinearDensity v)
v
- Force scalarpublic final LinearDensity divideBy(Energy v)
v
- Force scalarpublic final Power multiplyBy(Speed v)
v
- Force scalarpublic final Acceleration divideBy(Mass v)
v
- Force scalarpublic final Mass divideBy(Acceleration v)
v
- Force scalarpublic final Pressure divideBy(Area v)
v
- Force scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.