Interface Vector.Rel<U extends Unit<U>,​S extends Scalar<U,​S>,​RV extends Vector.Rel<U,​S,​RV>>

Type Parameters:
U - the unit
S - the scalar type belonging to the vector type
RV - the relative vector type with this unit
All Superinterfaces:
Cloneable, IndexedValue<U,​S,​RV>, Relative<U,​RV>, Serializable, Value<U,​RV>, ValueFunctions<U,​RV>, Vector<U,​S,​RV>
All Known Subinterfaces:
Vector.RelWithAbs<AU,​A,​AV,​RU,​R,​RV>
All Known Implementing Classes:
AbsorbedDoseVector, AbstractDoubleVectorRel, AbstractDoubleVectorRelWithAbs, AbstractFloatVectorRel, AbstractFloatVectorRelWithAbs, AccelerationVector, AmountOfSubstanceVector, AngleVector, AreaVector, CatalyticActivityVector, DensityVector, DimensionlessVector, DurationVector, ElectricalCapacitanceVector, ElectricalChargeVector, ElectricalConductanceVector, ElectricalCurrentVector, ElectricalInductanceVector, ElectricalPotentialVector, ElectricalResistanceVector, EnergyVector, EquivalentDoseVector, FloatAbsorbedDoseVector, FloatAccelerationVector, FloatAmountOfSubstanceVector, FloatAngleVector, FloatAreaVector, FloatCatalyticActivityVector, FloatDensityVector, FloatDimensionlessVector, FloatDurationVector, FloatElectricalCapacitanceVector, FloatElectricalChargeVector, FloatElectricalConductanceVector, FloatElectricalCurrentVector, FloatElectricalInductanceVector, FloatElectricalPotentialVector, FloatElectricalResistanceVector, FloatEnergyVector, FloatEquivalentDoseVector, FloatFlowMassVector, FloatFlowVolumeVector, FloatForceVector, FloatFrequencyVector, FloatIlluminanceVector, FloatLengthVector, FloatLinearDensityVector, FloatLuminousFluxVector, FloatLuminousIntensityVector, FloatMagneticFluxDensityVector, FloatMagneticFluxVector, FloatMassVector, FloatPowerVector, FloatPressureVector, FloatRadioActivityVector, FloatSIVector, FloatSolidAngleVector, FloatSpeedVector, FloatTemperatureVector, FloatTorqueVector, FloatVolumeVector, FlowMassVector, FlowVolumeVector, ForceVector, FrequencyVector, IlluminanceVector, LengthVector, LinearDensityVector, LuminousFluxVector, LuminousIntensityVector, MagneticFluxDensityVector, MagneticFluxVector, MassVector, PowerVector, PressureVector, RadioActivityVector, SIVector, SolidAngleVector, SpeedVector, TemperatureVector, TorqueVector, VolumeVector
Enclosing interface:
Vector<U extends Unit<U>,​S extends Scalar<U,​S>,​V extends Vector<U,​S,​V>>

public static interface Vector.Rel<U extends Unit<U>,​S extends Scalar<U,​S>,​RV extends Vector.Rel<U,​S,​RV>>
extends Vector<U,​S,​RV>, Relative<U,​RV>
Methods for Relative Vector. A possible way to implement this interface is:
   class AreaVector implements Vector.Rel<AreaUnit, Area, AreaVector>
 
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

      RV plus​(RV increment) throws ValueRuntimeException
      Add a relative vector to this relative mutable 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 - RV; the relative vector (mutable or immutable, sparse or dense) to add
      Returns:
      RMV; the sum of this vector and the operand as a new relative, mutable vector
      Throws:
      ValueRuntimeException - in case this vector and the operand have a different size
    • minus

      RV minus​(RV decrement) throws ValueRuntimeException
      Subtract a relative vector from this relative mutable vector. The display unit of the result 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 value to subtract
      Returns:
      RMV; the difference of this vector and the operand as a new relative, mutable vector
      Throws:
      ValueRuntimeException - in case this vector and the operand have a different size
    • multiplyBy

      RV multiplyBy​(double multiplier)
      Multiply all values of this vector by the multiplier. This only works if the vector is mutable.
      Parameters:
      multiplier - double; the factor by which to multiply all values
      Returns:
      V; this modified vector
      Throws:
      ValueRuntimeException - in case the vector is immutable
    • divideBy

      RV divideBy​(double divisor)
      Divide all values of this vector by the divisor. This only works if the vector is mutable.
      Parameters:
      divisor - double; the value by which to divide all values
      Returns:
      V; this modified vector
      Throws:
      ValueRuntimeException - in case the vector is immutable