-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
18 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ | |
* @author <a href="mailto:[email protected]">Steve Emmerson</a> | ||
* @author <a href="mailto:[email protected]">Martin Desruisseaux</a> | ||
* @author <a href="mailto:[email protected]">Werner Keil</a> | ||
* @version 2.0, April 24, 2019 | ||
* @version 2.1, May 12, 2019 | ||
* @since 1.0 | ||
* | ||
* @see <a href="http://en.wikipedia.org/wiki/Units_of_measurement">Wikipedia: Units of measurement</a> | ||
|
@@ -136,7 +136,7 @@ public interface Unit<Q extends Quantity<Q>> { | |
|
||
/** | ||
* Indicates if this unit is compatible with the unit specified. Units don't need to be equals to be compatible. For example (assuming {@code ONE} | ||
* is a dimensionless unit): | ||
* is a dimensionless unit):<br> | ||
* | ||
* <code> | ||
* RADIAN.equals(ONE) == false<br> | ||
|
@@ -153,7 +153,7 @@ public interface Unit<Q extends Quantity<Q>> { | |
|
||
/** | ||
* Casts this unit to a parameterized unit of specified nature or throw a {@code ClassCastException} if the dimension of the specified quantity and | ||
* this unit's dimension do not match. For example: | ||
* this unit's dimension do not match. For example:<br> | ||
* | ||
* <code> | ||
* {@literal Unit<Speed>} C = METRE.multiply(299792458).divide(SECOND).asType(Speed.class); | ||
|
@@ -234,7 +234,7 @@ public interface Unit<Q extends Quantity<Q>> { | |
|
||
/** | ||
* Returns the result of setting the origin of the scale of measurement to the given value. The returned unit is convertible with all units that are | ||
* convertible with this unit. For example the following code: | ||
* convertible with this unit. For example the following code:<br> | ||
* | ||
* <code> | ||
* CELSIUS = KELVIN.shift(273.15); | ||
|
@@ -252,7 +252,7 @@ public interface Unit<Q extends Quantity<Q>> { | |
|
||
/** | ||
* Returns the result of setting the origin of the scale of measurement to the given value. The returned unit is convertible with all units that are | ||
* convertible with this unit. For example the following code: | ||
* convertible with this unit. For example the following code:<br> | ||
* | ||
* <code> | ||
* CELSIUS = KELVIN.shift(273.15); | ||
|
@@ -269,10 +269,10 @@ public interface Unit<Q extends Quantity<Q>> { | |
|
||
/** | ||
* Returns the result of multiplying this unit by the specified factor. If the factor is an integer value, the multiplication is exact | ||
* (recommended). For example: | ||
* (recommended). For example:<br> | ||
* | ||
* <code> | ||
* FOOT = METRE.multiply(3048).divide(10000); // Exact definition. | ||
* FOOT = METRE.multiply(3048).divide(10000); // Exact definition.<br> | ||
* ELECTRON_MASS = KILOGRAM.multiply(9.10938188e-31); // Approximation. | ||
* </code> | ||
* | ||
|
@@ -284,10 +284,10 @@ public interface Unit<Q extends Quantity<Q>> { | |
Unit<Q> multiply(Number multiplier); | ||
|
||
/** | ||
* Returns the result of multiplying this unit by the specified factor. For example: | ||
* Returns the result of multiplying this unit by the specified factor. For example:<br> | ||
* | ||
* <code> | ||
* FOOT = METRE.multiply(3048).divide(10000); // Exact definition. | ||
* FOOT = METRE.multiply(3048).divide(10000); // Exact definition.<br> | ||
* ELECTRON_MASS = KILOGRAM.multiply(9.10938188e-31); // Approximation. | ||
* </code> | ||
* | ||
|
@@ -315,7 +315,7 @@ public interface Unit<Q extends Quantity<Q>> { | |
Unit<?> inverse(); | ||
|
||
/** | ||
* Returns the result of dividing this unit by a divisor. If the factor is an integer value, the division is exact. For example: | ||
* Returns the result of dividing this unit by a divisor. If the factor is an integer value, the division is exact. For example:<br> | ||
* | ||
* <code> | ||
* GRAM = KILOGRAM.divide(1000); // Exact definition. | ||
|
@@ -329,7 +329,7 @@ public interface Unit<Q extends Quantity<Q>> { | |
Unit<Q> divide(Number divisor); | ||
|
||
/** | ||
* Returns the result of dividing this unit by an approximate divisor. For example: | ||
* Returns the result of dividing this unit by an approximate divisor. For example:<br> | ||
* | ||
* <code> | ||
* GRAM = KILOGRAM.divide(1000d); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ | |
* Desruisseaux</a> | ||
* @author <a href="mailto:[email protected]">Thodoris Bais</a> | ||
* @author <a href="mailto:[email protected]">Andi Huber</a> | ||
* @version 1.3, March 11, 2019 | ||
* @version 1.4, May 12, 2019 | ||
* @since 1.0 | ||
* | ||
* @see Unit | ||
|
@@ -68,32 +68,28 @@ public interface UnitConverter { | |
* vector space (a scalar) to a one-dimensional vector space. Typically from 'R' to 'R', with 'R' the | ||
* real numbers. | ||
* | ||
* <p> | ||
* Given such a 'linear' converter 'A', let 'u', 'v' and 'r' be arbitrary numbers, then the following | ||
* must hold by definition: | ||
* | ||
* <ul> | ||
* <li>{@code A(u + v) == A(u) + A(v)}</li> | ||
* <li>{@code A(r * u) == r * A(u)}</li> | ||
* </ul> | ||
* </p> | ||
* | ||
* <p> | ||
* Given a second 'linear' converter 'B', commutativity of composition follows by above definition: | ||
* | ||
* <ul> | ||
* <li>{@code (A o B) (u) == (B o A) (u)}</li> | ||
* </ul> | ||
* | ||
* In other words, two 'linear' converters do have the property that {@code A(B(u)) == B(A(u))}, meaning | ||
* for 'A' and 'B' the order of their composition does not matter. Expressed as Java code: | ||
* </p> | ||
* <p> | ||
*{@code A.concatenate(B).convert(u) == B.concatenate(A).convert(u)} | ||
* </p> | ||
* <p> | ||
* for 'A' and 'B' the order of their composition does not matter. Expressed as Java code:<br> | ||
* <br> | ||
* | ||
*{@code A.concatenate(B).convert(u) == B.concatenate(A).convert(u)}<br> | ||
* <br> | ||
* | ||
* Note: For composing UnitConverters see also {@link UnitConverter#concatenate(UnitConverter)}. | ||
* </p> | ||
* | ||
* @return {@code true} if this converter represents a linear transformation; | ||
* {@code false} otherwise. | ||
|