public class Frequency extends AbstractDoubleScalarRel<FrequencyUnit,Frequency>
DoubleScalar.Rel<FrequencyUnit> value = new DoubleScalar.Rel<FrequencyUnit>(100.0, FrequencyUnit.SI);we can now write:
Frequency value = new Frequency(100.0, FrequencyUnit.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-01-18 00:35:01 +0100 (Fri, 18 Jan 2019) $, @version $Revision: 324 $, by $Author: averbraeck $,
initial version Sep 5, 2015
Modifier and Type | Field and Description |
---|---|
static Frequency |
NaN
constant with value NaN.
|
static Frequency |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static Frequency |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static Frequency |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static Frequency |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
static Frequency |
ZERO
constant with value zero.
|
si
Constructor and Description |
---|
Frequency(double value,
FrequencyUnit unit)
Construct Frequency scalar.
|
Frequency(Frequency value)
Construct Frequency scalar.
|
Modifier and Type | Method and Description |
---|---|
static Frequency |
createSI(double value)
Construct Frequency scalar.
|
Dimensionless |
divideBy(Frequency v)
Calculate the division of Frequency and Frequency, which results in a Dimensionless scalar.
|
Frequency |
instantiateRel(double value,
FrequencyUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
static Frequency |
interpolate(Frequency zero,
Frequency one,
double ratio)
Interpolate between two values.
|
static Frequency |
max(Frequency r1,
Frequency r2)
Return the maximum value of two relative scalars.
|
static Frequency |
max(Frequency r1,
Frequency r2,
Frequency... rn)
Return the maximum value of more than two relative scalars.
|
static Frequency |
min(Frequency r1,
Frequency r2)
Return the minimum value of two relative scalars.
|
static Frequency |
min(Frequency r1,
Frequency r2,
Frequency... rn)
Return the minimum value of more than two relative scalars.
|
Dimensionless |
multiplyBy(Duration v)
Calculate the multiplication of Frequency and Duration, which results in a Dimensionless scalar.
|
Power |
multiplyBy(Energy v)
Calculate the multiplication of Frequency and Energy, which results in a Power scalar.
|
Speed |
multiplyBy(Length v)
Calculate the multiplication of Frequency and Length, which results in a Speed scalar.
|
MoneyPerDuration |
multiplyBy(Money v)
Calculate the multiplication of Frequency and Money, which results in a MoneyPerDuration scalar.
|
Acceleration |
multiplyBy(Speed v)
Calculate the multiplication of Frequency and Speed, which results in a Acceleration scalar.
|
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
byteValue, shortValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
public static final Frequency ZERO
public static final Frequency NaN
public static final Frequency POSITIVE_INFINITY
public static final Frequency NEGATIVE_INFINITY
public static final Frequency POS_MAXVALUE
public static final Frequency NEG_MAXVALUE
public Frequency(double value, FrequencyUnit unit)
value
- double; double valueunit
- FrequencyUnit; unit for the double valuepublic Frequency(Frequency value)
value
- Frequency; Scalar from which to construct this instancepublic final Frequency instantiateRel(double value, FrequencyUnit unit)
instantiateRel
in class AbstractDoubleScalarRel<FrequencyUnit,Frequency>
value
- double; the double valueunit
- U; the unitpublic static final Frequency createSI(double value)
value
- double; double value in SI unitspublic static Frequency interpolate(Frequency zero, Frequency one, double ratio)
zero
- Frequency; the low valueone
- Frequency; the high valueratio
- double; the ratio between 0 and 1, inclusivepublic static Frequency max(Frequency r1, Frequency r2)
r1
- Frequency; the first scalarr2
- Frequency; the second scalarpublic static Frequency max(Frequency r1, Frequency r2, Frequency... rn)
r1
- Frequency; the first scalarr2
- Frequency; the second scalarrn
- Frequency...; the other scalarspublic static Frequency min(Frequency r1, Frequency r2)
r1
- Frequency; the first scalarr2
- Frequency; the second scalarpublic static Frequency min(Frequency r1, Frequency r2, Frequency... rn)
r1
- Frequency; the first scalarr2
- Frequency; the second scalarrn
- Frequency...; the other scalarspublic final Dimensionless divideBy(Frequency v)
v
- Frequency; Frequency scalarpublic final Dimensionless multiplyBy(Duration v)
v
- Duration; Frequency scalarpublic final Speed multiplyBy(Length v)
v
- Length; Frequency scalarpublic final Acceleration multiplyBy(Speed v)
v
- Speed; Frequency scalarpublic final Power multiplyBy(Energy v)
v
- Energy; Frequency scalarpublic final MoneyPerDuration multiplyBy(Money v)
v
- Money; Frequency scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.