Class DoubleScalarAbs<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<AU,A>
org.djunits.value.vdouble.scalar.base.DoubleScalarAbs<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<A>,Absolute<AU,,A, RU, R> Value<AU,A>
- Direct Known Subclasses:
AbsoluteTemperature,Direction,Position,Time
public abstract class DoubleScalarAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends DoubleScalarAbs<AU,A,RU,R>,RU extends Unit<RU>,R extends DoubleScalarRelWithAbs<AU,A,RU,R>>
extends DoubleScalar<AU,A>
implements Absolute<AU,A,RU,R>
The typed, abstract DoubleScalarAbs class that forms the basis of all DoubleScalar 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-2025 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
ConstructorsConstructorDescriptionDoubleScalarAbs(double value, AU unit) Construct a new Absolute Immutable DoubleScalar.DoubleScalarAbs(A value) Construct a new Absolute Immutable DoubleScalar from an existing Absolute Immutable DoubleScalar. -
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).floor()Return a new Scalar/Vector/Matrix with the nearest integer value(s) below the current value(s).abstract AinstantiateAbs(double value, AU unit) Construct a new Absolute Immutable DoubleScalar of the right type.abstract RinstantiateRel(double value, RU unit) Construct a new Relative Immutable DoubleScalar of the right type.final RSubtract an Absolute value from this Absolute value, resulting in a Relative value.final ASubtract a Relative value from this Absolute value.neg()Return a new Scalar/Vector/Matrix with negated value(s).final AAdd a Relative value to this Absolute value.rint()Return a new Scalar/Vector/Matrix with the nearest integer value(s).Methods inherited from class org.djunits.value.vdouble.scalar.base.DoubleScalar
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, toStringSIPrefixed, toStringSIPrefixed, toTextualString, toTextualStringMethods inherited from class org.djunits.value.base.Scalar
format, format, getDisplayUnit, setDisplayUnitMethods inherited from class java.lang.Number
byteValue, shortValueMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djunits.value.Value
isAbsolute, isRelative
-
Constructor Details
-
DoubleScalarAbs
Construct a new Absolute Immutable DoubleScalar.- Parameters:
value- the value of the new Absolute Immutable DoubleScalarunit- the unit of the new Absolute Immutable DoubleScalar
-
DoubleScalarAbs
Construct a new Absolute Immutable DoubleScalar from an existing Absolute Immutable DoubleScalar.- Parameters:
value- the reference
-
-
Method Details
-
instantiateRel
Construct a new Relative Immutable DoubleScalar of the right type. Each extending class must implement this method.- Parameters:
value- the double valueunit- the unit- Returns:
- R a new relative instance of the DoubleScalar of the right type
-
instantiateAbs
Construct a new Absolute Immutable DoubleScalar of the right type. Each extending class must implement this method.- Parameters:
value- the double valueunit- the absolute unit- Returns:
- A a new absolute instance of the DoubleScalar of the right type
-
plus
Description copied from interface:AbsoluteAdd a Relative value to this Absolute value. A new value is returned due to immutability. -
minus
Description copied from interface:AbsoluteSubtract a Relative value from this Absolute value. A new value is returned due to immutability. -
minus
Description copied from interface:AbsoluteSubtract an Absolute value from this Absolute value, resulting in a Relative value. A new value is returned due to immutability. -
abs
Description copied from interface:ValueReturn a new Scalar/Vector/Matrix with absolute value(s). -
ceil
Description copied from interface:ValueReturn a new Scalar/Vector/Matrix with the nearest integer value(s) above the current value(s). -
floor
Description copied from interface:ValueReturn a new Scalar/Vector/Matrix with the nearest integer value(s) below the current value(s). -
neg
Description copied from interface:ValueReturn a new Scalar/Vector/Matrix with negated value(s). -
rint
Description copied from interface:ValueReturn 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.
-