Package org.djunits.value.base
Interface 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>>
-
- 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:
Cloneable,IndexedValue<RU,R,RV>,Iterable<R>,Relative<RU,RV>,Serializable,Value<RU,RV>,ValueFunctions<RU,RV>,Vector<RU,R,RV>,Vector.Rel<RU,R,RV>
- All Known Implementing Classes:
AbstractDoubleVectorRelWithAbs,AbstractFloatVectorRelWithAbs,AngleVector,DurationVector,FloatAngleVector,FloatDurationVector,FloatLengthVector,FloatTemperatureVector,LengthVector,TemperatureVector
public static interface 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>> extends Vector.Rel<RU,R,RV>
Additional methods for Relative Vector that has a corresponding Absolute Vector. An example is the relative vector Length that has a corresponding absolute vector Position. A possible way to implement this interface is:class LengthVector implements Vector.RelWithAbs< PositionUnit, Position, PositionVector, LengthUnit, Length, LengthVector>Copyright (c) 2019-2022 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AVplus(AV increment)Add an absolute vector to this relative vector.-
Methods inherited from interface org.djunits.value.IndexedValue
cardinality, getScalarClass, getStorageType, immutable, isDense, isMutable, isSparse, mutable, toDense, toSparse
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.djunits.value.Value
getDisplayUnit, isAbsolute, isRelative, setDisplayUnit, toString, toString, toString, toString
-
Methods inherited from interface org.djunits.value.function.ValueFunctions
abs, ceil, floor, neg, rint
-
Methods inherited from interface org.djunits.value.base.Vector
get, getScalars, iterator, size
-
Methods inherited from interface org.djunits.value.base.Vector.Rel
divideBy, minus, multiplyBy, plus
-
-
-
-
Method Detail
-
plus
AV plus(AV increment)
Add an absolute vector to this relative vector. A new vector is returned. When the vector itself needs to be changed, use the increaseBy(V) method instead. 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- AV; the absolute vector (mutable or immutable, sparse or dense) to add to this relative vector- Returns:
- AMV; the sum of this vector and the operand as a new absolute, mutable vector
- Throws:
ValueRuntimeException- in case this vector and the operand have a different size
-
-