Class AbstractDoubleScalarRelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends AbstractDoubleScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends AbstractDoubleScalarRelWithAbs<AU,A,RU,R>>
java.lang.Object
java.lang.Number
org.djunits.value.AbstractScalar<U,S>
org.djunits.value.vdouble.scalar.base.AbstractDoubleScalar<U,R>
org.djunits.value.vdouble.scalar.base.AbstractDoubleScalarRel<RU,R>
org.djunits.value.vdouble.scalar.base.AbstractDoubleScalarRelWithAbs<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>
,DoubleScalarInterface<RU,R>
,DoubleScalarInterface.Rel<RU,R>
,DoubleScalarInterface.RelWithAbs<AU,A,RU,R>
- Direct Known Subclasses:
Angle
,Duration
,Length
,Temperature
public abstract class AbstractDoubleScalarRelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends AbstractDoubleScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends AbstractDoubleScalarRelWithAbs<AU,A,RU,R>> extends AbstractDoubleScalarRel<RU,R> implements DoubleScalarInterface.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-2019 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.vdouble.scalar.base.DoubleScalarInterface
DoubleScalarInterface.Abs<AU extends AbsoluteLinearUnit<AU,RU>,A extends DoubleScalarInterface.Abs<AU,A,RU,R>,RU extends Unit<RU>,R extends DoubleScalarInterface.RelWithAbs<AU,A,RU,R>>, DoubleScalarInterface.Rel<U extends Unit<U>,R extends DoubleScalarInterface.Rel<U,R>>, DoubleScalarInterface.RelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends DoubleScalarInterface.Abs<AU,A,RU,R>,RU extends Unit<RU>,R extends DoubleScalarInterface.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
-
Constructor Summary
Constructors Constructor Description AbstractDoubleScalarRelWithAbs(double value, RU unit)
Construct a new Relative Immutable DoubleScalar.AbstractDoubleScalarRelWithAbs(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.AbstractDoubleScalarRel
abs, ceil, divide, divide, divide, floor, minus, neg, plus, reciprocal, rint, times, times, times
Methods inherited from class org.djunits.value.vdouble.scalar.base.AbstractDoubleScalar
clone, 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.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.djunits.value.vdouble.scalar.base.DoubleScalarInterface
getInUnit, getInUnit, getSI
Methods inherited from interface org.djunits.value.vdouble.scalar.base.DoubleScalarInterface.Rel
instantiateRel
Methods inherited from interface org.djunits.value.vdouble.scalar.base.DoubleScalarInterface.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.Value
getDisplayUnit, isAbsolute, isRelative, setDisplayUnit, toString, toString, toString, toString
-
Constructor Details
-
AbstractDoubleScalarRelWithAbs
Construct a new Relative Immutable DoubleScalar.- Parameters:
value
- double; the value of the new Relative Immutable DoubleScalarunit
- U; the unit of the new Relative Immutable DoubleScalar
-
AbstractDoubleScalarRelWithAbs
Construct a new Relative Immutable DoubleScalar from an existing Relative Immutable DoubleScalar.- Parameters:
value
- R, a relative typed DoubleScalar; the reference
-
-
Method Details
-
plus
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 AbstractDoubleScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends AbstractDoubleScalarRelWithAbs<AU,A,RU,R>>
- Parameters:
increment
- A; A the right operand- Returns:
- A; the sum of this value and the operand
-