Interface Relative<U extends Unit<U>,R extends Relative<U,R>>

Type Parameters:
U - the unit type
R - the relative value type
All Known Subinterfaces:
RelWithAbs<AU,A,RU,R>
All Known Implementing Classes:
AbsorbedDose, AbsorbedDoseMatrix, AbsorbedDoseVector, Acceleration, AccelerationMatrix, AccelerationVector, AmountOfSubstance, AmountOfSubstanceMatrix, AmountOfSubstanceVector, Angle, AngleMatrix, AngleVector, AngularAcceleration, AngularAccelerationMatrix, AngularAccelerationVector, AngularVelocity, AngularVelocityMatrix, AngularVelocityVector, Area, AreaMatrix, AreaVector, CatalyticActivity, CatalyticActivityMatrix, CatalyticActivityVector, Density, DensityMatrix, DensityVector, Dimensionless, DimensionlessMatrix, DimensionlessVector, DoubleMatrixRel, DoubleMatrixRelWithAbs, DoubleScalarRel, DoubleScalarRelWithAbs, DoubleVectorRel, DoubleVectorRelWithAbs, Duration, DurationMatrix, DurationVector, ElectricalCapacitance, ElectricalCapacitanceMatrix, ElectricalCapacitanceVector, ElectricalCharge, ElectricalChargeMatrix, ElectricalChargeVector, ElectricalConductance, ElectricalConductanceMatrix, ElectricalConductanceVector, ElectricalCurrent, ElectricalCurrentMatrix, ElectricalCurrentVector, ElectricalInductance, ElectricalInductanceMatrix, ElectricalInductanceVector, ElectricalPotential, ElectricalPotentialMatrix, ElectricalPotentialVector, ElectricalResistance, ElectricalResistanceMatrix, ElectricalResistanceVector, Energy, EnergyMatrix, EnergyVector, EquivalentDose, EquivalentDoseMatrix, EquivalentDoseVector, FloatAbsorbedDose, FloatAbsorbedDoseMatrix, FloatAbsorbedDoseVector, FloatAcceleration, FloatAccelerationMatrix, FloatAccelerationVector, FloatAmountOfSubstance, FloatAmountOfSubstanceMatrix, FloatAmountOfSubstanceVector, FloatAngle, FloatAngleMatrix, FloatAngleVector, FloatAngularAcceleration, FloatAngularAccelerationMatrix, FloatAngularAccelerationVector, FloatAngularVelocity, FloatAngularVelocityMatrix, FloatAngularVelocityVector, FloatArea, FloatAreaMatrix, FloatAreaVector, FloatCatalyticActivity, FloatCatalyticActivityMatrix, FloatCatalyticActivityVector, FloatDensity, FloatDensityMatrix, FloatDensityVector, FloatDimensionless, FloatDimensionlessMatrix, FloatDimensionlessVector, FloatDuration, FloatDurationMatrix, FloatDurationVector, FloatElectricalCapacitance, FloatElectricalCapacitanceMatrix, FloatElectricalCapacitanceVector, FloatElectricalCharge, FloatElectricalChargeMatrix, FloatElectricalChargeVector, FloatElectricalConductance, FloatElectricalConductanceMatrix, FloatElectricalConductanceVector, FloatElectricalCurrent, FloatElectricalCurrentMatrix, FloatElectricalCurrentVector, FloatElectricalInductance, FloatElectricalInductanceMatrix, FloatElectricalInductanceVector, FloatElectricalPotential, FloatElectricalPotentialMatrix, FloatElectricalPotentialVector, FloatElectricalResistance, FloatElectricalResistanceMatrix, FloatElectricalResistanceVector, FloatEnergy, FloatEnergyMatrix, FloatEnergyVector, FloatEquivalentDose, FloatEquivalentDoseMatrix, FloatEquivalentDoseVector, FloatFlowMass, FloatFlowMassMatrix, FloatFlowMassVector, FloatFlowVolume, FloatFlowVolumeMatrix, FloatFlowVolumeVector, FloatForce, FloatForceMatrix, FloatForceVector, FloatFrequency, FloatFrequencyMatrix, FloatFrequencyVector, FloatIlluminance, FloatIlluminanceMatrix, FloatIlluminanceVector, FloatLength, FloatLengthMatrix, FloatLengthVector, FloatLinearDensity, FloatLinearDensityMatrix, FloatLinearDensityVector, FloatLuminousFlux, FloatLuminousFluxMatrix, FloatLuminousFluxVector, FloatLuminousIntensity, FloatLuminousIntensityMatrix, FloatLuminousIntensityVector, FloatMagneticFlux, FloatMagneticFluxDensity, FloatMagneticFluxDensityMatrix, FloatMagneticFluxDensityVector, FloatMagneticFluxMatrix, FloatMagneticFluxVector, FloatMass, FloatMassMatrix, FloatMassVector, FloatMatrixRel, FloatMatrixRelWithAbs, FloatMomentum, FloatMomentumMatrix, FloatMomentumVector, FloatPower, FloatPowerMatrix, FloatPowerVector, FloatPressure, FloatPressureMatrix, FloatPressureVector, FloatRadioActivity, FloatRadioActivityMatrix, FloatRadioActivityVector, FloatScalarRel, FloatScalarRelWithAbs, FloatSIMatrix, FloatSIScalar, FloatSIVector, FloatSolidAngle, FloatSolidAngleMatrix, FloatSolidAngleVector, FloatSpeed, FloatSpeedMatrix, FloatSpeedVector, FloatTemperature, FloatTemperatureMatrix, FloatTemperatureVector, FloatTorque, FloatTorqueMatrix, FloatTorqueVector, FloatVectorRel, FloatVectorRelWithAbs, FloatVolume, FloatVolumeMatrix, FloatVolumeVector, FlowMass, FlowMassMatrix, FlowMassVector, FlowVolume, FlowVolumeMatrix, FlowVolumeVector, Force, ForceMatrix, ForceVector, Frequency, FrequencyMatrix, FrequencyVector, Illuminance, IlluminanceMatrix, IlluminanceVector, Length, LengthMatrix, LengthVector, LinearDensity, LinearDensityMatrix, LinearDensityVector, LuminousFlux, LuminousFluxMatrix, LuminousFluxVector, LuminousIntensity, LuminousIntensityMatrix, LuminousIntensityVector, MagneticFlux, MagneticFluxDensity, MagneticFluxDensityMatrix, MagneticFluxDensityVector, MagneticFluxMatrix, MagneticFluxVector, Mass, MassMatrix, MassVector, Momentum, MomentumMatrix, MomentumVector, Power, PowerMatrix, PowerVector, Pressure, PressureMatrix, PressureVector, RadioActivity, RadioActivityMatrix, RadioActivityVector, SIMatrix, SIScalar, SIVector, SolidAngle, SolidAngleMatrix, SolidAngleVector, Speed, SpeedMatrix, SpeedVector, Temperature, TemperatureMatrix, TemperatureVector, Torque, TorqueMatrix, TorqueVector, Volume, VolumeMatrix, VolumeVector

public interface Relative<U extends Unit<U>,R extends Relative<U,R>>
Relative values express differences. An example is Area or Speed. There is no corresponding absolute type. Values are Relative when adding or subtracting two values does make sense and results in a value of that same type.

Copyright (c) 2015-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.

Author:
Alexander Verbraeck, Peter Knoppers
  • Method Summary

    Modifier and Type
    Method
    Description
    divide(double divisor)
    Returns a new scalar/vector/matrix with value(s) divided by a factor.
    divide(float divisor)
    Returns a new scalar/vector/matrix with value(s) divided by a factor.
    minus(R decrement)
    Subtract a Relative value from this Relative value.
    plus(R increment)
    Add a Relative value to this Relative value.
    times(double multiplier)
    Returns a new scalar/vector/matrix with value(s) multiplied by a factor.
    times(float multiplier)
    Returns a new scalar/vector/matrix with value(s) multiplied by a factor.
  • Method Details

    • plus

      R plus(R increment)
      Add a Relative value to this Relative value. A new value is returned due to immutability.
      Parameters:
      increment - R; the value to add
      Returns:
      R; the sum of this value and the operand as a new object
    • minus

      R minus(R decrement)
      Subtract a Relative value from this Relative value. A new value is returned due to immutability.
      Parameters:
      decrement - R; the value to subtract
      Returns:
      R; the difference of this value and the operand
    • times

      R times(double multiplier)
      Returns a new scalar/vector/matrix with value(s) multiplied by a factor.
      Parameters:
      multiplier - double; the multiplier
      Returns:
      T; a new scalar/vector/matrix
    • divide

      R divide(double divisor)
      Returns a new scalar/vector/matrix with value(s) divided by a factor.
      Parameters:
      divisor - double; the divisor
      Returns:
      T; the modified T
    • times

      R times(float multiplier)
      Returns a new scalar/vector/matrix with value(s) multiplied by a factor.
      Parameters:
      multiplier - float; the multiplier
      Returns:
      T; a new scalar/vector/matrix
    • divide

      R divide(float divisor)
      Returns a new scalar/vector/matrix with value(s) divided by a factor.
      Parameters:
      divisor - float; the divisor
      Returns:
      T; the modified T