Update dependencies
Change-Id: If51493e5eab538095396c9f2b9d268654ac77456
diff --git a/bundles/org.eclipse.uomo.business/.classpath b/bundles/org.eclipse.uomo.business/.classpath
index 04f0184..b5948d9 100644
--- a/bundles/org.eclipse.uomo.business/.classpath
+++ b/bundles/org.eclipse.uomo.business/.classpath
@@ -1,7 +1,8 @@
-<?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="output" path="target/classes"/>
-</classpath>
+<?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="con" path="org.eclipse.jdt.USER_LIBRARY/Indriya"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/bundles/org.eclipse.uomo.business/META-INF/MANIFEST.MF b/bundles/org.eclipse.uomo.business/META-INF/MANIFEST.MF
index 20c681a..d3e81d8 100644
--- a/bundles/org.eclipse.uomo.business/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.uomo.business/META-INF/MANIFEST.MF
@@ -4,6 +4,19 @@
Bundle-SymbolicName: org.eclipse.uomo.business
Bundle-Version: 0.8.0.qualifier
Bundle-Vendor: Eclipse.org
+Import-Package: javax.measure;version="[1.0,2)",
+ javax.measure.format;version="[1.0,2)",
+ javax.measure.quantity;version="[1.0,2)",
+ javax.measure.spi;version="[1.0,2)",
+ tech.units.indriya,
+ tech.units.indriya.format,
+ tech.units.indriya.function,
+ tech.units.indriya.quantity,
+ tech.units.indriya.spi,
+ tech.units.indriya.unit,
+ systems.uom.quantity
Require-Bundle: org.eclipse.uomo.core;bundle-version="0.8.0",
- tech.units.indriya;bundle-version="1.3.0"
+ tech.uom.lib.uom-lib-common;bundle-version="1.1.0",
+ tech.units.indriya;bundle-version="1.3.0",
+ com.ibm.icu;bundle-version="4.2.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MonetaryUnits.java b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MonetaryUnits.java
index 25c173b..6706e4a 100644
--- a/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MonetaryUnits.java
+++ b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MonetaryUnits.java
@@ -59,7 +59,7 @@
* @return <code>unit</code>.
*/
private final static <U extends Unit<?>> U monetary(U unit) {
- UNITS.add(unit);
+ INSTANCE.add(unit);
return unit;
}
diff --git a/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MoneyConverter.java b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MoneyConverter.java
index 372ad53..79902d3 100644
--- a/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MoneyConverter.java
+++ b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MoneyConverter.java
@@ -23,7 +23,6 @@
import org.eclipse.uomo.business.internal.ExchangeRate;
import org.eclipse.uomo.business.internal.Messages;
import org.eclipse.uomo.business.types.IMoney;
-import org.eclipse.uomo.units.AbstractConverter;
import javax.measure.Unit;
import javax.measure.UnitConverter;
@@ -46,10 +45,10 @@
*
* @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
* @author <a href="mailto:units@catmedia.us">Werner Keil</a>
- * @version 5.3, $Date: 2013-05-25 $
+ * @version 5.4, $Date: 2020-03-17 $
* @deprecated use JSR 354
*/
-public class MoneyConverter extends AbstractConverter implements Formattable {
+public class MoneyConverter implements UnitConverter, Formattable {
/**
*
@@ -284,4 +283,10 @@
fmt.format(sb.toString());
}
+
+ @Override
+ public List<? extends UnitConverter> getConversionSteps() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MoneyUnit.java b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MoneyUnit.java
index 0a37c43..151fbb3 100644
--- a/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MoneyUnit.java
+++ b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MoneyUnit.java
@@ -19,28 +19,30 @@
import org.eclipse.uomo.business.internal.Localizable;
import org.eclipse.uomo.business.types.IMoney;
import org.eclipse.uomo.core.IName;
-import org.eclipse.uomo.units.AbstractConverter;
-import org.eclipse.uomo.units.AbstractUnit;
-import org.eclipse.uomo.units.impl.AlternateUnit;
-import org.eclipse.uomo.units.impl.ProductUnit;
-import org.eclipse.uomo.units.impl.TransformedUnit;
-import org.eclipse.uomo.units.impl.converter.AddConverter;
-import org.eclipse.uomo.units.impl.converter.MultiplyConverter;
-import org.eclipse.uomo.units.impl.converter.RationalConverter;
+
import javax.measure.Quantity;
+import javax.measure.UnconvertibleException;
import javax.measure.Dimension;
-import org.unitsofmeasurement.unit.IncommensurableException;
-import org.unitsofmeasurement.unit.UnconvertibleException;
+import javax.measure.IncommensurableException;
import javax.measure.Unit;
import javax.measure.UnitConverter;
import com.ibm.icu.util.Currency;
import com.ibm.icu.util.ULocale;
+import tech.units.indriya.AbstractConverter;
+import tech.units.indriya.AbstractUnit;
+import tech.units.indriya.function.AddConverter;
+import tech.units.indriya.function.MultiplyConverter;
+import tech.units.indriya.function.RationalConverter;
+import tech.units.indriya.unit.AlternateUnit;
+import tech.units.indriya.unit.ProductUnit;
+import tech.units.indriya.unit.TransformedUnit;
+
/**
* @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>
- * @version 0.2.8, $Date: 2015-04-15
+ * @version 0.3, $Date: 2020-03-16
* @param <Q> the monetary quantity
*
*/
@@ -168,7 +170,7 @@
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public final Unit<IMoney> alternate(String symbol) {
- return new AlternateUnit(symbol, this);
+ return new AlternateUnit(this, symbol);
}
public <T extends Quantity<T>> Unit<T> asType(Class<T> type) {
@@ -244,7 +246,7 @@
return this;
if (this.isRationalFactor())
return this.transform(this.getConverterTo((Unit) ONE).inverse());
- return ProductUnit.getQuotientInstance(ONE, this);
+ return ProductUnit.ofQuotient(ONE, this);
}
public boolean isCompatible(Unit<?> that) {
@@ -300,7 +302,7 @@
return that.transform(this.getConverterTo(ONE));
if (((MoneyUnit<?>) that).isRationalFactor())
return this.transform(that.getConverterTo((Unit) ONE));
- return ProductUnit.getProductInstance(this, (AbstractUnit<?>) that);
+ return ProductUnit.ofProduct(this, (AbstractUnit<?>) that);
}
/**
@@ -332,7 +334,7 @@
*/
public final Unit<?> root(int n) {
if (n > 0)
- return ProductUnit.getRootInstance(this, n);
+ return ProductUnit.ofRoot(this, n);
else if (n == 0)
throw new ArithmeticException("Root's order of zero"); //$NON-NLS-1$
else
@@ -361,7 +363,7 @@
Unit<IMoney> tf = this;
Unit<?> parent = (Unit<?>) ((TransformedUnit<?>) tf)
.getParentUnit();
- UnitConverter toParent = ((TransformedUnit<?>) tf).toParentUnit();
+ UnitConverter toParent = tf.getConverterTo((Unit<IMoney>) parent);
if (toParent == null)
return (Unit<IMoney>) parent;
UnitConverter toParentConcat = toParent.concatenate(operation);
@@ -478,6 +480,18 @@
return new MoneyUnit(currencyCode);
}
+ @Override
+ public Map<? extends Unit<?>, Integer> getBaseUnits() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Unit<IMoney> shift(double offset) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
// public String getDisplayName(Locale locale) {
// return getName(ULocale.forLocale(locale), LONG_NAME, new boolean[1]);
// }
diff --git a/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/types/IMarket.java b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/types/IMarket.java
index 183601d..3e4d223 100644
--- a/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/types/IMarket.java
+++ b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/types/IMarket.java
@@ -4,7 +4,7 @@
import org.eclipse.uomo.core.IName;
import org.eclipse.uomo.core.ISymbol;
-import org.unitsofmeasurement.quantity.Time;
+import javax.measure.quantity.Time;
import javax.measure.Unit;
import com.ibm.icu.util.Holiday;
diff --git a/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/types/IMoney.java b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/types/IMoney.java
index e6d98fb..1613d5f 100644
--- a/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/types/IMoney.java
+++ b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/types/IMoney.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2005, 2010, Werner Keil, Ikayzo and others.
+ * Copyright (c) 2005, 2020, Werner Keil and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,8 +12,8 @@
import static org.eclipse.uomo.business.money.MoneyAmount.UNIT;
-import org.eclipse.uomo.units.IMeasure;
import javax.measure.Dimension;
+import javax.measure.Quantity;
/**
* This interface represents something generally accepted as a medium of
@@ -24,7 +24,7 @@
* @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>
* @version 3.2 ($Revision: 227 $), $Date: 2010-10-01 00:54:55 +0200 (Fr, 01 Okt 2010) $
*/
-public interface IMoney extends IBDType, IMeasure<IMoney> {
+public interface IMoney extends IBDType, Quantity<IMoney> {
/**
* Holds the dimension for money quantities (dimension [$]).