Skip to content

Commit

Permalink
59: Add missing UCUM units
Browse files Browse the repository at this point in the history
Task-Url: #59
  • Loading branch information
keilw committed Sep 3, 2020
1 parent 438ac8c commit 959810c
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 16 deletions.
7 changes: 4 additions & 3 deletions common/src/main/jdk9/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
*/
module systems.uom.common {
requires transitive java.measure;
requires transitive si.uom.quantity;
requires transitive si.uom.units;
requires transitive tech.units.indriya;
requires transitive si.uom.quantity;
requires transitive tech.uom.lib.common;
requires transitive java.annotation;
requires transitive systems.uom.quantity;
requires tech.units.indriya;
requires si.uom.units;

exports systems.uom.common;
exports systems.uom.common.ancient;
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<properties>
<jdkVersion>1.8</jdkVersion>
<jsr.version>2.0</jsr.version>
<lib.version>2.0</lib.version>
<ri.version>2.0.2</ri.version>
<lib.version>2.0.2-SNAPSHOT</lib.version>
<ri.version>2.0.5-SNAPSHOT</ri.version>
<si.version>2.1-SNAPSHOT</si.version>
<quantity.version>2.0.2</quantity.version><!-- only need to change when new quantities added -->
<systems.version>2.1-SNAPSHOT</systems.version>
Expand Down
2 changes: 1 addition & 1 deletion src/main/config/uom-systems clean install.launch
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-14"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:systems-parent}"/>
</launchConfiguration>
77 changes: 77 additions & 0 deletions toolchains - Kopie.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<toolchains>
<!--
<toolchain>
<type>jdk</type>
<provides>
<version>1.7</version>
</provides>
<configuration>
<jdkHome>C:\Program Files\Java\jdk1.7.0_76</jdkHome>
</configuration>
</toolchain>
-->
<toolchain>
<type>jdk</type>
<provides>
<version>8</version>
</provides>
<configuration>
<jdkHome>C:\Program Files\Java\jdk1.8.0_221</jdkHome>
</configuration>
</toolchain>

<toolchain>
<type>jdk</type>
<provides>
<version>9</version>
</provides>
<configuration>
<jdkHome>C:\Program Files\Java\jdk-9.0.4</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>10</version>
</provides>
<configuration>
<jdkHome>C:\Program Files\Java\jdk-10.0.1</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>11</version>
</provides>
<configuration>
<jdkHome>C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>12</version>
</provides>
<configuration>
<jdkHome>C:\Program Files\Java\jdk-12.0.2</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>13</version>
</provides>
<configuration>
<jdkHome>C:\Program Files\AdoptOpenJDK\jdk-13.0.2.8-hotspot</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>14</version>
</provides>
<configuration>
<jdkHome>C:\Program Files\AdoptOpenJDK\jdk-14.0.0.36-hotspot</jdkHome>
</configuration>
</toolchain>
</toolchains>
13 changes: 10 additions & 3 deletions ucum/src/main/java/systems/uom/ucum/UCUM.java
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,17 @@ public static UCUM getInstance() {
public static final Unit<Dimensionless> HIGH_POWER_FIELD = addUnit(ONE);
public static final Unit<Dimensionless> LOW_POWER_FIELD = addUnit(ONE.multiply(100));

public static final Unit KATAL = addUnit(MOLE.divide(SECOND));
public static final Unit UNIT = addUnit(MICRO(MOLE).divide(MINUTE));
/**
* The SI unit for catalytic activity (standard name <code>kat</code>).
*/
public static final Unit<CatalyticActivity> KATAL = addUnit(Units.KATAL);

// public static final Unit INTERNATIONAL_UNIT = UNDEFINED;
public static final Unit<CatalyticActivity> UNIT = addUnit(MICRO(MOLE).divide(MINUTE).asType(CatalyticActivity.class));

public static final Unit<Dimensionless> INTERNATIONAL_UNIT = addUnit(new AlternateUnit<Dimensionless>(ONE, "IU"), "International Unit", "IU");

public static final Unit<Dimensionless> INTERNATIONAL_UNIT_UC = addUnit(new AlternateUnit<Dimensionless>(INTERNATIONAL_UNIT, "i.U."), "International Unit", "i.U.");

// public static final Unit ARBITRARY_UNIT = UNDEFINED;
// public static final Unit US_PHARMACOPEIA = UNDEFINED;
// public static final Unit GPL = UNDEFINED;
Expand Down
3 changes: 1 addition & 2 deletions ucum/src/main/java/systems/uom/ucum/format/UCUMFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ public static UCUMFormat getInstance(Variant variant, SymbolMap symbolMap) {
* Get the symbol map used by this instance to map between {@link AbstractUnit Unit}s and <code>String</code>s, etc...
*
* @return SymbolMap the current symbol map
*/
@Override
*/
protected SymbolMap getSymbols() {
return symbolMap;
}
Expand Down
1 change: 0 additions & 1 deletion ucum/src/main/jdk9/systems/uom/ucum/format/UCUMFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ public static UCUMFormat getInstance(Variant variant, SymbolMap symbolMap) {
*
* @return SymbolMap the current symbol map
*/
@Override
protected SymbolMap getSymbols() {
return symbolMap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

public class SystemOfUnitsServiceTest {
private static final String EXPECTED_SYSTEM_NAME = "Unified Code for Units of Measure";
private static final int NUM_OF_UNITS = 245;
private static final int NUM_OF_UNITS = 247;

private static SystemOfUnitsService defaultService;

Expand Down
5 changes: 3 additions & 2 deletions unicode/src/main/jdk9/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
*/
module systems.uom.unicode {
requires transitive java.measure;
requires transitive tech.units.indriya;
requires transitive tech.uom.lib.common;
requires transitive systems.uom.quantity;

requires tech.units.indriya;

exports systems.uom.unicode;
exports systems.uom.unicode.spi;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.junit.jupiter.api.Test;

public class SystemOfUnitsServiceTest {
private static final int NUM_OF_UNITS = 43;
private static final int NUM_OF_UNITS = 44;
private static final int NUM_OF_UNITS_CLDR = 96;

private static SystemOfUnitsService defaultService;
Expand Down

0 comments on commit 959810c

Please sign in to comment.