U
- the unitT
- the typepublic class AbstractFloatScalar<U extends Unit<U>,T extends AbstractFloatScalar<U,T>> extends Scalar<U> implements FloatScalarInterface, Comparable<T>
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.
Modifier and Type | Field and Description |
---|---|
float |
si
The value, stored in the standard SI unit.
|
NUMBER_PATTERN
Constructor and Description |
---|
AbstractFloatScalar(U unit,
float si) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(T o) |
double |
doubleValue() |
boolean |
eq(T o)
Test if this Relative FloatScalar is equal to a Relative FloatScalar.
|
boolean |
eq0()
Test if this Relative FloatScalar is equal to 0.0.
|
boolean |
equals(Object obj) |
float |
floatValue() |
boolean |
ge(T o)
Test if this Relative FloatScalar is greater than a Relative FloatScalar.
|
boolean |
ge0()
Test if this Relative FloatScalar is greater than 0.0.
|
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.
|
boolean |
gt(T o)
Test if this Relative FloatScalar is greater than or equal to a Relative FloatScalar.
|
boolean |
gt0()
Test if this Relative FloatScalar is greater than or equal to 0.0.
|
int |
hashCode() |
int |
intValue() |
boolean |
le(T o)
Test if this Relative FloatScalar is less than or equal to a Relative FloatScalar.
|
boolean |
le0()
Test if this Relative FloatScalar is less than or equal to 0.0.
|
long |
longValue() |
boolean |
lt(T o)
Test if this Relative FloatScalar is less than a Relative FloatScalar.
|
boolean |
lt0()
Test if this Relative FloatScalar is less than 0.0.
|
boolean |
ne(T o)
Test if this Relative FloatScalar is not equal to a Relative FloatScalar.
|
boolean |
ne0()
Test if this Relative FloatScalar is not equal to 0.0.
|
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, setDisplayUnit, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocale
byteValue, shortValue
AbstractFloatScalar(U unit, float si)
unit
- U; the unitsi
- float; the si value to storepublic final float getSI()
getSI
in interface FloatScalarInterface
public final boolean lt(T o)
o
- T, a relative typed FloatScalar; the right hand side operand of the comparisonpublic final boolean le(T o)
o
- T, a relative typed FloatScalar; the right hand side operand of the comparisonpublic final boolean gt(T o)
o
- T, a relative typed FloatScalar; the right hand side operand of the comparisonpublic final boolean ge(T o)
o
- T, a relative typed FloatScalar; the right hand side operand of the comparisonpublic final boolean eq(T o)
o
- T, a relative typed FloatScalar; the right hand side operand of the comparisonpublic final boolean ne(T o)
o
- T, a relative typed FloatScalar; the right hand side operand of the comparisonpublic final boolean lt0()
public final boolean le0()
public final boolean gt0()
public final boolean ge0()
public final boolean eq0()
public final boolean ne0()
public final int compareTo(T o)
compareTo
in interface Comparable<T extends AbstractFloatScalar<U,T>>
public final float getInUnit()
public final float getInUnit(U targetUnit)
targetUnit
- U; the unit to convert the value intopublic final double doubleValue()
doubleValue
in class Number
public final float floatValue()
floatValue
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 unitCopyright © 2015–2019 Delft University of Technology. All rights reserved.