Class AbstractFloatScalarRelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends AbstractFloatScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends AbstractFloatScalarRelWithAbs<AU,A,RU,R>>
- java.lang.Object
-
- java.lang.Number
-
- org.djunits.value.AbstractScalar<U,S>
-
- org.djunits.value.vfloat.scalar.base.AbstractFloatScalar<U,R>
-
- org.djunits.value.vfloat.scalar.base.AbstractFloatScalarRel<RU,R>
-
- org.djunits.value.vfloat.scalar.base.AbstractFloatScalarRelWithAbs<AU,A,RU,R>
-
- Type Parameters:
AU
- the absolute unitA
- the Absolute class for reference purposesRU
- the relative unitR
- the Relative class for reference purposes
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<R>
,Scalar<RU,R>
,Scalar.Rel<RU,R>
,Scalar.RelWithAbs<AU,A,RU,R>
,ValueFunctions<RU,R>
,Relative<RU,R>
,Value<RU,R>
,FloatScalarInterface<RU,R>
,FloatScalarInterface.Rel<RU,R>
,FloatScalarInterface.RelWithAbs<AU,A,RU,R>
- Direct Known Subclasses:
FloatAngle
,FloatDuration
,FloatLength
,FloatTemperature
public abstract class AbstractFloatScalarRelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends AbstractFloatScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends AbstractFloatScalarRelWithAbs<AU,A,RU,R>> extends AbstractFloatScalarRel<RU,R> implements FloatScalarInterface.RelWithAbs<AU,A,RU,R>
The typed, abstract FloatScalarRelWithAbs class that forms the basis of the relative FloatScalars suck as Duration that have an absolute equivalent such as Time.Copyright (c) 2013-2020 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, Wouter Schakel
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.djunits.value.vfloat.scalar.base.FloatScalarInterface
FloatScalarInterface.Abs<AU extends AbsoluteLinearUnit<AU,RU>,A extends FloatScalarInterface.Abs<AU,A,RU,R>,RU extends Unit<RU>,R extends FloatScalarInterface.RelWithAbs<AU,A,RU,R>>, FloatScalarInterface.Rel<U extends Unit<U>,R extends FloatScalarInterface.Rel<U,R>>, FloatScalarInterface.RelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends FloatScalarInterface.Abs<AU,A,RU,R>,RU extends Unit<RU>,R extends FloatScalarInterface.RelWithAbs<AU,A,RU,R>>
-
Nested classes/interfaces inherited from interface org.djunits.value.base.Scalar
Scalar.Abs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar.Abs<AU,A,RU,R>,RU extends Unit<RU>,R extends Scalar.RelWithAbs<AU,A,RU,R>>, Scalar.Rel<U extends Unit<U>,R extends Scalar.Rel<U,R>>, Scalar.RelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar.Abs<AU,A,RU,R>,RU extends Unit<RU>,R extends Scalar.RelWithAbs<AU,A,RU,R>>
-
-
Field Summary
-
Fields inherited from class org.djunits.value.vfloat.scalar.base.AbstractFloatScalar
si
-
-
Constructor Summary
Constructors Constructor Description AbstractFloatScalarRelWithAbs(float value, RU unit)
Construct a new Relative Immutable FloatScalar.AbstractFloatScalarRelWithAbs(R value)
Construct a new Relative Immutable FloatScalar from an existing Relative Immutable FloatScalar.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description A
plus(A increment)
Add an Absolute value to this relative value.-
Methods inherited from class org.djunits.value.vfloat.scalar.base.AbstractFloatScalarRel
abs, ceil, divide, divide, divide, floor, minus, neg, plus, reciprocal, rint, times, times, times
-
Methods inherited from class org.djunits.value.vfloat.scalar.base.AbstractFloatScalar
compareTo, doubleValue, eq, eq0, equals, floatValue, ge, ge0, getInUnit, getInUnit, getSI, gt, gt0, hashCode, intValue, le, le0, longValue, lt, lt0, ne, ne0, toDisplayString, toDisplayString, toString, toString, toString, toString, toTextualString, toTextualString
-
Methods inherited from class org.djunits.value.AbstractScalar
getDisplayUnit, isAbsolute, isRelative, 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 java.lang.Comparable
compareTo
-
Methods inherited from interface org.djunits.value.vfloat.scalar.base.FloatScalarInterface
getInUnit, getInUnit, getSI
-
Methods inherited from interface org.djunits.value.vfloat.scalar.base.FloatScalarInterface.Rel
instantiateRel
-
Methods inherited from interface org.djunits.value.vfloat.scalar.base.FloatScalarInterface.RelWithAbs
instantiateAbs, instantiateRel
-
Methods inherited from interface org.djunits.value.base.Scalar
eq, eq0, ge, ge0, gt, gt0, le, le0, lt, lt0, ne, ne0, toDisplayString, toDisplayString, toTextualString, toTextualString
-
Methods inherited from interface org.djunits.value.base.Scalar.Rel
minus, plus
-
Methods inherited from interface org.djunits.value.Value
getDisplayUnit, isAbsolute, isRelative, setDisplayUnit, toString, toString, toString, toString
-
-
-
-
Constructor Detail
-
AbstractFloatScalarRelWithAbs
public AbstractFloatScalarRelWithAbs(float value, RU unit)
Construct a new Relative Immutable FloatScalar.- Parameters:
value
- float; the value of the new Relative Immutable FloatScalarunit
- RU; the unit of the new Relative Immutable FloatScalar
-
AbstractFloatScalarRelWithAbs
public AbstractFloatScalarRelWithAbs(R value)
Construct a new Relative Immutable FloatScalar from an existing Relative Immutable FloatScalar.- Parameters:
value
- R, a relative typed FloatScalar; the reference
-
-
Method Detail
-
plus
public A plus(A increment)
Add an Absolute value to this relative value. A new value is returned due to immutability. The unit of the result is the unit of the absolute operand.- Specified by:
plus
in interfaceScalar.RelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends AbstractFloatScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends AbstractFloatScalarRelWithAbs<AU,A,RU,R>>
- Parameters:
increment
- A; A the right operand- Returns:
- A; the sum of this value and the operand
-
-