Package org.djunits.value.base
Interface Vector.Rel<U extends Unit<U>,S extends Scalar<U,S>,RV extends Vector.Rel<U,S,RV>>
-
- Type Parameters:
U
- the unitS
- the scalar type belonging to the vector typeRV
- the relative vector type with this unit
- All Superinterfaces:
Cloneable
,IndexedValue<U,S,RV>
,Iterable<S>
,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
,AngularAccelerationVector
,AngularVelocityVector
,AreaVector
,CatalyticActivityVector
,DensityVector
,DimensionlessVector
,DurationVector
,ElectricalCapacitanceVector
,ElectricalChargeVector
,ElectricalConductanceVector
,ElectricalCurrentVector
,ElectricalInductanceVector
,ElectricalPotentialVector
,ElectricalResistanceVector
,EnergyVector
,EquivalentDoseVector
,FloatAbsorbedDoseVector
,FloatAccelerationVector
,FloatAmountOfSubstanceVector
,FloatAngleVector
,FloatAngularAccelerationVector
,FloatAngularVelocityVector
,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
,FloatMomentumVector
,FloatPowerVector
,FloatPressureVector
,FloatRadioActivityVector
,FloatSIVector
,FloatSolidAngleVector
,FloatSpeedVector
,FloatTemperatureVector
,FloatTorqueVector
,FloatVolumeVector
,FlowMassVector
,FlowVolumeVector
,ForceVector
,FrequencyVector
,IlluminanceVector
,LengthVector
,LinearDensityVector
,LuminousFluxVector
,LuminousIntensityVector
,MagneticFluxDensityVector
,MagneticFluxVector
,MassVector
,MomentumVector
,PowerVector
,PressureVector
,RadioActivityVector
,SIVector
,SolidAngleVector
,SpeedVector
,TemperatureVector
,TorqueVector
,VolumeVector
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-2023 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 RV
divideBy(double divisor)
Divide all values of this vector by the divisor.RV
minus(RV decrement)
Subtract a relative vector from this relative mutable vector.RV
multiplyBy(double multiplier)
Multiply all values of this vector by the multiplier.RV
plus(RV increment)
Add a relative vector to this relative mutable 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
-
-
-
-
Method Detail
-
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
-
-