Class DoubleScalarRelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends DoubleScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends DoubleScalarRelWithAbs<AU,A,RU,R>>
java.lang.Object
java.lang.Number
org.djunits.value.base.Scalar<U,S>
org.djunits.value.vdouble.scalar.base.DoubleScalar<U,R>
org.djunits.value.vdouble.scalar.base.DoubleScalarRel<RU,R>
org.djunits.value.vdouble.scalar.base.DoubleScalarRelWithAbs<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>
,Relative<RU,
,R> RelWithAbs<AU,
,A, RU, R> Value<RU,
R>
- Direct Known Subclasses:
Angle
,Duration
,Length
,Temperature
public abstract class DoubleScalarRelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends DoubleScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends DoubleScalarRelWithAbs<AU,A,RU,R>>
extends DoubleScalarRel<RU,R>
implements RelWithAbs<AU,A,RU,R>
The typed, abstract DoubleScalarRelWithAbs class that forms the basis of the relative DoubleScalars suck as Duration that
have an absolute equivalent such as Time.
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.vdouble.scalar.base.DoubleScalar
si
-
Constructor Summary
ConstructorDescriptionDoubleScalarRelWithAbs
(double value, RU unit) Construct a new Relative Immutable DoubleScalar.DoubleScalarRelWithAbs
(R value) Construct a new Relative Immutable DoubleScalar from an existing Relative Immutable DoubleScalar. -
Method Summary
Methods inherited from class org.djunits.value.vdouble.scalar.base.DoubleScalarRel
abs, ceil, divide, divide, divide, floor, instantiateRel, minus, neg, plus, reciprocal, rint, times, times, times
Methods inherited from class org.djunits.value.vdouble.scalar.base.DoubleScalar
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.Relative
divide, divide, minus, plus, times, times
Methods inherited from interface org.djunits.value.Value
isAbsolute, isRelative
-
Constructor Details
-
DoubleScalarRelWithAbs
Construct a new Relative Immutable DoubleScalar.- Parameters:
value
- double; the value of the new Relative Immutable DoubleScalarunit
- RU; the unit of the new Relative Immutable DoubleScalar
-
DoubleScalarRelWithAbs
Construct a new Relative Immutable DoubleScalar from an existing Relative Immutable DoubleScalar.- Parameters:
value
- R, a relative typed DoubleScalar; the reference
-
-
Method Details
-
instantiateAbs
Construct a new Absolute Immutable DoubleScalar of the right type. Each extending class must implement this method.- Parameters:
value
- double; the double valueunit
- AU; the absolute unit- Returns:
- A a new absolute instance of the DoubleScalar of the right type
-
plus
Description copied from interface:RelWithAbs
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.
-