From 26291e672b0e683edc9d57710a9a9d96ca199c45 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Sun, 24 Mar 2024 13:14:11 -0500 Subject: Format source code & set explicit UTF-8 --- src/main/java/sevenUnits/unit/UnitValue.java | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/main/java/sevenUnits/unit/UnitValue.java') diff --git a/src/main/java/sevenUnits/unit/UnitValue.java b/src/main/java/sevenUnits/unit/UnitValue.java index 339263d..2d01831 100644 --- a/src/main/java/sevenUnits/unit/UnitValue.java +++ b/src/main/java/sevenUnits/unit/UnitValue.java @@ -42,10 +42,10 @@ public final class UnitValue { return new UnitValue( Objects.requireNonNull(unit, "unit must not be null"), value); } - + private final Unit unit; private final double value; - + /** * @param unit the unit being used * @param value the value being represented @@ -54,7 +54,7 @@ public final class UnitValue { this.unit = unit; this.value = value; } - + /** * @return true if this value can be converted to {@code other}. * @since 2020-10-01 @@ -62,7 +62,7 @@ public final class UnitValue { public final boolean canConvertTo(Unit other) { return this.unit.canConvertTo(other); } - + /** * @return true if this value can be converted to {@code other}. * @since 2020-10-01 @@ -70,7 +70,7 @@ public final class UnitValue { public final boolean canConvertTo(Unitlike other) { return this.unit.canConvertTo(other); } - + /** * Returns a UnitlikeValue that represents the same value expressed in a * different unitlike form. @@ -83,7 +83,7 @@ public final class UnitValue { return UnitlikeValue.of(other, this.unit.convertTo(other, this.getValue())); } - + /** * Returns a UnitValue that represents the same value expressed in a * different unit @@ -95,7 +95,7 @@ public final class UnitValue { return UnitValue.of(other, this.getUnit().convertTo(other, this.getValue())); } - + /** * Returns this unit value represented as a {@code LinearUnitValue} with this * unit's base unit as the base. @@ -108,7 +108,7 @@ public final class UnitValue { final LinearUnit base = LinearUnit.getBase(this.unit).withName(ns); return this.convertToLinear(base); } - + /** * @return a {@code LinearUnitValue} that is equivalent to this value. It * will have zero uncertainty. @@ -118,7 +118,7 @@ public final class UnitValue { return LinearUnitValue.getExact(other, this.getUnit().convertTo(other, this.getValue())); } - + /** * Returns true if this and obj represent the same value, regardless of * whether or not they are expressed in the same unit. So (1000 m).equals(1 @@ -135,7 +135,7 @@ public final class UnitValue { .doubleToLongBits( other.getUnit().convertToBase(other.getValue())); } - + /** * @return the unit * @since 2020-09-29 @@ -143,7 +143,7 @@ public final class UnitValue { public final Unit getUnit() { return this.unit; } - + /** * @return the value * @since 2020-09-29 @@ -151,13 +151,13 @@ public final class UnitValue { public final double getValue() { return this.value; } - + @Override public int hashCode() { return Objects.hash(this.getUnit().getBase(), this.getUnit().convertFromBase(this.getValue())); } - + @Override public String toString() { final Optional primaryName = this.getUnit().getPrimaryName(); -- cgit v1.2.3