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 unit
A - the absolute scalar type belonging to the absolute vector type
AV - the absolute vector type
RU - the relative unit belonging to the absolute unit
R - the relative scalar type belonging to the relative vector type
RV - the relative vector type with this unit
All Superinterfaces:
Cloneable, IndexedValue<RU,​R,​RV>, 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
Enclosing interface:
Vector<U extends Unit<U>,​S extends Scalar<U,​S>,​V extends Vector<U,​S,​V>>

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-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
  • Method Details

    • 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