This repository has been archived by the owner on May 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
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
16 additions
and
10 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
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 |
---|---|---|
|
@@ -64,14 +64,14 @@ | |
* @see <a href= "http://en.wikipedia.org/wiki/International_System_of_Units">Wikipedia: International System of Units</a> | ||
* @author <a href="mailto:[email protected]">Jean-Marie Dautelle</a> | ||
* @author <a href="mailto:[email protected]">Werner Keil</a> | ||
* @version 1.0.4, March 17, 2017 | ||
* @version 1.0.5, April 4, 2017 | ||
* @since 1.0 | ||
*/ | ||
public abstract class AbstractUnit<Q extends Quantity<Q>> implements Unit<Q>, Comparable<Unit<Q>>, Serializable { | ||
|
||
/** | ||
* | ||
*/ | ||
* | ||
*/ | ||
private static final long serialVersionUID = -4344589505537030204L; | ||
|
||
/** | ||
|
@@ -126,8 +126,8 @@ public boolean isSystemUnit() { | |
/** | ||
* Returns the unscaled {@link SI} unit from which this unit is derived. | ||
* | ||
* They SI unit can be be used to identify a quantity given the unit. For example:[code] static boolean isAngularVelocity(AbstractUnit<?> unit) { | ||
* return unit.toSI().equals(RADIAN.divide(SECOND)); } assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true. [/code] | ||
* The SI unit can be be used to identify a quantity given the unit. For example:<code> static boolean isAngularVelocity(AbstractUnit<?> unit) { | ||
* return unit.toSystemUnit().equals(RADIAN.divide(SECOND)); } assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true. </code> | ||
* | ||
* @return the unscaled metric unit from which this unit is derived. | ||
*/ | ||
|
@@ -143,8 +143,9 @@ public boolean isSystemUnit() { | |
|
||
/** | ||
* Annotates the specified unit. Annotation does not change the unit semantic. Annotations are often written between curly braces behind units. For | ||
* example: [code] AbstractUnit<Volume> PERCENT_VOL = Units.PERCENT.annotate("vol"); // "%{vol}" AbstractUnit<Mass> KG_TOTAL = | ||
* Units.KILOGRAM.annotate("total"); // "kg{total}" AbstractUnit<Dimensionless> RED_BLOOD_CELLS = Units.ONE.annotate("RBC"); // "{RBC}" [/code] | ||
* example: | ||
* <code> AbstractUnit<Volume> PERCENT_VOL = Units.PERCENT.annotate("vol"); // "%{vol}" AbstractUnit<Mass> KG_TOTAL = | ||
* Units.KILOGRAM.annotate("total"); // "kg{total}" AbstractUnit<Dimensionless> RED_BLOOD_CELLS = Units.ONE.annotate("RBC"); // "{RBC}" </code> | ||
* | ||
* Note: Annotation of system units are not considered themselves as system units. | ||
* | ||
|
@@ -195,8 +196,9 @@ public String toString() { | |
|
||
/** | ||
* Returns the system unit (unscaled SI unit) from which this unit is derived. They can be be used to identify a quantity given the unit. For | ||
* example:[code] static boolean isAngularVelocity(AbstractUnit<?> unit) { return unit.getSystemUnit().equals(RADIAN.divide(SECOND)); } | ||
* assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true. [/code] | ||
* example:<br> | ||
* <code> static boolean isAngularVelocity(AbstractUnit<?> unit) {<br> return unit.getSystemUnit().equals(RADIAN.divide(SECOND));<br>} | ||
* <br>assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true. </code> | ||
* | ||
* @return the unscaled metric unit from which this unit is derived. | ||
*/ | ||
|