Class FloatScalarRel<U extends Unit<U>,R extends FloatScalarRel<U,R>>
java.lang.Object
java.lang.Number
org.djunits.value.base.Scalar<U,S>
org.djunits.value.vfloat.scalar.base.FloatScalar<U,R>
org.djunits.value.vfloat.scalar.base.FloatScalarRel<U,R>
- Type Parameters:
U
- the unitR
- the Relative class for reference purposes
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<R>
,Relative<U,
,R> Value<U,
R>
- Direct Known Subclasses:
FloatAbsorbedDose
,FloatAcceleration
,FloatAmountOfSubstance
,FloatAngularAcceleration
,FloatAngularVelocity
,FloatArea
,FloatCatalyticActivity
,FloatDensity
,FloatDimensionless
,FloatElectricalCapacitance
,FloatElectricalCharge
,FloatElectricalConductance
,FloatElectricalCurrent
,FloatElectricalInductance
,FloatElectricalPotential
,FloatElectricalResistance
,FloatEnergy
,FloatEquivalentDose
,FloatFlowMass
,FloatFlowVolume
,FloatForce
,FloatFrequency
,FloatIlluminance
,FloatLinearDensity
,FloatLuminousFlux
,FloatLuminousIntensity
,FloatMagneticFlux
,FloatMagneticFluxDensity
,FloatMass
,FloatMomentum
,FloatPower
,FloatPressure
,FloatRadioActivity
,FloatScalarRelWithAbs
,FloatSIScalar
,FloatSolidAngle
,FloatSpeed
,FloatTorque
,FloatVolume
public abstract class FloatScalarRel<U extends Unit<U>,R extends FloatScalarRel<U,R>>
extends FloatScalar<U,R>
implements Relative<U,R>
The typed, abstract FloatScalarRel class that forms the basis of all FloatScalar definitions and extensions.
Note: A relative scalar class can implement the toAbs() method if it has an absolute equivalent.
Note: A relative scalar class can implement the toAbs() method if it has an absolute equivalent.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
-
Field Summary
Fields inherited from class org.djunits.value.vfloat.scalar.base.FloatScalar
si
-
Constructor Summary
ConstructorDescriptionFloatScalarRel
(float value, U unit) Construct a new Relative Immutable FloatScalar.FloatScalarRel
(R value) Construct a new Relative Immutable FloatScalar from an existing Relative Immutable FloatScalar. -
Method Summary
Modifier and TypeMethodDescriptionabs()
Return a new Scalar/Vector/Matrix with absolute value(s).ceil()
Return a new Scalar/Vector/Matrix with the nearest integer value(s) above the current value(s).divide
(double constant) Returns a new scalar/vector/matrix with value(s) divided by a factor.divide
(float constant) Returns a new scalar/vector/matrix with value(s) divided by a factor.divide
(FloatScalarRel<?, ?> otherScalar) Divide this scalar by another scalar and create a new scalar.floor()
Return a new Scalar/Vector/Matrix with the nearest integer value(s) below the current value(s).abstract R
instantiateRel
(float value, U unit) Construct a new Relative Immutable FloatScalar of the right type.final R
Subtract a Relative value from this Relative value.neg()
Return a new Scalar/Vector/Matrix with negated value(s).final R
Add a Relative value to this Relative value.abstract FloatScalarRel<?,
?> Create the reciprocal of this scalar with the correct dimensions.rint()
Return a new Scalar/Vector/Matrix with the nearest integer value(s).times
(double constant) Returns a new scalar/vector/matrix with value(s) multiplied by a factor.times
(float constant) Returns a new scalar/vector/matrix with value(s) multiplied by a factor.times
(FloatScalarRel<?, ?> otherScalar) Multiply this scalar by another scalar and create a new scalar.Methods inherited from class org.djunits.value.vfloat.scalar.base.FloatScalar
compareTo, divide, doubleValue, eq, eq0, equals, floatValue, ge, ge0, getInUnit, getInUnit, getSI, gt, gt0, hashCode, instantiate, instantiateAnonymous, instantiateSI, interpolate, interpolate, intValue, le, le0, longValue, lt, lt0, max, max, min, min, minus, minus, minus, multiply, ne, ne0, plus, plus, plus, toDisplayString, toDisplayString, toString, toString, toString, toString, toStringSIPrefixed, toStringSIPrefixed, toTextualString, toTextualString
Methods inherited from class org.djunits.value.base.Scalar
format, format, getDisplayUnit, setDisplayUnit
Methods inherited from class java.lang.Number
byteValue, shortValue
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.djunits.value.Value
isAbsolute, isRelative
-
Constructor Details
-
FloatScalarRel
Construct a new Relative Immutable FloatScalar.- Parameters:
value
- float; the value of the new Relative Immutable FloatScalarunit
- U; the unit of the new Relative Immutable FloatScalar
-
FloatScalarRel
Construct a new Relative Immutable FloatScalar from an existing Relative Immutable FloatScalar.- Parameters:
value
- R, a relative typed FloatScalar; the reference
-
-
Method Details
-
instantiateRel
Construct a new Relative Immutable FloatScalar of the right type. Each extending class must implement this method.- Parameters:
value
- float; the float valueunit
- U; the unit- Returns:
- R a new relative instance of the FloatScalar of the right type
-
plus
Description copied from interface:Relative
Add a Relative value to this Relative value. A new value is returned due to immutability. -
minus
Description copied from interface:Relative
Subtract a Relative value from this Relative value. A new value is returned due to immutability. -
times
Multiply this scalar by another scalar and create a new scalar.- Parameters:
otherScalar
- FloatScalarRel<?, ?>; the value by which this scalar is multiplied- Returns:
- FloatScalar<?>; a new scalar instance with correct SI dimensions
-
reciprocal
Create the reciprocal of this scalar with the correct dimensions.- Returns:
- FloatScalar<?>; a new scalar instance with correct SI dimensions
-
divide
Divide this scalar by another scalar and create a new scalar.- Parameters:
otherScalar
- FloatScalarRel<?, ?>; the value by which this scalar is divided- Returns:
- FloatScalar<?>; a new scalar instance with correct SI dimensions
-
abs
Description copied from interface:Value
Return a new Scalar/Vector/Matrix with absolute value(s). -
ceil
Description copied from interface:Value
Return a new Scalar/Vector/Matrix with the nearest integer value(s) above the current value(s). -
floor
Description copied from interface:Value
Return a new Scalar/Vector/Matrix with the nearest integer value(s) below the current value(s). -
rint
Description copied from interface:Value
Return a new Scalar/Vector/Matrix with the nearest integer value(s). When the value is exactly in the middle between two integer values, the even one is returned. -
neg
Description copied from interface:Value
Return a new Scalar/Vector/Matrix with negated value(s). -
times
Description copied from interface:Relative
Returns a new scalar/vector/matrix with value(s) multiplied by a factor. -
divide
Description copied from interface:Relative
Returns a new scalar/vector/matrix with value(s) divided by a factor. -
times
Description copied from interface:Relative
Returns a new scalar/vector/matrix with value(s) multiplied by a factor. -
divide
Description copied from interface:Relative
Returns a new scalar/vector/matrix with value(s) divided by a factor.
-