SCRIPT Move java files

This commit is contained in:
PJ Reiniger
2025-11-07 19:55:40 -05:00
committed by Peter Johnson
parent 7ca1be9bae
commit c350c5f112
1486 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.units;
class ExampleUnit extends Unit {
ExampleUnit(double baseUnitEquivalent) {
this(baseUnitEquivalent, "Example", "ex");
}
ExampleUnit(
ExampleUnit baseUnit,
UnaryFunction toBase,
UnaryFunction fromBase,
String name,
String symbol) {
super(baseUnit, toBase, fromBase, name, symbol);
}
ExampleUnit(double baseUnitEquivalent, String name, String symbol) {
super(null, baseUnitEquivalent, name, symbol);
}
public double convertFrom(double magnitude, ExampleUnit otherUnit) {
return fromBaseUnits(otherUnit.toBaseUnits(magnitude));
}
@Override
public Measure<ExampleUnit> of(double magnitude) {
return ImmutableMeasure.ofRelativeUnits(magnitude, this);
}
@Override
public Measure<ExampleUnit> ofBaseUnits(double baseUnitMagnitude) {
return ImmutableMeasure.ofBaseUnits(baseUnitMagnitude, this);
}
@Override
public VelocityUnit<ExampleUnit> per(TimeUnit time) {
return VelocityUnit.combine(this, time);
}
}