|
RobotCore 1.0
WPILib port to raspberry Pi
|
Public Member Functions | |
| PerUnit< N, D > | getBaseUnit () |
| N | numerator () |
| D | denominator () |
| PerUnit< D, N > | reciprocal () |
| N | mult (D denom) |
| Measure<? extends PerUnit< N, D > > | of (double magnitude) |
| Measure<? extends PerUnit< N, D > > | ofBaseUnits (double baseUnitMagnitude) |
| final Per< N, D > | ofNative (double magnitude) |
| final Per< N, D > | ofNativeBaseUnits (double baseUnitMagnitude) |
| Measure<? extends PerUnit< N, D > > | zero () |
| Measure<? extends PerUnit< N, D > > | one () |
| Unit | per (TimeUnit time) |
| double | convertFrom (double magnitude, PerUnit<? extends N, ? extends D > otherUnit) |
| boolean | equals (Object o) |
| int | hashCode () |
| Public Member Functions inherited from org.wpilib.units.Unit | |
| boolean | isBaseUnit () |
| double | fromBaseUnits (double valueInBaseUnits) |
| double | toBaseUnits (double valueInNativeUnits) |
| UnaryFunction | getConverterToBase () |
| UnaryFunction | getConverterFromBase () |
| boolean | equivalent (Unit other) |
| String | name () |
| String | symbol () |
| String | toString () |
Static Public Member Functions | |
| static< N extends Unit, D extends Unit > PerUnit< N, D > | combine (N numerator, D denominator) |
Protected Member Functions | |
| PerUnit (PerUnit< N, D > baseUnit, N numerator, D denominator) | |
| Protected Member Functions inherited from org.wpilib.units.Unit | |
| Unit (Unit baseUnit, UnaryFunction toBaseConverter, UnaryFunction fromBaseConverter, String name, String symbol) | |
| Unit (Unit baseUnit, double baseUnitEquivalent, String name, String symbol) | |
Generic combinatory unit type that represents the proportion of one unit to another, such as Meters per Second or Radians per Celsius.
| <N> | the type of the numerator unit |
| <D> | the type of the denominator unit |
Definition at line 17 of file PerUnit.java.
|
protected |
Creates a new proportional unit derived from the ratio of one unit to another. Subclasses of PerUnit should use this constructor.
| baseUnit | the base unit. Set this to null if the unit being constructed is its own base unit |
| numerator | the numerator unit |
| denominator | the denominator unit |
Definition at line 57 of file PerUnit.java.
|
static |
Creates a new PerUnit unit derived from an arbitrary numerator and time denominator units.
PerUnit.combine(Volts, Meters) // possible PID constant
| <N> | the type of the numerator unit |
| <D> | the type of the denominator unit |
| numerator | the numerator unit |
| denominator | the denominator for unit time |
Definition at line 93 of file PerUnit.java.
| double org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.convertFrom | ( | double | magnitude, |
| PerUnit<? extends N, ? extends D > | otherUnit ) |
Converts a measurement value in terms of another unit to this unit.
| magnitude | the magnitude of the measurement in terms of the other unit |
| otherUnit | the other unit |
Definition at line 234 of file PerUnit.java.
| D org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.denominator | ( | ) |
Gets the denominator unit. For a PerUnit<A, B>, this will return the B unit.
Definition at line 117 of file PerUnit.java.
| boolean org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.equals | ( | Object | o | ) |
Reimplemented from org.wpilib.units.Unit.
Definition at line 239 of file PerUnit.java.
| PerUnit< N, D > org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.getBaseUnit | ( | ) |
Gets the base unit of measurement that this unit is derived from. If the unit is the base unit, the unit will be returned.
NOTE: Subclasses must override this method to provide the correct return type. Failing to do say will make unit combinations that use it break at runtime!
Unit baseUnit = new Unit(null, ...);
baseUnit.getBaseUnit(); // returns baseUnit
Unit derivedUnit = new Unit(baseUnit, ...);
derivedUnit.getBaseUnit(); // returns baseUnit
Reimplemented from org.wpilib.units.Unit.
Definition at line 99 of file PerUnit.java.
| int org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.hashCode | ( | ) |
Reimplemented from org.wpilib.units.Unit.
Definition at line 255 of file PerUnit.java.
| N org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.mult | ( | D | denom | ) |
Multiplies this unit by a unit of its denominator.
| denom | the denominator-typed unit to multiply by |
Definition at line 143 of file PerUnit.java.
| N org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.numerator | ( | ) |
Gets the numerator unit. For a PerUnit<A, B>, this will return the A unit.
Definition at line 108 of file PerUnit.java.
| Measure<? extends PerUnit< N, D > > org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.of | ( | double | magnitude | ) |
Creates a new immutable measurement of the given magnitude in terms of this unit. Implementations are strongly recommended to sharpen the return type to a unit-specific measurement implementation.
| magnitude | the magnitude of the measurement. |
Note: When called on an object of type PerUnit (and not a subclass!), this method will always return a org.wpilib.units.measure.Per instance. If you want to avoid casting, use ofNative(double) that returns a Per instance directly.
| magnitude | the magnitude of the measure |
Reimplemented from org.wpilib.units.Unit.
Definition at line 167 of file PerUnit.java.
| Measure<? extends PerUnit< N, D > > org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.ofBaseUnits | ( | double | baseUnitMagnitude | ) |
Creates a new immutable measurement of the given magnitude in terms of this unit's base unit. Implementations are strongly recommended to sharpen the return type to a unit-specific measurement implementation.
| baseUnitMagnitude | the magnitude in terms of the base unit |
Note: When called on an object of type PerUnit (and not a subclass!), this method will always return a org.wpilib.units.measure.Per instance. If you want to avoid casting, use ofNativeBaseUnits(double) that returns a Per instance directly.
| baseUnitMagnitude | the magnitude of the measure in terms of its base units. |
Reimplemented from org.wpilib.units.Unit.
Definition at line 182 of file PerUnit.java.
| final Per< N, D > org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.ofNative | ( | double | magnitude | ) |
Creates a new immutable measurement of the given magnitude in terms of the ratio unit. This will always return a Per object and cannot be overridden by subclasses.
| magnitude | the magnitude of the measurement. |
Definition at line 194 of file PerUnit.java.
| final Per< N, D > org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.ofNativeBaseUnits | ( | double | baseUnitMagnitude | ) |
Creates a new immutable measurement of the given magnitude in terms of the ratio unit's base unit. This will always return a Per object and cannot be overridden by subclasses.
| baseUnitMagnitude | the magnitude of the measure in terms of its base units. |
Definition at line 206 of file PerUnit.java.
| Measure<? extends PerUnit< N, D > > org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.one | ( | ) |
Gets a measure with a magnitude of 1.0 in terms of this unit. The returned object is guaranteed to be of the same type returned by of(double). Subclasses are encouraged to override this method to sharpen the return type.
Reimplemented from org.wpilib.units.Unit.
Definition at line 218 of file PerUnit.java.
| Unit org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.per | ( | TimeUnit | time | ) |
Combines this unit with a unit of time. This often - but not always - results in a velocity. Subclasses should sharpen the return type to be unit-specific.
| time | the unit of time |
Reimplemented from org.wpilib.units.Unit.
Definition at line 223 of file PerUnit.java.
| PerUnit< D, N > org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.reciprocal | ( | ) |
Returns the reciprocal of this PerUnit.
Definition at line 127 of file PerUnit.java.
| Measure<? extends PerUnit< N, D > > org.wpilib.units.PerUnit< N extends Unit, D extends Unit >.zero | ( | ) |
Gets a measure of zero magnitude in terms of this unit. The returned object is guaranteed to be of the same type returned by of(double). Subclasses are encouraged to override this method to sharpen the return type.
Reimplemented from org.wpilib.units.Unit.
Definition at line 212 of file PerUnit.java.