|
RobotCore 1.0
WPILib port to raspberry Pi
|
Public Member Functions | |
| DimensionlessUnit | getBaseUnit () |
| Dimensionless | of (double magnitude) |
| Dimensionless | ofBaseUnits (double baseUnitMagnitude) |
| Dimensionless | zero () |
| Dimensionless | one () |
| double | convertFrom (double magnitude, DimensionlessUnit otherUnit) |
| FrequencyUnit | per (TimeUnit period) |
| 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) |
| boolean | equals (Object o) |
| int | hashCode () |
| String | name () |
| String | symbol () |
| String | toString () |
Additional Inherited Members | |
| 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 type of unit that corresponds to raw values and not any physical dimension, such as percentage.
Definition at line 12 of file DimensionlessUnit.java.
| double org.wpilib.units.DimensionlessUnit.convertFrom | ( | double | magnitude, |
| DimensionlessUnit | otherUnit ) |
Converts a measurement value in terms of another dimensionless unit to this unit.
| magnitude | the magnitude of the measurement in terms of the other dimensionless unit |
| otherUnit | the other dimensionless unit |
Definition at line 66 of file DimensionlessUnit.java.
| DimensionlessUnit org.wpilib.units.DimensionlessUnit.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 35 of file DimensionlessUnit.java.
| Dimensionless org.wpilib.units.DimensionlessUnit.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. |
Reimplemented from org.wpilib.units.Unit.
Definition at line 40 of file DimensionlessUnit.java.
| Dimensionless org.wpilib.units.DimensionlessUnit.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 |
Reimplemented from org.wpilib.units.Unit.
Definition at line 45 of file DimensionlessUnit.java.
| Dimensionless org.wpilib.units.DimensionlessUnit.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 55 of file DimensionlessUnit.java.
| FrequencyUnit org.wpilib.units.DimensionlessUnit.per | ( | TimeUnit | period | ) |
Creates a frequency unit as the ratio of this dimensionless unit to the period of time in which a single cycle is made.
| period | the cycle period |
Reimplemented from org.wpilib.units.Unit.
Definition at line 78 of file DimensionlessUnit.java.
| Dimensionless org.wpilib.units.DimensionlessUnit.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 50 of file DimensionlessUnit.java.