Interface Value<U extends Unit<U>,​T extends Value<U,​T>>

Type Parameters:
U - the unit type
T - the value type for this unit
All Superinterfaces:
Cloneable, Serializable, ValueFunctions<U,​T>
All Known Subinterfaces:
DoubleMatrixInterface<U,​S,​V,​M>, DoubleScalarInterface<U,​S>, DoubleScalarInterface.Abs<AU,​A,​RU,​R>, DoubleScalarInterface.Rel<U,​R>, DoubleScalarInterface.RelWithAbs<AU,​A,​RU,​R>, DoubleVectorInterface<U,​S,​V>, FloatMatrixInterface<U,​S,​V,​M>, FloatScalarInterface<U,​S>, FloatScalarInterface.Abs<AU,​A,​RU,​R>, FloatScalarInterface.Rel<U,​R>, FloatScalarInterface.RelWithAbs<AU,​A,​RU,​R>, FloatVectorInterface<U,​S,​V>, IndexedValue<U,​S,​T>, Matrix<U,​S,​V,​M>, Matrix.Abs<AU,​A,​AV,​AM,​RU,​R,​RV,​RM>, Matrix.Rel<U,​S,​V,​RM>, Matrix.RelWithAbs<AU,​A,​AV,​AM,​RU,​R,​RV,​RM>, Scalar<U,​S>, Scalar.Abs<AU,​A,​RU,​R>, Scalar.Rel<U,​R>, Scalar.RelWithAbs<AU,​A,​RU,​R>, Vector<U,​S,​V>, Vector.Abs<AU,​A,​AV,​RU,​R,​RV>, Vector.Rel<U,​S,​RV>, Vector.RelWithAbs<AU,​A,​AV,​RU,​R,​RV>
All Known Implementing Classes:
AbsoluteTemperature, AbsoluteTemperatureMatrix, AbsoluteTemperatureVector, AbsorbedDose, AbsorbedDoseMatrix, AbsorbedDoseVector, AbstractDoubleMatrix, AbstractDoubleMatrixAbs, AbstractDoubleMatrixRel, AbstractDoubleMatrixRelWithAbs, AbstractDoubleScalar, AbstractDoubleScalarAbs, AbstractDoubleScalarRel, AbstractDoubleScalarRelWithAbs, AbstractDoubleVector, AbstractDoubleVectorAbs, AbstractDoubleVectorRel, AbstractDoubleVectorRelWithAbs, AbstractFloatMatrix, AbstractFloatMatrixAbs, AbstractFloatMatrixRel, AbstractFloatMatrixRelWithAbs, AbstractFloatScalar, AbstractFloatScalarAbs, AbstractFloatScalarRel, AbstractFloatScalarRelWithAbs, AbstractFloatVector, AbstractFloatVectorAbs, AbstractFloatVectorRel, AbstractFloatVectorRelWithAbs, AbstractIndexedValue, AbstractScalar, AbstractValue, Acceleration, AccelerationMatrix, AccelerationVector, AmountOfSubstance, AmountOfSubstanceMatrix, AmountOfSubstanceVector, Angle, AngleMatrix, AngleVector, Area, AreaMatrix, AreaVector, CatalyticActivity, CatalyticActivityMatrix, CatalyticActivityVector, Density, DensityMatrix, DensityVector, Dimensionless, DimensionlessMatrix, DimensionlessVector, Direction, DirectionMatrix, DirectionVector, 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, FloatAbsoluteTemperature, FloatAbsoluteTemperatureMatrix, FloatAbsoluteTemperatureVector, FloatAbsorbedDose, FloatAbsorbedDoseMatrix, FloatAbsorbedDoseVector, FloatAcceleration, FloatAccelerationMatrix, FloatAccelerationVector, FloatAmountOfSubstance, FloatAmountOfSubstanceMatrix, FloatAmountOfSubstanceVector, FloatAngle, FloatAngleMatrix, FloatAngleVector, FloatArea, FloatAreaMatrix, FloatAreaVector, FloatCatalyticActivity, FloatCatalyticActivityMatrix, FloatCatalyticActivityVector, FloatDensity, FloatDensityMatrix, FloatDensityVector, FloatDimensionless, FloatDimensionlessMatrix, FloatDimensionlessVector, FloatDirection, FloatDirectionMatrix, FloatDirectionVector, 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, FloatPosition, FloatPositionMatrix, FloatPositionVector, FloatPower, FloatPowerMatrix, FloatPowerVector, FloatPressure, FloatPressureMatrix, FloatPressureVector, FloatRadioActivity, FloatRadioActivityMatrix, FloatRadioActivityVector, FloatSIMatrix, FloatSIScalar, FloatSIVector, FloatSolidAngle, FloatSolidAngleMatrix, FloatSolidAngleVector, FloatSpeed, FloatSpeedMatrix, FloatSpeedVector, FloatTemperature, FloatTemperatureMatrix, FloatTemperatureVector, FloatTime, FloatTimeMatrix, FloatTimeVector, FloatTorque, FloatTorqueMatrix, FloatTorqueVector, 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, Position, PositionMatrix, PositionVector, Power, PowerMatrix, PowerVector, Pressure, PressureMatrix, PressureVector, RadioActivity, RadioActivityMatrix, RadioActivityVector, SIMatrix, SIScalar, SIVector, SolidAngle, SolidAngleMatrix, SolidAngleVector, Speed, SpeedMatrix, SpeedVector, Temperature, TemperatureMatrix, TemperatureVector, Time, TimeMatrix, TimeVector, Torque, TorqueMatrix, TorqueVector, Volume, VolumeMatrix, VolumeVector

public interface Value<U extends Unit<U>,​T extends Value<U,​T>>
extends ValueFunctions<U,​T>, Serializable, Cloneable
Value is the generic interface for all Scalar, Vector and Matrix classes that forces implementation of a few unit- and value-related methods.

Copyright (c) 2015-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, Peter Knoppers
  • Method Summary

    Modifier and Type Method Description
    U getDisplayUnit()
    Retrieve the unit of this Value.
    boolean isAbsolute()
    Indicate whether this is an Absolute Value.
    boolean isRelative()
    Indicate whether this is a Relative Value.
    void setDisplayUnit​(U newUnit)
    Set a new display unit for the value.
    String toString()
    Concise description of this value.
    String toString​(boolean verbose, boolean withUnit)
    Somewhat verbose description of this value with optional type and unit information.
    String toString​(U displayUnit)
    Somewhat verbose description of this value with the values expressed in the specified unit.
    String toString​(U displayUnit, boolean verbose, boolean withUnit)
    Somewhat verbose description of this value with the values expressed in the specified unit.

    Methods inherited from interface org.djunits.value.function.ValueFunctions

    abs, ceil, floor, neg, rint
  • Method Details

    • getDisplayUnit

      U getDisplayUnit()
      Retrieve the unit of this Value.
      Returns:
      U; the unit of this Value
    • setDisplayUnit

      void setDisplayUnit​(U newUnit)
      Set a new display unit for the value. Internally, the value will stay stored in the default or SI unit.
      Parameters:
      newUnit - U; the new display unit of this Value
    • isAbsolute

      boolean isAbsolute()
      Indicate whether this is an Absolute Value.
      Returns:
      boolean
    • isRelative

      boolean isRelative()
      Indicate whether this is a Relative Value.
      Returns:
      boolean
    • toString

      String toString()
      Concise description of this value.
      Overrides:
      toString in class Object
      Returns:
      a String with the value, non-verbose, with the unit attached.
    • toString

      String toString​(U displayUnit)
      Somewhat verbose description of this value with the values expressed in the specified unit.
      Parameters:
      displayUnit - U; the unit into which the values are converted for display
      Returns:
      String; printable string with the value contents expressed in the specified unit
    • toString

      String toString​(boolean verbose, boolean withUnit)
      Somewhat verbose description of this value with optional type and unit information.
      Parameters:
      verbose - boolean; if true; include type info; if false; exclude type info
      withUnit - boolean; if true; include the unit; of false; exclude the unit
      Returns:
      String; printable string with the value contents
    • toString

      String toString​(U displayUnit, boolean verbose, boolean withUnit)
      Somewhat verbose description of this value with the values expressed in the specified unit.
      Parameters:
      displayUnit - U; the unit into which the values are converted for display
      verbose - boolean; if true; include type info; if false; exclude type info
      withUnit - boolean; if true; include the unit; of false; exclude the unit
      Returns:
      String; printable string with the value contents