summaryrefslogtreecommitdiff
path: root/src/main/java/sevenUnits/unit/UnitValue.java
diff options
context:
space:
mode:
authorAdrien Hopkins <adrien.p.hopkins@gmail.com>2025-05-30 19:48:42 -0500
committerAdrien Hopkins <adrien.p.hopkins@gmail.com>2025-05-30 19:54:19 -0500
commite86fb71e1665cb9e8511bafd54df0fb8cbca5adc (patch)
treecbc3aa8c4a4848c0a0f9e332fcab576ad0c10e27 /src/main/java/sevenUnits/unit/UnitValue.java
parent8df414ced2018e685f034424c3d8c7813d18805c (diff)
Remove Unitlike/MultiUnit
I ended up never using this code - it was simpler to just use lists of units and values. Making a whole new object for lists of units, and an abstract class for things that convert things other than doubles, is needlessly complicated, and doesn't solve any major issues. For example, I still need to store each Unitlike type in a different collection, because it will have a different type.
Diffstat (limited to 'src/main/java/sevenUnits/unit/UnitValue.java')
-rw-r--r--src/main/java/sevenUnits/unit/UnitValue.java21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/main/java/sevenUnits/unit/UnitValue.java b/src/main/java/sevenUnits/unit/UnitValue.java
index 2d01831..9b485e3 100644
--- a/src/main/java/sevenUnits/unit/UnitValue.java
+++ b/src/main/java/sevenUnits/unit/UnitValue.java
@@ -64,27 +64,6 @@ public final class UnitValue {
}
/**
- * @return true if this value can be converted to {@code other}.
- * @since 2020-10-01
- */
- public final <W> boolean canConvertTo(Unitlike<W> other) {
- return this.unit.canConvertTo(other);
- }
-
- /**
- * Returns a UnitlikeValue that represents the same value expressed in a
- * different unitlike form.
- *
- * @param other new unit to express value in
- * @return value expressed in {@code other}
- */
- public final <U extends Unitlike<W>, W> UnitlikeValue<U, W> convertTo(
- U other) {
- return UnitlikeValue.of(other,
- this.unit.convertTo(other, this.getValue()));
- }
-
- /**
* Returns a UnitValue that represents the same value expressed in a
* different unit
*