|
RobotCore 1.0
WPILib port to raspberry Pi
|
Public Member Functions | |
| double | magnitude () |
| double | baseUnitMagnitude () |
| U | unit () |
| default double | in (U unit) |
| default U | baseUnit () |
| default double | abs (U unit) |
| default double | copySign (Measure< U > other, U unit) |
| Measure< U > | unaryMinus () |
| Measure< U > | plus (Measure<? extends U > other) |
| Measure< U > | minus (Measure<? extends U > other) |
| Measure< U > | times (double multiplier) |
| Measure< U > | times (Dimensionless multiplier) |
| default Measure<?> | times (Measure<?> multiplier) |
| default Measure<?> | times (Acceleration<?> multiplier) |
| default Measure<?> | times (Angle multiplier) |
| default Measure<?> | times (AngularAcceleration multiplier) |
| default Measure<?> | times (AngularMomentum multiplier) |
| default Measure<?> | times (AngularVelocity multiplier) |
| default Measure<?> | times (Current multiplier) |
| default Measure<?> | times (Distance multiplier) |
| default Measure<?> | times (Energy multiplier) |
| default Measure<?> | times (Force multiplier) |
| default Measure<?> | times (Frequency multiplier) |
| default Measure<?> | times (LinearAcceleration multiplier) |
| default Measure<?> | times (LinearMomentum multiplier) |
| default Measure<?> | times (LinearVelocity multiplier) |
| default Measure<?> | times (Mass multiplier) |
| default Measure<?> | times (MomentOfInertia multiplier) |
| default Measure<?> | times (Mult<?, ?> multiplier) |
| default Measure<?> | times (Power multiplier) |
| default Measure<?> | times (Per<?, ?> multiplier) |
| default Measure<?> | times (Temperature multiplier) |
| default Measure<?> | times (Time multiplier) |
| default Measure<?> | times (Torque multiplier) |
| default Measure<?> | times (Velocity<?> multiplier) |
| default Measure<?> | times (Voltage multiplier) |
| default Measure<?> | times (Resistance multiplier) |
| default< Other extends Unit, M extends Measure< Other > > M | timesConversionFactor (Measure<? extends PerUnit< Other, U > > conversionFactor) |
| default Dimensionless | timesInverse (Measure<? extends PerUnit< DimensionlessUnit, ? extends U > > multiplier) |
| default< Other extends Unit > Measure< Other > | timesRatio (Measure<? extends PerUnit<? extends Other, U > > ratio) |
| Measure< U > | div (double divisor) |
| Measure< U > | div (Dimensionless divisor) |
| default Measure<?> | div (Measure<?> divisor) |
| default Measure<?> | div (Acceleration<?> divisor) |
| default Measure<?> | div (Angle divisor) |
| default Measure<?> | div (AngularAcceleration divisor) |
| default Measure<?> | div (AngularMomentum divisor) |
| default Measure<?> | div (AngularVelocity divisor) |
| default Measure<?> | div (Current divisor) |
| default Measure<?> | div (Distance divisor) |
| default Measure<?> | div (Energy divisor) |
| default Measure<?> | div (Force divisor) |
| default Measure<?> | div (Frequency divisor) |
| default Measure<?> | div (LinearAcceleration divisor) |
| default Measure<?> | div (LinearMomentum divisor) |
| default Measure<?> | div (LinearVelocity divisor) |
| default Measure<?> | div (Mass divisor) |
| default Measure<?> | div (MomentOfInertia divisor) |
| default Measure<?> | div (Mult<?, ?> divisor) |
| default Measure<?> | div (Power divisor) |
| default Measure<?> | div (Per<?, ?> divisor) |
| default Measure<?> | div (Temperature divisor) |
| default Measure<?> | div (Time divisor) |
| default Measure<?> | div (Torque divisor) |
| default Measure<?> | div (Velocity<?> divisor) |
| default Measure<?> | div (Voltage divisor) |
| default Measure<?> | div (Resistance divisor) |
| default Measure<?> | per (AccelerationUnit<?> divisorUnit) |
| default Measure<?> | per (AngleUnit divisorUnit) |
| default Measure<?> | per (AngularAccelerationUnit divisorUnit) |
| default Measure<?> | per (AngularMomentumUnit divisorUnit) |
| default Measure<?> | per (AngularVelocityUnit divisorUnit) |
| default Measure<?> | per (CurrentUnit divisorUnit) |
| default Measure<?> | per (DistanceUnit divisorUnit) |
| default Measure<?> | per (EnergyUnit divisorUnit) |
| default Measure<?> | per (ForceUnit divisorUnit) |
| default Measure<?> | per (FrequencyUnit divisorUnit) |
| default Measure<?> | per (LinearAccelerationUnit divisorUnit) |
| default Measure<?> | per (LinearMomentumUnit divisorUnit) |
| default Measure<?> | per (LinearVelocityUnit divisorUnit) |
| default Measure<?> | per (MassUnit divisorUnit) |
| default Measure<?> | per (MomentOfInertiaUnit divisorUnit) |
| default Measure<?> | per (MultUnit<?, ?> divisorUnit) |
| default Measure<?> | per (PowerUnit divisorUnit) |
| default Measure<?> | per (PerUnit<?, ?> divisorUnit) |
| default Measure<?> | per (TemperatureUnit divisorUnit) |
| default Measure<?> | per (TimeUnit period) |
| default Measure<?> | per (TorqueUnit divisorUnit) |
| default Measure<?> | per (VelocityUnit<?> divisorUnit) |
| default Measure<?> | per (VoltageUnit divisorUnit) |
| default Measure<?> | per (ResistanceUnit divisorUnit) |
| default< Other extends Unit > Measure< Other > | divideRatio (Measure<? extends PerUnit<? extends U, Other > > divisor) |
| default boolean | isNear (Measure<?> other, double varianceThreshold) |
| default boolean | isNear (Measure< U > other, Measure< U > tolerance) |
| default boolean | isEquivalent (Measure<?> other) |
| default int | compareTo (Measure< U > o) |
| default boolean | gt (Measure< U > o) |
| default boolean | gte (Measure< U > o) |
| default boolean | lt (Measure< U > o) |
| default boolean | lte (Measure< U > o) |
| static< U extends Unit, T extends Measure< U > > T | max (T... measures) |
| static< U extends Unit, T extends Measure< U > > T | min (T... measures) |
| default String | toShortString () |
| default String | toLongString () |
Public Attributes | |
| double | EQUIVALENCE_THRESHOLD = 1e-12 |
A measure holds the magnitude and unit of some dimension, such as distance, time, or velocity. Two measures with the same unit and magnitude are effectively equivalent objects.
| <U> | the unit type of the measure |
Definition at line 41 of file Measure.java.
| default double org.wpilib.units.Measure< U extends Unit >.abs | ( | U | unit | ) |
Absolute value of measure.
| unit | unit to use |
Definition at line 107 of file Measure.java.
| default U org.wpilib.units.Measure< U extends Unit >.baseUnit | ( | ) |
A convenience method to get the base unit of the measurement. Equivalent to .
unit().getBaseUnit()
Definition at line 97 of file Measure.java.
| double org.wpilib.units.Measure< U extends Unit >.baseUnitMagnitude | ( | ) |
Gets the magnitude of this measure in terms of the base unit. If the unit is the base unit for its system of measure, then the value will be equivalent to magnitude().
| default int org.wpilib.units.Measure< U extends Unit >.compareTo | ( | Measure< U > | o | ) |
Definition at line 1276 of file Measure.java.
| default double org.wpilib.units.Measure< U extends Unit >.copySign | ( | Measure< U > | other, |
| U | unit ) |
Take the sign of another measure.
| other | measure from which to take sign |
| unit | unit to use |
Definition at line 118 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Acceleration<?> | divisor | ) |
Divides this measure by a generic acceleration and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 671 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Angle | divisor | ) |
Divides this measure by an angle and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 682 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | AngularAcceleration | divisor | ) |
Divides this measure by an angular acceleration and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 694 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | AngularMomentum | divisor | ) |
Divides this measure by an angular momentum and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 706 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | AngularVelocity | divisor | ) |
Divides this measure by an angular velocity and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 718 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Current | divisor | ) |
Divides this measure by an electric current and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 730 of file Measure.java.
| Measure< U > org.wpilib.units.Measure< U extends Unit >.div | ( | Dimensionless | divisor | ) |
Divides this measure by a dimensionless scalar and returns the result.
| divisor | the measurement to divide by. |
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Distance | divisor | ) |
Divides this measure by a distance and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 741 of file Measure.java.
| Measure< U > org.wpilib.units.Measure< U extends Unit >.div | ( | double | divisor | ) |
Divides this measure by a unitless scalar and returns the result.
| divisor | the measurement to divide by. |
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Energy | divisor | ) |
Divides this measure by an energy and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 752 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Force | divisor | ) |
Divides this measure by a force and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 763 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Frequency | divisor | ) |
Divides this measure by a frequency and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 774 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | LinearAcceleration | divisor | ) |
Divides this measure by a linear acceleration and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 786 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | LinearMomentum | divisor | ) |
Divides this measure by a linear momentum and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 797 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | LinearVelocity | divisor | ) |
Divides this measure by a linear velocity and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 808 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Mass | divisor | ) |
Divides this measure by a mass and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 819 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Measure<?> | divisor | ) |
Divides this measurement by another measure and performs some dimensional analysis to reduce the units.
| divisor | the unit to divide by |
Definition at line 600 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | MomentOfInertia | divisor | ) |
Divides this measure by a moment of inertia and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 831 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Mult<?, ?> | divisor | ) |
Divides this measure by a generic multiplication and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 843 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Per<?, ?> | divisor | ) |
Divides this measure by a generic ratio and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 865 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Power | divisor | ) |
Divides this measure by a power and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 854 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Resistance | divisor | ) |
Divides this measure by a resistance and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 933 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Temperature | divisor | ) |
Divides this measure by a temperature and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 876 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Time | divisor | ) |
Divides this measure by a time and returns the result in the most appropriate unit. This will often - but not always - result in a Per type like LinearVelocity or Acceleration.
| divisor | the measurement to divide by. |
Definition at line 889 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Torque | divisor | ) |
Divides this measure by a torque and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 900 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Velocity<?> | divisor | ) |
Divides this measure by a generic velocity and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 911 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.div | ( | Voltage | divisor | ) |
Divides this measure by a voltage and returns the result in the most appropriate unit.
| divisor | the measurement to divide by. |
Definition at line 922 of file Measure.java.
| default< Other extends Unit > Measure< Other > org.wpilib.units.Measure< U extends Unit >.divideRatio | ( | Measure<? extends PerUnit<? extends U, Other > > | divisor | ) |
Divides this measure by a ratio in terms of this measurement's unit to another unit, returning a measurement in terms of the other unit.
| divisor | the measurement to divide by. |
| <Other> | the other unit that results are in terms of |
Definition at line 1211 of file Measure.java.
| default boolean org.wpilib.units.Measure< U extends Unit >.gt | ( | Measure< U > | o | ) |
Checks if this measure is greater than another measure of the same unit.
| o | the other measure to compare to |
Definition at line 1286 of file Measure.java.
| default boolean org.wpilib.units.Measure< U extends Unit >.gte | ( | Measure< U > | o | ) |
Checks if this measure is greater than or equivalent to another measure of the same unit.
| o | the other measure to compare to |
Definition at line 1296 of file Measure.java.
| default double org.wpilib.units.Measure< U extends Unit >.in | ( | U | unit | ) |
Converts this measure to a measure with a different unit of the same type, eg minutes to seconds. Converting to the same unit is equivalent to calling magnitude().
Meters.of(12).in(Feet) // 39.3701 Seconds.of(15).in(Minutes) // 0.25
| unit | the unit to convert this measure to |
Definition at line 82 of file Measure.java.
| default boolean org.wpilib.units.Measure< U extends Unit >.isEquivalent | ( | Measure<?> | other | ) |
Checks if this measure is equivalent to another measure of the same unit.
| other | the measure to compare to |
Definition at line 1268 of file Measure.java.
| default boolean org.wpilib.units.Measure< U extends Unit >.isNear | ( | Measure< U > | other, |
| Measure< U > | tolerance ) |
Checks if this measure is near another measure of the same unit, with a specified tolerance of the same unit.
Meters.of(1).isNear(Meters.of(1.2), Millimeters.of(300)) // true
Degrees.of(90).isNear(Rotations.of(0.5), Degrees.of(45)) // false
| other | the other measure to compare against. |
| tolerance | the tolerance allowed in which the two measures are defined as near each other. |
Definition at line 1257 of file Measure.java.
| default boolean org.wpilib.units.Measure< U extends Unit >.isNear | ( | Measure<?> | other, |
| double | varianceThreshold ) |
Checks if this measure is near another measure of the same unit. Provide a variance threshold for use for a +/- scalar, such as 0.05 for +/- 5%.
Inches.of(11).isNear(Inches.of(10), 0.1) // true Inches.of(12).isNear(Inches.of(10), 0.1) // false
| other | the other measurement to compare against |
| varianceThreshold | the acceptable variance threshold, in terms of an acceptable +/- error range multiplier. Checking if a value is within 10% means a value of 0.1 should be passed; checking if a value is within 1% means a value of 0.01 should be passed, and so on. |
Definition at line 1232 of file Measure.java.
| default boolean org.wpilib.units.Measure< U extends Unit >.lt | ( | Measure< U > | o | ) |
Checks if this measure is less than another measure of the same unit.
| o | the other measure to compare to |
Definition at line 1306 of file Measure.java.
| default boolean org.wpilib.units.Measure< U extends Unit >.lte | ( | Measure< U > | o | ) |
Checks if this measure is less than or equivalent to another measure of the same unit.
| o | the other measure to compare to |
Definition at line 1316 of file Measure.java.
| double org.wpilib.units.Measure< U extends Unit >.magnitude | ( | ) |
Gets the unitless magnitude of this measure.
the unit. | static< U extends Unit, T extends Measure< U > > T org.wpilib.units.Measure< U extends Unit >.max | ( | T... | measures | ) |
Returns the measure with the absolute value closest to positive infinity.
| <U> | the type of the units of the measures |
| <T> | the common type of the measures |
| measures | the set of measures to compare |
Definition at line 1329 of file Measure.java.
| static< U extends Unit, T extends Measure< U > > T org.wpilib.units.Measure< U extends Unit >.min | ( | T... | measures | ) |
Returns the measure with the absolute value closest to negative infinity.
| <U> | the type of the units of the measures |
| <T> | the common type of the measures |
| measures | the set of measures to compare |
Definition at line 1353 of file Measure.java.
| Measure< U > org.wpilib.units.Measure< U extends Unit >.minus | ( | Measure<? extends U > | other | ) |
Subtracts another measure of the same unit type from this one.
| other | the measurement to subtract |
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | AccelerationUnit<?> | divisorUnit | ) |
Divides this measure by an acceleration unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 945 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | AngleUnit | divisorUnit | ) |
Divides this measure by an angle unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 956 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | AngularAccelerationUnit | divisorUnit | ) |
Divides this measure by an angular acceleration unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 967 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | AngularMomentumUnit | divisorUnit | ) |
Divides this measure by an angular momentum unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 978 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | AngularVelocityUnit | divisorUnit | ) |
Divides this measure by an angular velocity unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 989 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | CurrentUnit | divisorUnit | ) |
Divides this measure by a unit of electric current and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1000 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | DistanceUnit | divisorUnit | ) |
Divides this measure by a distance unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1011 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | EnergyUnit | divisorUnit | ) |
Divides this measure by an energy unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1022 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | ForceUnit | divisorUnit | ) |
Divides this measure by a force unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1033 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | FrequencyUnit | divisorUnit | ) |
Divides this measure by a frequency unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1044 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | LinearAccelerationUnit | divisorUnit | ) |
Divides this measure by a linear acceleration unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1055 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | LinearMomentumUnit | divisorUnit | ) |
Divides this measure by a linear momentum unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1066 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | LinearVelocityUnit | divisorUnit | ) |
Divides this measure by a linear velocity unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1077 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | MassUnit | divisorUnit | ) |
Divides this measure by a mass unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1088 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | MomentOfInertiaUnit | divisorUnit | ) |
Divides this measure by a moment of inertia unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1099 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | MultUnit<?, ?> | divisorUnit | ) |
Divides this measure by a generic compound unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1110 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | PerUnit<?, ?> | divisorUnit | ) |
Divides this measure by a generic ratio unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1132 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | PowerUnit | divisorUnit | ) |
Divides this measure by a power unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1121 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | ResistanceUnit | divisorUnit | ) |
Divides this measure by a resistance unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1198 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | TemperatureUnit | divisorUnit | ) |
Divides this measure by a temperature unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1143 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | TimeUnit | period | ) |
Divides this measure by a time period and returns the result in the most appropriate unit. This is equivalent to div(period.of(1)).
| period | the time period measurement to divide by. |
Definition at line 1154 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | TorqueUnit | divisorUnit | ) |
Divides this measure by a torque unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1165 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | VelocityUnit<?> | divisorUnit | ) |
Divides this measure by a velocity unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1176 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.per | ( | VoltageUnit | divisorUnit | ) |
Divides this measure by a voltage unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
| divisorUnit | the unit to divide by. |
Definition at line 1187 of file Measure.java.
| Measure< U > org.wpilib.units.Measure< U extends Unit >.plus | ( | Measure<? extends U > | other | ) |
Adds another measure of the same unit type to this one.
| other | the measurement to add |
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Acceleration<?> | multiplier | ) |
Multiplies this measure by an acceleration and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 247 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Angle | multiplier | ) |
Multiplies this measure by an angle and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 259 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | AngularAcceleration | multiplier | ) |
Multiplies this measure by an angular acceleration and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 271 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | AngularMomentum | multiplier | ) |
Multiplies this measure by an angular momentum and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 283 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | AngularVelocity | multiplier | ) |
Multiplies this measure by an angular velocity and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 295 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Current | multiplier | ) |
Multiplies this measure by an electric current and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 307 of file Measure.java.
| Measure< U > org.wpilib.units.Measure< U extends Unit >.times | ( | Dimensionless | multiplier | ) |
Multiplies this measure by a scalar dimensionless multiplier.
| multiplier | the scalar multiplication factor |
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Distance | multiplier | ) |
Multiplies this measure by a distance and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 319 of file Measure.java.
| Measure< U > org.wpilib.units.Measure< U extends Unit >.times | ( | double | multiplier | ) |
Multiplies this measure by a scalar unitless multiplier.
| multiplier | the scalar multiplication factor |
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Energy | multiplier | ) |
Multiplies this measure by an energy and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 331 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Force | multiplier | ) |
Multiplies this measure by a force and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 343 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Frequency | multiplier | ) |
Multiplies this measure by a frequency and returns the resulting measure in the most appropriate unit. This often - but not always - means implementations return a variation of a Per measure.
| multiplier | the measurement to multiply by. |
Definition at line 356 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | LinearAcceleration | multiplier | ) |
Multiplies this measure by a linear acceleration and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 368 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | LinearMomentum | multiplier | ) |
Multiplies this measure by a linear momentum and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 380 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | LinearVelocity | multiplier | ) |
Multiplies this measure by a linear velocity and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 392 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Mass | multiplier | ) |
Multiplies this measure by a mass and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 404 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Measure<?> | multiplier | ) |
Generates a new measure that is equal to this measure multiplied by another. Some dimensional analysis is performed to reduce the units down somewhat; for example, multiplying a by a
Measure<Time>Measure<Velocity<Distance>> will return just a instead of the naive
Measure<Distance>Measure<Mult<Time, Velocity<Distance>>. This is not guaranteed to perform perfect dimensional analysis.
| multiplier | the unit to multiply by |
Definition at line 174 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | MomentOfInertia | multiplier | ) |
Multiplies this measure by a moment of intertia and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 416 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Mult<?, ?> | multiplier | ) |
Multiplies this measure by a generic multiplied measure and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 428 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Per<?, ?> | multiplier | ) |
Multiplies this measure by a generic ratio measurement and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 452 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Power | multiplier | ) |
Multiplies this measure by a power and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 440 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Resistance | multiplier | ) |
Multiplies this measure by a resistance and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 524 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Temperature | multiplier | ) |
Multiplies this measure by a temperature and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 464 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Time | multiplier | ) |
Multiplies this measure by a time and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 476 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Torque | multiplier | ) |
Multiplies this measure by a torque and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 488 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Velocity<?> | multiplier | ) |
Multiplies this measure by a generic velocity and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 500 of file Measure.java.
| default Measure<?> org.wpilib.units.Measure< U extends Unit >.times | ( | Voltage | multiplier | ) |
Multiplies this measure by a voltage and returns the resulting measure in the most appropriate unit.
| multiplier | the measurement to multiply by. |
Definition at line 512 of file Measure.java.
| default< Other extends Unit, M extends Measure< Other > > M org.wpilib.units.Measure< U extends Unit >.timesConversionFactor | ( | Measure<? extends PerUnit< Other, U > > | conversionFactor | ) |
Multiplies this measure by a conversion factor, returning the converted measurement. Unlike times(Per), this allows for basic unit cancellation to return measurements of a known dimension.
| conversionFactor | the conversion factor by which to multiply |
| <Other> | the unit type to convert to |
| <M> | the concrete return unit type. Note: the conversion factor's numerator unit must return instances of this type from Unit#ofBaseUnits(double)} |
Definition at line 541 of file Measure.java.
| default Dimensionless org.wpilib.units.Measure< U extends Unit >.timesInverse | ( | Measure<? extends PerUnit< DimensionlessUnit, ? extends U > > | multiplier | ) |
Multiplies this measure by another measurement of the inverse unit type (eg Time multiplied by Frequency) and returns the resulting dimensionless measure.
| multiplier | the measurement to multiply by. |
Definition at line 558 of file Measure.java.
| default< Other extends Unit > Measure< Other > org.wpilib.units.Measure< U extends Unit >.timesRatio | ( | Measure<? extends PerUnit<? extends Other, U > > | ratio | ) |
Multiplies this measure by another measurement of something over the unit type (eg Time multiplied by LinearVelocity) and returns the resulting measure of the ratio's dividend unit.
| ratio | the measurement to multiply by. |
| <Other> | other unit that the results are in terms of |
Definition at line 571 of file Measure.java.
| default String org.wpilib.units.Measure< U extends Unit >.toLongString | ( | ) |
Returns a string representation of this measurement in a longhand form. The name of the backing unit is used, rather than its symbol, and the magnitude is represented in a full string, not scientific notation. (Very large values may be represented in scientific notation, however)
Definition at line 1387 of file Measure.java.
| default String org.wpilib.units.Measure< U extends Unit >.toShortString | ( | ) |
Returns a string representation of this measurement in a shorthand form. The symbol of the backing unit is used, rather than the full name, and the magnitude is represented in scientific notation.
Definition at line 1375 of file Measure.java.
| Measure< U > org.wpilib.units.Measure< U extends Unit >.unaryMinus | ( | ) |
Returns a measure equivalent to this one equal to zero minus its current value. For non-linear unit types like temperature, the zero point is treated as the zero value of the base unit (eg Kelvin). In effect, this means code like Celsius.of(10).unaryMinus() returns a value equivalent to -10 Kelvin, and not -10° Celsius.
| U org.wpilib.units.Measure< U extends Unit >.unit | ( | ) |
Gets the units of this measure.
| double org.wpilib.units.Measure< U extends Unit >.EQUIVALENCE_THRESHOLD = 1e-12 |
The threshold for two measures to be considered equivalent if converted to the same unit. This is only needed due to floating-point error.
Definition at line 46 of file Measure.java.