|
RobotCore 1.0
WPILib port to raspberry Pi
|
Public Member Functions | |
| Measure<? extends MultUnit< A, B > > | of (double magnitude) |
| Measure<? extends MultUnit< A, B > > | ofBaseUnits (double baseUnitMagnitude) |
| final Mult< A, B > | ofNative (double magnitude) |
| final Mult< A, B > | ofNativeBaseUnits (double baseUnitMagnitude) |
| Measure<? extends MultUnit< A, B > > | zero () |
| Measure<? extends MultUnit< A, B > > | one () |
| Unit | per (TimeUnit time) |
| double | convertFrom (double magnitude, MultUnit< A, B > otherUnit) |
| MultUnit< A, B > | getBaseUnit () |
| A | unitA () |
| B | unitB () |
| String | toString () |
| 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 () |
Static Public Member Functions | |
| static< A extends Unit, B extends Unit > MultUnit< A, B > | combine (A a, B b) |
Protected Member Functions | |
| MultUnit (MultUnit< A, B > baseUnit, A a, B b) | |
| 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) | |
A combinatory unit type that is equivalent to the product of two other others. Note that algebraic reduction is not possible in Java's generic type system, so MultUnit<A, B> is not type-compatible with MultUnit<B, A>!
| <A> | the type of the first unit in the result |
| <B> | the type of the second unit in the result |
Definition at line 18 of file MultUnit.java.
|
protected |
Creates a new product unit. Subclasses of MultUnit should use this constructor.
| baseUnit | the base unit. Set this to null if the unit being constructed is its own base unit |
| a | the first unit of the product |
| b | the second unit of the product |
Definition at line 51 of file MultUnit.java.
|
static |
Creates a new MultUnit unit derived from two arbitrary units multiplied together.
MultUnit.combine(Volts, Meters) // Volt-Meters
| <A> | the type of the first unit |
| <B> | the type of the second unit |
| a | the first unit |
| b | the second unit |
Definition at line 86 of file MultUnit.java.
| double org.wpilib.units.MultUnit< A extends Unit, B extends Unit >.convertFrom | ( | double | magnitude, |
| MultUnit< A, B > | 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 170 of file MultUnit.java.
| boolean org.wpilib.units.MultUnit< A extends Unit, B extends Unit >.equals | ( | Object | o | ) |
Reimplemented from org.wpilib.units.Unit.
Definition at line 204 of file MultUnit.java.
| MultUnit< A, B > org.wpilib.units.MultUnit< A extends Unit, B 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 176 of file MultUnit.java.
| int org.wpilib.units.MultUnit< A extends Unit, B extends Unit >.hashCode | ( | ) |
Reimplemented from org.wpilib.units.Unit.
Definition at line 219 of file MultUnit.java.
| Measure<? extends MultUnit< A, B > > org.wpilib.units.MultUnit< A extends Unit, B 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 MultUnit (and not a subclass!), this method will always return a org.wpilib.units.measure.Mult instance. If you want to avoid casting, use ofNativeBaseUnits(double) that returns a Per instance directly.
| magnitude | the magnitude of the measure in terms of its base units. |
Reimplemented from org.wpilib.units.Unit.
Definition at line 102 of file MultUnit.java.
| Measure<? extends MultUnit< A, B > > org.wpilib.units.MultUnit< A extends Unit, B 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 MultUnit (and not a subclass!), this method will always return a org.wpilib.units.measure.Mult 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 118 of file MultUnit.java.
| final Mult< A, B > org.wpilib.units.MultUnit< A extends Unit, B extends Unit >.ofNative | ( | double | magnitude | ) |
Creates a new immutable measurement of the given magnitude in terms of this unit. This will always return a Mult object and cannot be overridden by subclasses.
| magnitude | the magnitude of the measurement. |
Definition at line 130 of file MultUnit.java.
| final Mult< A, B > org.wpilib.units.MultUnit< A extends Unit, B extends Unit >.ofNativeBaseUnits | ( | double | baseUnitMagnitude | ) |
Creates a new immutable measurement of the given magnitude in terms of the unit's base unit. This will always return a Mult object and cannot be overridden by subclasses.
| baseUnitMagnitude | the magnitude of the measure in terms of its base units. |
Definition at line 142 of file MultUnit.java.
| Measure<? extends MultUnit< A, B > > org.wpilib.units.MultUnit< A extends Unit, B 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 154 of file MultUnit.java.
| Unit org.wpilib.units.MultUnit< A extends Unit, B 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 159 of file MultUnit.java.
| String org.wpilib.units.MultUnit< A extends Unit, B extends Unit >.toString | ( | ) |
Reimplemented from org.wpilib.units.Unit.
Definition at line 199 of file MultUnit.java.
| A org.wpilib.units.MultUnit< A extends Unit, B extends Unit >.unitA | ( | ) |
Gets the first unit of the product.
Definition at line 185 of file MultUnit.java.
| B org.wpilib.units.MultUnit< A extends Unit, B extends Unit >.unitB | ( | ) |
Gets the second unit of the product.
Definition at line 194 of file MultUnit.java.
| Measure<? extends MultUnit< A, B > > org.wpilib.units.MultUnit< A extends Unit, B 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 148 of file MultUnit.java.