Class MutableMeasureBase<U extends Unit,Base extends Measure<U>,MutSelf extends MutableMeasure<U,Base,MutSelf>>

java.lang.Object
edu.wpi.first.units.mutable.MutableMeasureBase<U,Base,MutSelf>
Type Parameters:
U - The dimension of measurement.
Base - The base measure type.
MutSelf - The self type. This MUST inherit from the base measure type.
All Implemented Interfaces:
Measure<U>, MutableMeasure<U,Base,MutSelf>, Comparable<Measure<U>>
Direct Known Subclasses:
GenericMutableMeasureImpl, MutAcceleration, MutAngle, MutAngularAcceleration, MutAngularMomentum, MutAngularVelocity, MutCurrent, MutDimensionless, MutDistance, MutEnergy, MutForce, MutFrequency, MutLinearAcceleration, MutLinearMomentum, MutLinearVelocity, MutMass, MutMomentOfInertia, MutMult, MutPer, MutPower, MutResistance, MutTemperature, MutTime, MutTorque, MutVelocity, MutVoltage

public abstract class MutableMeasureBase<U extends Unit,Base extends Measure<U>,MutSelf extends MutableMeasure<U,Base,MutSelf>> extends Object implements Measure<U>, MutableMeasure<U,Base,MutSelf>
A partial implementation of MutableMeasure to handle most of the state and Java object- related implementations.
  • Field Details

    • m_magnitude

      protected double m_magnitude
      The magnitude of the measurement, in terms of m_unit.
    • m_baseUnitMagnitude

      protected double m_baseUnitMagnitude
      The magnitude of the measurement, in terms of m_unit's base unit.
    • m_unit

      protected U extends Unit m_unit
      The unit of measurement.
  • Constructor Details

    • MutableMeasureBase

      protected MutableMeasureBase(double magnitude, double baseUnitMagnitude, U unit)
      Initializes the mutable measure with initial conditions. Both relative and base unit magnitudes are required to avoid unnecessary calculations. It is up to the caller to ensure they are correct.
      Parameters:
      magnitude - the initial magnitude of the measure, in terms of the unit
      baseUnitMagnitude - the initial magnitude of the measure, in terms of the base unit
      unit - the initial unit of measure
  • Method Details