Package org.djunits.value.base
Interface Vector.Abs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar<AU,A>,AV extends Vector.Abs<AU,A,AV,RU,R,RV>,RU extends Unit<RU>,R extends Scalar<RU,R>,RV extends Vector.RelWithAbs<AU,A,AV,RU,R,RV>>
- Type Parameters:
AU
- the absolute unit belonging to the relative unitA
- the absolute scalar type belonging to the absolute vector typeAV
- the absolute vector typeRU
- the relative unit belonging to the absolute unitR
- the relative scalar type belonging to the relative vector typeRV
- the relative vector type with this unit
- All Superinterfaces:
Absolute
,Cloneable
,IndexedValue<AU,A,AV>
,Iterable<A>
,Serializable
,Value<AU,AV>
,ValueFunctions<AU,AV>
,Vector<AU,A,AV>
- All Known Implementing Classes:
AbsoluteTemperatureVector
,AbstractDoubleVectorAbs
,AbstractFloatVectorAbs
,DirectionVector
,FloatAbsoluteTemperatureVector
,FloatDirectionVector
,FloatPositionVector
,FloatTimeVector
,PositionVector
,TimeVector
public static interface Vector.Abs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar<AU,A>,AV extends Vector.Abs<AU,A,AV,RU,R,RV>,RU extends Unit<RU>,R extends Scalar<RU,R>,RV extends Vector.RelWithAbs<AU,A,AV,RU,R,RV>> extends Vector<AU,A,AV>, Absolute
Methods for Absolute Vector. An example is the absolute vector Position that has a corresponding relative vector Length.
A possible way to implement this interface is:
BSD-style license. See DJUNITS License.
class PositionVector implements Vector.Abs< PositionUnit, Position, PositionVector, LengthUnit, Length, LengthVector>Copyright (c) 2019-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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.djunits.value.base.Vector
Vector.Abs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar<AU,A>,AV extends Vector.Abs<AU,A,AV,RU,R,RV>,RU extends Unit<RU>,R extends Scalar<RU,R>,RV extends Vector.RelWithAbs<AU,A,AV,RU,R,RV>>, Vector.Rel<U extends Unit<U>,S extends Scalar<U,S>,RV extends Vector.Rel<U,S,RV>>, Vector.RelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar<AU,A>,AV extends Vector.Abs<AU,A,AV,RU,R,RV>,RU extends Unit<RU>,R extends Scalar<RU,R>,RV extends Vector.RelWithAbs<AU,A,AV,RU,R,RV>>
-
Method Summary
Methods inherited from interface org.djunits.value.IndexedValue
cardinality, getScalarClass, getStorageType, immutable, isDense, isMutable, isSparse, mutable, toDense, toSparse
Methods inherited from interface org.djunits.value.Value
getDisplayUnit, isAbsolute, isRelative, setDisplayUnit, toString, toString, toString, toString
-
Method Details
-
plus
Add a relative vector to this absolute vector. A new absolute vector is returned. The display unit of the new vector is the display unit of this absolute vector. The addition is done value by value and the result is stored in a new vector. If both operands are sparse, the result is a sparse vector, otherwise the result is a dense vector.- Parameters:
increment
- RV; the relative vector (mutable or immutable, sparse or dense) to add to this absolute vector- Returns:
- AIV; the sum of this value and the operand as a new absolute, immutable vector
- Throws:
ValueRuntimeException
- in case this vector and the operand have a different size
-
minus
Subtract a relative vector from this absolute vector. A new absolute vector is returned. The display unit of the new vector is the display unit of this absolute vector. The subtraction is done value by value and the result is stored in a new vector. If both operands are sparse, the result is a sparse vector, otherwise the result is a dense vector.- Parameters:
decrement
- RV; the relative vector (mutable or immutable, sparse or dense) to subtract from this absolute vector- Returns:
- AIV; the difference of this value and the operand as a new absolute, immutable vector
- Throws:
ValueRuntimeException
- in case this vector and the operand have a different size
-
minus
Subtract an absolute vector from this absolute vector. A new relative vector is returned. The display unit of the new vector is the display unit of relative counterpart of the display unit of this absolute vector. The subtraction is done value by value and the result is stored in a new vector. If both operands are sparse, the result is a sparse vector, otherwise the result is a dense vector.- Parameters:
decrement
- AV; the absolute vector (mutable or immutable, sparse or dense) to subtract from this absolute vector- Returns:
- RIV; the difference of this value and the operand as a new relative, immutable vector
- Throws:
ValueRuntimeException
- in case this vector and the operand have a different size
-