Refactoring
Change-Id: I7a39e8a27a817ef7e7474fb4eeb01ed6582a8bb0
diff --git a/bundles/org.eclipse.uomo.ucum/pom.xml b/bundles/org.eclipse.uomo.ucum/pom.xml
index ebf734e..94ae924 100644
--- a/bundles/org.eclipse.uomo.ucum/pom.xml
+++ b/bundles/org.eclipse.uomo.ucum/pom.xml
@@ -15,12 +15,12 @@
<artifactId>unit-api</artifactId>
</dependency>
<dependency>
- <groupId>tec.uom</groupId>
- <artifactId>uom-se</artifactId>
- <version>${uom-se-version}</version>
+ <groupId>tech.units</groupId>
+ <artifactId>indriya</artifactId>
+ <version>${indriya-version}</version>
</dependency>
<dependency>
- <groupId>tec.uom.lib</groupId>
+ <groupId>tech.uom.lib</groupId>
<artifactId>uom-lib-common</artifactId>
<version>${uom-lib-version}</version>
</dependency>
@@ -31,7 +31,7 @@
<repository>
<id>jcenter</id>
<name>JCenter</name>
- <url>http://jcenter.bintray.com</url>
+ <url>https://jcenter.bintray.com</url>
</repository>
<repository>
<snapshots>
@@ -39,7 +39,7 @@
</snapshots>
<id>bintray-release</id>
<name>libs-release</name>
- <url>http://oss.jfrog.org/artifactory/libs-release</url>
+ <url>https://oss.jfrog.org/artifactory/libs-release</url>
</repository>
<repository>
<snapshots>
@@ -47,12 +47,12 @@
</snapshots>
<id>bintray-snapshot</id>
<name>libs-snapshot</name>
- <url>http://oss.jfrog.org/artifactory/libs-snapshot</url>
+ <url>https://oss.jfrog.org/artifactory/libs-snapshot</url>
</repository>
<repository>
<id>bintray-uom</id>
<name>Bintray Units of Measurement</name>
- <url>http://dl.bintray.com/unitsofmeasurement/maven</url>
+ <url>https://dl.bintray.com/unitsofmeasurement/maven</url>
</repository>
</repositories>
</project>
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/.classpath b/bundles/org.eclipse.uomo.units/.classpath
index 015edce..779a9ed 100644
--- a/bundles/org.eclipse.uomo.units/.classpath
+++ b/bundles/org.eclipse.uomo.units/.classpath
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java/"/>
<classpathentry kind="src" path="src/main/resources/"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <attributes>
+ <attribute name="owner.project.facets" value="java"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractQuantity.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractQuantity.java
index 0fd353a..87c2ff8 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractQuantity.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractQuantity.java
@@ -32,7 +32,7 @@
*
* <p>
* <code>
- * public static final Quantity<Velocity> C = NumberQuantity.parse("299792458 m/s").asType(Velocity.class);
+ * public static final Quantity<Speed> C = NumberQuantity.parse("299792458 m/s").asType(Speed.class);
* // Speed of Light (exact).
* </code>
* </p>
@@ -40,7 +40,7 @@
* <p>
* Quantities can be converted to different units.<br>
* <code>
- * Quantity<Velocity> milesPerHour = C.to(MILES_PER_HOUR); // Use double implementation (fast).
+ * Quantity<Speed> milesPerHour = C.to(MILES_PER_HOUR); // Use double implementation (fast).
* System.out.println(milesPerHour);
*
* > 670616629.3843951 m/h
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractUnit.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractUnit.java
index f317904..0c3d57b 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractUnit.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractUnit.java
@@ -177,9 +177,9 @@
* <p>
* Because the metric unit is unique by quantity type, it can be be used to
* identify the quantity given the unit. For example:[code] static boolean
- * isAngularVelocity(Unit<?> unit) { return
+ * isAngularSpeed(Unit<?> unit) { return
* unit.toMetric().equals(RADIAN.divide(SECOND)); }
- * assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true.
+ * assert(REVOLUTION.divide(MINUTE).isAngularSpeed()); // Returns true.
* [/code]
*
* @return the metric unit this unit is derived from or <code>this</code> if
@@ -254,8 +254,8 @@
* Casts this unit to a parameterized unit of specified nature or throw a
* <code>ClassCastException</code> if the dimension of the specified
* quantity and this unit's dimension do not match. For example:[code]
- * Unit<Velocity> C =
- * METRE.times(299792458).divide(SECOND).asType(Velocity.class); [/code]
+ * Unit<Speed> C =
+ * METRE.times(299792458).divide(SECOND).asType(Speed.class); [/code]
*
* @param <T>
* The type of the quantity measured by the unit.
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/SI.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/SI.java
index 9af663f..4b2bc05 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/SI.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/SI.java
@@ -312,7 +312,7 @@
* becquerel is the radiation caused by one disintegration per second. It is
* named after the French physicist, Antoine-Henri Becquerel (1852-1908).
*/
- public static final Unit<RadioactiveActivity> BECQUEREL = addUnit(new AlternateUnit<RadioactiveActivity>(
+ public static final Unit<Radioactivity> BECQUEREL = addUnit(new AlternateUnit<Radioactivity>(
Messages.SI_Bq,
(AbstractUnit<?>) AbstractUnit.ONE.divide(SECOND)));
@@ -344,10 +344,10 @@
// ////////////////////////////
/**
- * The metric unit for velocity quantities (<code>m/s</code>).
+ * The metric unit for Speed quantities (<code>m/s</code>).
*
*/
- public static final Unit<Velocity> METRES_PER_SECOND = addUnit(new ProductUnit<Velocity>(
+ public static final Unit<Speed> METRES_PER_SECOND = addUnit(new ProductUnit<Speed>(
(AbstractUnit<?>) METRE.divide(SECOND)));
/**
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/NumberQuantity.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/NumberQuantity.java
index 6358d94..411a6c2 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/NumberQuantity.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/NumberQuantity.java
@@ -264,4 +264,10 @@
public static Quantity<?> parse(CharSequence csq) {
return QuantityFormat.getInstance().parse(csq);
}
+
+@Override
+protected boolean isBig() {
+ // TODO Auto-generated method stub
+ return false;
+}
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/AccelerationAmount.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/AccelerationAmount.java
index 726819f..492e2ab 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/AccelerationAmount.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/AccelerationAmount.java
@@ -16,7 +16,7 @@
/**
- * Represents the rate of change of velocity with respect to time.
+ * Represents the rate of change of Speed with respect to time.
* The metric system unit for this quantity is "m/s²" (metre per square second).
*
* @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/RadioactivityAmount.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/RadioactivityAmount.java
index a846a4e..9b83c4d 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/RadioactivityAmount.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/RadioactivityAmount.java
@@ -11,21 +11,21 @@
package org.eclipse.uomo.units.impl.quantity;
import org.eclipse.uomo.units.impl.BaseQuantity;
-import javax.measure.quantity.RadioactiveActivity;
+import javax.measure.quantity.Radioactivity;
import javax.measure.Unit;
/**
- * Represents radioactivity. The metric system unit for this quantity is "Bq"
+ * Represents Radioactivity. The metric system unit for this quantity is "Bq"
* (Becquerel).
*
* @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
* @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>
* @version 1.2, $Date: 2014-03-03 $
*/
-public class RadioactivityAmount extends BaseQuantity<RadioactiveActivity>
- implements RadioactiveActivity {
+public class RadioactivityAmount extends BaseQuantity<Radioactivity>
+ implements Radioactivity {
- public RadioactivityAmount(Number number, Unit<RadioactiveActivity> unit) {
+ public RadioactivityAmount(Number number, Unit<Radioactivity> unit) {
super(number, unit);
}
}
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/VelocityAmount.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/VelocityAmount.java
index 5a906c2..9410125 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/VelocityAmount.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/VelocityAmount.java
@@ -11,7 +11,7 @@
package org.eclipse.uomo.units.impl.quantity;
import org.eclipse.uomo.units.impl.BaseQuantity;
-import javax.measure.quantity.Velocity;
+import javax.measure.quantity.Speed;
import javax.measure.Unit;
/**
@@ -22,9 +22,9 @@
* @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>
* @version 1.2, ($Revision: 212 $), $Date: 2010-09-13 23:50:44 +0200 (Mo, 13 Sep 2010) $
*/
-public class VelocityAmount extends BaseQuantity<Velocity> {
+public class SpeedAmount extends BaseQuantity<Speed> {
- public VelocityAmount(Number number, Unit<Velocity> unit) {
+ public SpeedAmount(Number number, Unit<Speed> unit) {
super(number, unit);
}
}
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/package-info.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/package-info.java
index 13147c7..34cf351 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/package-info.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/quantity/package-info.java
@@ -27,9 +27,9 @@
* metres) before the computation begin. For this purpose, the {@code Quantity} interface
* provides the {@code longValue(Unit<Q>)} and {@code doubleValue(Unit<Q>)} convenience
* methods. Example:[code]
- * TimeAmount calculateTravelTime(Length distance, Velocity velocity) {
+ * TimeAmount calculateTravelTime(Length distance, Speed Speed) {
* double seconds = distance.doubleValue(METRE) /
- * velocity.doubleValue(METRE_PER_SECOND);
+ * Speed.doubleValue(METRE_PER_SECOND);
* return new TimeAmount(seconds, SECOND);
* }
* [/code]
@@ -40,7 +40,7 @@
* Sensor<Temperature> sensor ... // Generic sensor.
* Temperature temp = sensor.getValue();
* MassAmount mass = new MassAmount(180, POUND); // Combination magnitude/precision/unit (measurement)
- * Vector3D<Velocity> aircraftSpeed = new Vector3D(12.0, 34.0, -45.5, METRE_PER_SECOND);
+ * Vector3D<Speed> aircraftSpeed = new Vector3D(12.0, 34.0, -45.5, METRE_PER_SECOND);
* [/code]</p>
*
* <p> This package holds only the quantities required by the metric system.</p>
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/Imperial.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/Imperial.java
index e0d1029..67300ed 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/Imperial.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/Imperial.java
@@ -138,7 +138,7 @@
static final Unit<Time> HOUR = addUnit(MINUTE.multiply(60));
// ////////////
- // Velocity //
+ // Speed //
// ////////////
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/SI.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/SI.java
index 9e859da..f084f04 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/SI.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/SI.java
@@ -312,7 +312,7 @@
* becquerel is the radiation caused by one disintegration per second. It is
* named after the French physicist, Antoine-Henri Becquerel (1852-1908).
*/
- public static final Unit<RadioactiveActivity> BECQUEREL = addUnit(new AlternateUnit<RadioactiveActivity>(
+ public static final Unit<Radioactivity> BECQUEREL = addUnit(new AlternateUnit<Radioactivity>(
Messages.SI_Bq,
(AbstractUnit<?>) AbstractUnit.ONE.divide(SECOND)));
@@ -344,10 +344,10 @@
// ////////////////////////////
/**
- * The metric unit for velocity quantities (<code>m/s</code>).
+ * The metric unit for Speed quantities (<code>m/s</code>).
*
*/
- public static final Unit<Velocity> METRES_PER_SECOND = addUnit(new ProductUnit<Velocity>(
+ public static final Unit<Speed> METRES_PER_SECOND = addUnit(new ProductUnit<Speed>(
(AbstractUnit<?>) METRE.divide(SECOND)));
/**
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/Units.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/Units.java
index 9657eda..8037edd 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/Units.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/system/Units.java
@@ -303,7 +303,7 @@
public static final Unit<Volume> CUBIC_METRE = addUnit(new ProductUnit<Volume>(SQUARE_METRE.multiply(METRE)), Volume.class);
/**
- * A unit of velocity expressing the number of international {@link #KILOMETRE kilometres} per {@link #HOUR hour} (abbreviation <code>km/h</code>).
+ * A unit of Speed expressing the number of international {@link #KILOMETRE kilometres} per {@link #HOUR hour} (abbreviation <code>km/h</code>).
*/
public static final Unit<Speed> KILOMETRE_PER_HOUR = addUnit(METRE_PER_SECOND.multiply(0.277778d)).asType(Speed.class);
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/internal/NonSI.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/internal/NonSI.java
index f703ef8..23c8efd 100644
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/internal/NonSI.java
+++ b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/internal/NonSI.java
@@ -347,13 +347,13 @@
.multiply(Math.PI).asType(Angle.class));
// ////////////
- // Velocity //
+ // Speed //
// ////////////
/**
- * A unit of velocity relative to the speed of light (standard name
+ * A unit of Speed relative to the speed of light (standard name
* <code>c</code>).
*/
- static final Unit<Velocity> C = addUnit(METRES_PER_SECOND
+ static final Unit<Speed> C = addUnit(METRES_PER_SECOND
.multiply(299792458));
// ////////////////
@@ -475,7 +475,7 @@
// /////////
/**
* A unit of power equal to the power required to raise a mass of 75
- * kilograms at a velocity of 1 meter per second (metric, standard name
+ * kilograms at a Speed of 1 meter per second (metric, standard name
* <code>hp</code>).
*/
static final Unit<Power> HORSEPOWER = addUnit(WATT.multiply(735.499));
@@ -535,14 +535,14 @@
* A unit of radioctive activity equal to the activity of a gram of radium
* (standard name <code>Ci</code>).
*/
- static final Unit<RadioactiveActivity> CURIE = addUnit(BECQUEREL
+ static final Unit<Radioactivity> CURIE = addUnit(BECQUEREL
.multiply(37000000000L));
/**
* A unit of radioctive activity equal to 1 million radioactive
* disintegrations per second (standard name <code>Rd</code>).
*/
- static final Unit<RadioactiveActivity> RUTHERFORD = addUnit(BECQUEREL
+ static final Unit<Radioactivity> RUTHERFORD = addUnit(BECQUEREL
.multiply(1000000));
// ///////////////
diff --git a/pom.xml b/pom.xml
index e0b314c..3af4711 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,13 +18,13 @@
<properties>
<sourceEncoding>UTF-8</sourceEncoding> <!-- in Maven 3. -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.build.javaVersion>1.7</project.build.javaVersion>
+ <project.build.javaVersion>1.8</project.build.javaVersion>
<maven.compilerPlugin.version>2.3.2</maven.compilerPlugin.version>
<uomo-version>0.8.0-SNAPSHOT</uomo-version>
<tycho-version>1.0.0</tycho-version>
<unit-api-version>1.0</unit-api-version>
- <uom-lib-version>1.0.1</uom-lib-version>
- <uom-se-version>1.0.6</uom-se-version>
+ <uom-lib-version>1.1</uom-lib-version>
+ <indriya-version>1.3</indriya-version>
<icu4j-version>56.1</icu4j-version>
<junit.version>4.12</junit.version>
<karaf.version>4.0.3</karaf.version>