Package org.djunits.value
Class AbstractValue<U extends Unit<U>,T extends Value<U,T>>
- java.lang.Object
-
- org.djunits.value.AbstractValue<U,T>
-
- Type Parameters:
U
- the Unit of the value(s) in this AbstractValue. Used for setting, getting and displaying the value(s)T
- the value type for this unit
- All Implemented Interfaces:
Serializable
,Cloneable
,ValueFunctions<U,T>
,Value<U,T>
- Direct Known Subclasses:
AbstractIndexedValue
public abstract class AbstractValue<U extends Unit<U>,T extends Value<U,T>> extends Object implements Value<U,T>, Serializable
AbstractValue is a class to help construct Scalar, Vector, and Matrix classes.Copyright (c) 2015-2023 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:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractValue(U displayUnit)
Construct a new AbstractValue.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description U
getDisplayUnit()
Retrieve the unit of this Value.boolean
isAbsolute()
Indicate whether this is an Absolute Value.boolean
isRelative()
Indicate whether this is a Relative Value.void
setDisplayUnit(U newUnit)
Set a new display unit for the value.
-
-
-
Constructor Detail
-
AbstractValue
protected AbstractValue(U displayUnit)
Construct a new AbstractValue.- Parameters:
displayUnit
- U; the unit of the new AbstractValue
-
-
Method Detail
-
getDisplayUnit
public final U getDisplayUnit()
Retrieve the unit of this Value.
-
setDisplayUnit
public void setDisplayUnit(U newUnit)
Set a new display unit for the value. Internally, the value will stay stored in the default or SI unit.
-
isAbsolute
public final boolean isAbsolute()
Indicate whether this is an Absolute Value.
-
-