Package edu.wpi.first.units
Class Units
java.lang.Object
edu.wpi.first.units.Units
public final class Units extends Object
Contains a set of predefined units.
-
Field Summary
-
Method Summary
Modifier and Type Method Description static <U extends Unit<U>>
Uanonymous()
static <U extends Unit<U>>
UnitBuilder<U>derive(Unit<U> unit)
static <U extends Unit<U>>
UKilo(Unit<U> baseUnit)
Creates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams).static <U extends Unit<U>>
UKilo(Unit<U> baseUnit, String name, String symbol)
Creates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams).static <U extends Unit<U>>
UMicro(Unit<U> baseUnit)
Creates a unit equal to a millionth of the base unit, eg Microseconds = Micro(Units.Seconds).static <U extends Unit<U>>
UMicro(Unit<U> baseUnit, String name, String symbol)
Creates a unit equal to a millionth of the base unit, egMicroseconds = Micro(Units.Seconds, "Microseconds", 'us")
.static <U extends Unit<U>>
UMilli(Unit<U> baseUnit)
Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds).static <U extends Unit<U>>
UMilli(Unit<U> baseUnit, String name, String symbol)
Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds).
-
Field Details
-
AnonymousBaseUnit
-
Meters
-
Millimeters
-
Centimeters
-
Inches
-
Feet
-
Seconds
-
Second
-
Milliseconds
-
Millisecond
-
Microseconds
-
Microsecond
-
Minutes
-
Minute
-
Radians
-
Revolutions
-
Rotations
-
Degrees
-
MetersPerSecond
-
FeetPerSecond
-
InchesPerSecond
-
RevolutionsPerSecond
-
RotationsPerSecond
-
RPM
-
RadiansPerSecond
-
DegreesPerSecond
-
MetersPerSecondPerSecond
-
Gs
-
Kilograms
-
Grams
-
Pounds
-
Ounces
-
Value
-
Percent
-
Volts
-
Millivolts
-
Amps
-
Milliamps
-
Joules
-
Millijoules
-
Kilojoules
-
Watts
-
Milliwatts
-
Horsepower
-
Kelvin
-
Celsius
-
Fahrenheit
-
VoltsPerMeterPerSecond
-
VoltsPerMeterPerSecondSquared
-
VoltsPerRadianPerSecond
-
VoltsPerRadianPerSecondSquared
-
-
Method Details
-
Milli
Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds).- Type Parameters:
U
- the type of the unit- Parameters:
baseUnit
- the unit being derived from. This does not have to be the base unit of measurename
- the name of the new derived unitsymbol
- the symbol of the new derived unit- Returns:
- the milli-unit
-
Milli
Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds).- Type Parameters:
U
- the type of the unit- Parameters:
baseUnit
- the unit being derived from. This does not have to be the base unit of measure- Returns:
- the milli-unit
-
Micro
Creates a unit equal to a millionth of the base unit, egMicroseconds = Micro(Units.Seconds, "Microseconds", 'us")
.- Type Parameters:
U
- the type of the unit- Parameters:
baseUnit
- the unit being derived from. This does not have to be the base unit of measurename
- the name of the new derived unitsymbol
- the symbol of the new derived unit- Returns:
- the micro-unit
-
Micro
Creates a unit equal to a millionth of the base unit, eg Microseconds = Micro(Units.Seconds).- Type Parameters:
U
- the type of the unit- Parameters:
baseUnit
- the unit being derived from. This does not have to be the base unit of measure- Returns:
- the micro-unit
-
Kilo
Creates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams).- Type Parameters:
U
- the type of the unit- Parameters:
baseUnit
- the unit being derived from. This does not have to be the base unit of measurename
- the name of the new derived unitsymbol
- the symbol of the new derived unit- Returns:
- the kilo-unit
-
Kilo
Creates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams).- Type Parameters:
U
- the type of the unit- Parameters:
baseUnit
- the unit being derived from. This does not have to be the base unit of measure- Returns:
- the kilo-unit
-
derive
-
anonymous
-