mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
SCRIPT: Spotless Apply
This commit is contained in:
committed by
Peter Johnson
parent
c89910b7c6
commit
c48b722dac
@@ -10,8 +10,8 @@ import org.wpilib.units.measure.Acceleration;
|
||||
* A generic unit of acceleration.
|
||||
*
|
||||
* <p><strong>NOTE:</strong> This type is not compatible with unit-specific accelerations like
|
||||
* {@link org.wpilib.units.measure.LinearAcceleration}. Authors of APIs that need to interact
|
||||
* with all types should consider using a generic {@code Measure<? extends PerUnit<? extends
|
||||
* {@link org.wpilib.units.measure.LinearAcceleration}. Authors of APIs that need to interact with
|
||||
* all types should consider using a generic {@code Measure<? extends PerUnit<? extends
|
||||
* PerUnit<[dimension>], TimeUnit>, TimeUnit>}. Bounded wildcards are necessary in order to
|
||||
* interoperate with <i>any</i> subclass of the {@link org.wpilib.units.measure.Per} measurement
|
||||
* type.
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
package org.wpilib.units;
|
||||
|
||||
import org.wpilib.units.collections.LongToObjectHashMap;
|
||||
import java.util.Objects;
|
||||
import java.util.function.BiFunction;
|
||||
import org.wpilib.units.collections.LongToObjectHashMap;
|
||||
|
||||
/**
|
||||
* A helper class for creating and caching combined unit objects. This helps to reduce unnecessary
|
||||
|
||||
@@ -6,9 +6,7 @@ package org.wpilib.units;
|
||||
|
||||
import org.wpilib.units.measure.LinearAcceleration;
|
||||
|
||||
/**
|
||||
* A unit of linear acceleration like {@link org.wpilib.units.Units#MetersPerSecondPerSecond}.
|
||||
*/
|
||||
/** A unit of linear acceleration like {@link org.wpilib.units.Units#MetersPerSecondPerSecond}. */
|
||||
public final class LinearAccelerationUnit extends PerUnit<LinearVelocityUnit, TimeUnit> {
|
||||
private static final CombinatoryUnitCache<LinearVelocityUnit, TimeUnit, LinearAccelerationUnit>
|
||||
cache = new CombinatoryUnitCache<>(LinearAccelerationUnit::new);
|
||||
|
||||
@@ -7,8 +7,8 @@ package org.wpilib.units;
|
||||
import org.wpilib.units.measure.MomentOfInertia;
|
||||
|
||||
/**
|
||||
* A unit of moment of inertia, like {@link org.wpilib.units.Units#KilogramSquareMeters}. Moments
|
||||
* of inertia describe how much an object resists being rotated, analogous to mass's resistance to
|
||||
* A unit of moment of inertia, like {@link org.wpilib.units.Units#KilogramSquareMeters}. Moments of
|
||||
* inertia describe how much an object resists being rotated, analogous to mass's resistance to
|
||||
* being accelerated along a line.
|
||||
*/
|
||||
public final class MomentOfInertiaUnit extends PerUnit<AngularMomentumUnit, AngularVelocityUnit> {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
package org.wpilib.units;
|
||||
|
||||
import org.wpilib.units.measure.Mult;
|
||||
import java.util.Objects;
|
||||
import org.wpilib.units.measure.Mult;
|
||||
|
||||
/**
|
||||
* A combinatory unit type that is equivalent to the product of two other others. Note that
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
package org.wpilib.units;
|
||||
|
||||
import org.wpilib.units.measure.Per;
|
||||
import java.util.Objects;
|
||||
import org.wpilib.units.measure.Per;
|
||||
|
||||
/**
|
||||
* Generic combinatory unit type that represents the proportion of one unit to another, such as
|
||||
@@ -157,8 +157,8 @@ public class PerUnit<N extends Unit, D extends Unit> extends Unit {
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>Note: When called on an object of type {@code PerUnit} (and <i>not</i> a subclass!), this
|
||||
* method will always return a {@link org.wpilib.units.measure.Per} instance. If you want to
|
||||
* avoid casting, use {@link #ofNative(double)} that returns a {@code Per} instance directly.
|
||||
* method will always return a {@link org.wpilib.units.measure.Per} instance. If you want to avoid
|
||||
* casting, use {@link #ofNative(double)} that returns a {@code Per} instance directly.
|
||||
*
|
||||
* @param magnitude the magnitude of the measure
|
||||
* @return the ratio measure
|
||||
@@ -172,9 +172,8 @@ public class PerUnit<N extends Unit, D extends Unit> extends Unit {
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>Note: When called on an object of type {@code PerUnit} (and <i>not</i> a subclass!), this
|
||||
* method will always return a {@link org.wpilib.units.measure.Per} instance. If you want to
|
||||
* avoid casting, use {@link #ofNativeBaseUnits(double)} that returns a {@code Per} instance
|
||||
* directly.
|
||||
* method will always return a {@link org.wpilib.units.measure.Per} instance. If you want to avoid
|
||||
* casting, use {@link #ofNativeBaseUnits(double)} that returns a {@code Per} instance directly.
|
||||
*
|
||||
* @param baseUnitMagnitude the magnitude of the measure in terms of its base units.
|
||||
* @return the ratio measure
|
||||
|
||||
@@ -11,13 +11,13 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.wpilib.units.measure.Angle;
|
||||
import org.wpilib.units.measure.AngularMomentum;
|
||||
import org.wpilib.units.measure.Distance;
|
||||
import org.wpilib.units.measure.LinearVelocity;
|
||||
import org.wpilib.units.measure.Per;
|
||||
import org.wpilib.units.measure.Time;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class MeasureTest {
|
||||
@Test
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
package org.wpilib.units;
|
||||
|
||||
import static org.wpilib.units.Units.Degrees;
|
||||
import static org.wpilib.units.Units.Foot;
|
||||
import static org.wpilib.units.Units.Inches;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
|
||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||
import static org.wpilib.units.Units.Degrees;
|
||||
import static org.wpilib.units.Units.Foot;
|
||||
import static org.wpilib.units.Units.Inches;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
package org.wpilib.units;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.wpilib.units.Units.Amps;
|
||||
import static org.wpilib.units.Units.Celsius;
|
||||
import static org.wpilib.units.Units.Centimeters;
|
||||
@@ -39,8 +41,6 @@ import static org.wpilib.units.Units.Seconds;
|
||||
import static org.wpilib.units.Units.Value;
|
||||
import static org.wpilib.units.Units.Volts;
|
||||
import static org.wpilib.units.Units.Watts;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.function.DoubleFunction;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
|
||||
package org.wpilib.units;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.wpilib.units.Units.Feet;
|
||||
import static org.wpilib.units.Units.FeetPerSecond;
|
||||
import static org.wpilib.units.Units.Meters;
|
||||
@@ -14,9 +17,6 @@ import static org.wpilib.units.Units.Minute;
|
||||
import static org.wpilib.units.Units.Radians;
|
||||
import static org.wpilib.units.Units.Second;
|
||||
import static org.wpilib.units.Units.Seconds;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
|
||||
package org.wpilib.units.measure;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
|
||||
import static org.wpilib.units.Units.Milliseconds;
|
||||
import static org.wpilib.units.Units.Seconds;
|
||||
import static org.wpilib.units.Units.Volts;
|
||||
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.wpilib.units.Measure;
|
||||
import org.wpilib.units.VelocityUnit;
|
||||
import org.wpilib.units.VoltageUnit;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class VelocityTest {
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user