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 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:
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
Enclosing interface:
Vector<U extends Unit<U>,​S extends Scalar<U,​S>,​V extends Vector<U,​S,​V>>

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

    • plus

      AV plus​(RV increment) throws ValueRuntimeException
      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

      AV minus​(RV decrement) throws ValueRuntimeException
      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

      RV minus​(AV decrement) throws ValueRuntimeException
      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