[docs] Add wpiunits to JavaDocs (#5793)

Co-authored-by: Sam Carlberg <sam.carlberg@gmail.com>
This commit is contained in:
Tyler Veness
2023-10-20 18:14:14 -07:00
committed by GitHub
parent 25dad5a531
commit bee32f080e
11 changed files with 120 additions and 35 deletions

View File

@@ -85,12 +85,13 @@ public class Unit<U extends Unit<U>> {
* this unit.
*
* <pre>
* Inches.convertFrom(12, Feet) // => 144.0
* Kilograms.convertFrom(2.2, Pounds) // => 0.9979024
* Inches.convertFrom(12, Feet) // 144.0
* Kilograms.convertFrom(2.2, Pounds) // 0.9979024
* </pre>
*
* @param magnitude a magnitude measured in another unit
* @param otherUnit the unit to convert the magnitude to
* @return the corresponding value in terms of this unit.
*/
public double convertFrom(double magnitude, Unit<U> otherUnit) {
if (this.equivalent(otherUnit)) {
@@ -125,6 +126,7 @@ public class Unit<U extends Unit<U>> {
* <i>immutable</i> and cannot have its value modified.
*
* @param magnitude the magnitude of the measure to create
* @return the measure
*/
public Measure<U> of(double magnitude) {
if (magnitude == 0) {
@@ -180,8 +182,8 @@ public class Unit<U extends Unit<U>> {
* jerk, etc.
*
* <pre>
* Meters.per(Second) // => linear velocity
* Kilograms.per(Second) // => mass flow
* Meters.per(Second) // linear velocity
* Kilograms.per(Second) // mass flow
* Feet.per(Second).per(Second).of(32) // roughly 1G of acceleration
* </pre>
*