Class Per<N extends Unit<N>,​D extends Unit<D>>

java.lang.Object
edu.wpi.first.units.Unit<Per<N,​D>>
edu.wpi.first.units.Per<N,​D>
Type Parameters:
N - the type of the numerator unit
D - the type of the denominator unit

public class Per<N extends Unit<N>,​D extends Unit<D>>
extends Unit<Per<N,​D>>
Generic combinatory unit type that represents the proportion of one unit to another, such as Meters per Second or Radians per Celsius.

Note: Velocity is used to represent the velocity dimension.

  • Constructor Details

  • Method Details

    • combine

      public static <N extends Unit<N>,​ D extends Unit<D>> Per<N,​D> combine​(N numerator, D denominator)
      Creates a new Per unit derived from an arbitrary numerator and time denominator units. Using a denominator with a unit of time is discouraged; use Velocity instead.
         Per.combine(Volts, Meters) // possible PID constant
       

      It's recommended to use the convenience function Unit.per(Unit) instead of calling this factory directly.

      Type Parameters:
      N - the type of the numerator unit
      D - the type of the denominator unit
      Parameters:
      numerator - the numerator unit
      denominator - the denominator for unit time
      Returns:
      the combined unit
    • numerator

      public N numerator()
    • denominator

      public D denominator()
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Unit<Per<N extends Unit<N>,​D extends Unit<D>>>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Unit<Per<N extends Unit<N>,​D extends Unit<D>>>