mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[wpiunits] Make Java units immutable only (#8115)
Remove mutable implementations, as systemcore doesn't need mutability to keep performance under control.
This commit is contained in:
@@ -4,8 +4,6 @@
|
||||
|
||||
package edu.wpi.first.units;
|
||||
|
||||
import edu.wpi.first.units.mutable.GenericMutableMeasureImpl;
|
||||
|
||||
class ExampleUnit extends Unit {
|
||||
ExampleUnit(double baseUnitEquivalent) {
|
||||
this(baseUnitEquivalent, "Example", "ex");
|
||||
@@ -38,11 +36,6 @@ class ExampleUnit extends Unit {
|
||||
return ImmutableMeasure.ofBaseUnits(baseUnitMagnitude, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MutableMeasure<ExampleUnit, ?, ?> mutable(double initialMagnitude) {
|
||||
return new GenericMutableMeasureImpl<>(initialMagnitude, toBaseUnits(initialMagnitude), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VelocityUnit<ExampleUnit> per(TimeUnit time) {
|
||||
return VelocityUnit.combine(this, time);
|
||||
|
||||
Reference in New Issue
Block a user