Skip to content

Commit

Permalink
192: Public Review delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
keilw committed May 12, 2019
1 parent 885af0a commit 2b38832
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
22 changes: 11 additions & 11 deletions src/main/java/javax/measure/Unit.java
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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>
*
Expand All @@ -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>
*
Expand Down Expand Up @@ -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.
Expand All @@ -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);
Expand Down
18 changes: 7 additions & 11 deletions src/main/java/javax/measure/UnitConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 2b38832

Please sign in to comment.