Merged from 0.8

Change-Id: I02cf4990118631fcb34846b6f84a1ccd6798021d
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 3e0903b..90a06af 100644
--- a/bundles/org.eclipse.uomo.business/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.uomo.business/META-INF/MANIFEST.MF
@@ -4,6 +4,17 @@
 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",
- org.eclipse.uomo.units;bundle-version="0.5.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 3f9c181..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
@@ -1,5 +1,5 @@
 /**

- * Copyright (c) 2006, 2013, Werner Keil and others.

+ * Copyright (c) 2006, 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

@@ -11,8 +11,8 @@
 package org.eclipse.uomo.business.money;

 

 import org.eclipse.uomo.business.types.IMoney;

-import org.eclipse.uomo.units.AbstractSystemOfUnits;

-import org.unitsofmeasurement.unit.SystemOfUnits;

+import tech.units.indriya.AbstractSystemOfUnits;

+import javax.measure.spi.SystemOfUnits;

 import javax.measure.Unit;

 

 import com.ibm.icu.util.Currency;

@@ -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/MoneyAmount.java b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MoneyAmount.java
index 3598c5a..2c94656 100644
--- a/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MoneyAmount.java
+++ b/bundles/org.eclipse.uomo.business/src/main/java/org/eclipse/uomo/business/money/MoneyAmount.java
@@ -18,11 +18,10 @@
 import org.eclipse.uomo.business.internal.CurrencyUnit;
 import org.eclipse.uomo.business.internal.MonetaryAmount;
 import org.eclipse.uomo.business.internal.MonetaryOperator;
-import org.eclipse.uomo.business.types.IMoney;
+import org.eclipse.uomo.business.types.Quantity;
 import org.eclipse.uomo.core.UOMoRuntimeException;
-import org.eclipse.uomo.units.AbstractConverter;
-import org.eclipse.uomo.units.IMeasure;
-import org.eclipse.uomo.units.QuantityAmount;
+import tech.units.indriya.AbstractConverter;
+import javax.measure.Quantity;
 import org.eclipse.uomo.units.impl.converter.RationalConverter;
 import org.unitsofmeasurement.unit.IncommensurableException;
 import org.unitsofmeasurement.unit.UnconvertibleException;
@@ -40,13 +39,13 @@
  * @author <a href="mailto:units@catmedia.us">Werner Keil</a>
  * @version 0.8, $Date: 2014-08-03 $
  */
-public class MoneyAmount extends QuantityAmount<IMoney> implements IMoney, MonetaryAmount,
+public class MoneyAmount extends QuantityAmount<Quantity> implements Quantity, MonetaryAmount,
 		Comparable<MonetaryAmount> {
 
 	/**
 	 * Holds the base unit for money quantities (symbol "$").
 	 */
-	public final static MoneyUnit<IMoney> UNIT = new MoneyUnit<IMoney>(
+	public final static MoneyUnit<Quantity> UNIT = new MoneyUnit<Quantity>(
 			"$");
 
 	/**
@@ -134,7 +133,7 @@
 	 *             if the SI unit of the specified amount is not a
 	 *             {@link Currency}.
 	 */
-	public static MoneyAmount of(QuantityAmount<IMoney> amount) {
+	public static MoneyAmount of(QuantityAmount<Quantity> amount) {
 		// MoneyAmount amountSI = amount.toSI();
 		return MoneyAmount.of(BigDecimal.valueOf(amount.getValue()
 				.doubleValue()), amount.unit().getSystemUnit());
@@ -183,7 +182,7 @@
 	// return MoneyAmount.valueOf(_value.opposite(), getCurrency());
 	// }
 
-	protected MoneyAmount plus(IMoney that) {
+	protected MoneyAmount plus(Quantity that) {
 		// Measure<BigDecimal, ?> amount = that.to((Unit) getCurrency());
 		return MoneyAmount.of(this.getNumber().doubleValue()
 				+ that.value().doubleValue(), getCurrency());
@@ -254,17 +253,17 @@
 	 * @provisional This API might change or be removed in a future release.
 	 */
 	@SuppressWarnings("unchecked")
-	public MoneyUnit<IMoney> unit() {
-		return (MoneyUnit<IMoney>) getUnit();
+	public MoneyUnit<Quantity> unit() {
+		return (MoneyUnit<Quantity>) getUnit();
 	}
 
-	public int compareTo(IMoney o) {
+	public int compareTo(Quantity o) {
 		// TODO Auto-generated method stub
 		return 0;
 	}
 
-	public double doubleValue(Unit<IMoney> unit) {
-		Unit<IMoney> myUnit = unit();
+	public double doubleValue(Unit<Quantity> unit) {
+		Unit<Quantity> myUnit = unit();
 		try {
 			UnitConverter converter = unit.getConverterToAny(myUnit);
 			return converter.convert(getNumber().doubleValue());
@@ -275,8 +274,8 @@
 		}
 	}
 
-	public long longValue(Unit<IMoney> unit) throws ArithmeticException {
-		Unit<IMoney> myUnit = unit();
+	public long longValue(Unit<Quantity> unit) throws ArithmeticException {
+		Unit<Quantity> myUnit = unit();
 		try {
 			UnitConverter converter = unit.getConverterToAny(myUnit);
 			return (converter.convert(BigDecimal.valueOf(super.getNumber()
@@ -288,25 +287,25 @@
 		}
 	}
 
-	public IMeasure<IMoney> divide(IMeasure<?> that) {
+	public Quantity<Quantity> divide(Quantity<?> that) {
 		return divide((MoneyAmount) that);
 	}
 
-	public IMeasure<IMoney> multiply(IMeasure<?> that) {
+	public Quantity<Quantity> multiply(Quantity<?> that) {
 		return multiply((MonetaryAmount) that);
 	}
 
-	public IMeasure<IMoney> to(Unit<IMoney> unit) {
+	public Quantity<Quantity> to(Unit<Quantity> unit) {
 		return to(unit, MathContext.DECIMAL32);
 	}
 
-	protected IMeasure<IMoney> to(Unit<IMoney> unit, MathContext ctx) {
+	protected Quantity<Quantity> to(Unit<Quantity> unit, MathContext ctx) {
 		if (this.unit().equals(unit))
 			return this;
 		UnitConverter cvtr = this.unit().getConverterTo(unit);
 		if (cvtr == AbstractConverter.IDENTITY)
-			return (IMeasure<IMoney>) of(this.getNumber(), unit);
-		return (IMeasure<IMoney>) of(convert(this.getNumber(), cvtr, ctx),
+			return (Quantity<Quantity>) of(this.getNumber(), unit);
+		return (Quantity<Quantity>) of(convert(this.getNumber(), cvtr, ctx),
 				unit);
 	}
 
@@ -367,8 +366,8 @@
 		return getNumber();
 	}
 
-	public IMeasure<? extends IMeasure<IMoney>> inverse() {
-		final IMeasure<? extends IMeasure<IMoney>> m = of(value(), unit()
+	public Quantity<? extends Quantity<Quantity>> inverse() {
+		final Quantity<? extends Quantity<Quantity>> m = of(value(), unit()
 				.inverse());
 		return m;
 	}
@@ -690,8 +689,8 @@
 	}
 
 	@Override
-	public IMoney add(IMeasure<IMoney> that) {
-		return plus((IMoney) that);
+	public Quantity add(Quantity<Quantity> that) {
+		return plus((Quantity) that);
 	}
 
 	@Override
@@ -700,7 +699,7 @@
 	}
 
 	@Override
-	public IMeasure<IMoney> subtract(IMeasure<IMoney> that) {
+	public Quantity<Quantity> subtract(Quantity<Quantity> that) {
 		// TODO Auto-generated method stub
 		return null;
 	}
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 [$]).
diff --git a/bundles/org.eclipse.uomo.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.uomo.core/META-INF/MANIFEST.MF
index 2cddaef..710e0c7 100644
--- a/bundles/org.eclipse.uomo.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.uomo.core/META-INF/MANIFEST.MF
@@ -19,7 +19,7 @@
 Bundle-Activator: org.eclipse.uomo.core.internal.Activator

 Bundle-ManifestVersion: 2

 Bundle-Description: UOMo adds Units of Measurement support for IT Syst

- ems and Services both to Language and Data.

+ ems to Services and Data.

 Import-Package: com.ibm.icu.math,

  org.osgi.framework;version="1.3",

  org.osgi.util.tracker

@@ -27,6 +27,4 @@
 Bundle-DocURL: http://www.eclipse.org

 Include-Resource: src/main/resources

 Originally-Created-By: 1.6.0_23-ea (Sun Microsystems Inc.)

-Bundle-ClassPath: libs/unit-api-0.6.1.jar,

- .

-

+Bundle-ClassPath: .

diff --git a/bundles/org.eclipse.uomo.core/build.properties b/bundles/org.eclipse.uomo.core/build.properties
index 0ba6ea6..5791b54 100644
--- a/bundles/org.eclipse.uomo.core/build.properties
+++ b/bundles/org.eclipse.uomo.core/build.properties
@@ -1,5 +1,4 @@
 source.. = src/main/java/,src/main/resources/

 output.. = target/classes

 bin.includes = META-INF/,\

-               .,\

-               libs/unit-api-0.6.1.jar

+               .

diff --git a/bundles/org.eclipse.uomo.core/libs/README b/bundles/org.eclipse.uomo.core/libs/README
deleted file mode 100644
index 9edcad5..0000000
--- a/bundles/org.eclipse.uomo.core/libs/README
+++ /dev/null
@@ -1,3 +0,0 @@
-This jar file is included here because it cannot be downloaded from a public p2 repository at this time.
-
-If this file is included in Orbit - it can be removed.
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.core/libs/unit-api-0.6.1.jar b/bundles/org.eclipse.uomo.core/libs/unit-api-0.6.1.jar
deleted file mode 100644
index 212a4ef..0000000
--- a/bundles/org.eclipse.uomo.core/libs/unit-api-0.6.1.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.uomo.core/src/main/java/org/eclipse/uomo/core/IListValidator.java b/bundles/org.eclipse.uomo.core/src/main/java/org/eclipse/uomo/core/IListValidator.java
index dcca5bf..f1a255a 100644
--- a/bundles/org.eclipse.uomo.core/src/main/java/org/eclipse/uomo/core/IListValidator.java
+++ b/bundles/org.eclipse.uomo.core/src/main/java/org/eclipse/uomo/core/IListValidator.java
@@ -1,5 +1,5 @@
 /**

- * Copyright (c) 2005, 2013, Werner Keil, Unit-API 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

diff --git a/bundles/org.eclipse.uomo.core/src/main/java/org/eclipse/uomo/core/impl/LogServiceImpl.java b/bundles/org.eclipse.uomo.core/src/main/java/org/eclipse/uomo/core/impl/LogServiceImpl.java
deleted file mode 100644
index 0ea6f7e..0000000
--- a/bundles/org.eclipse.uomo.core/src/main/java/org/eclipse/uomo/core/impl/LogServiceImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**

- * Copyright (c) 2005, 2010, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.core.impl;

-

-import org.osgi.framework.ServiceReference;

-import org.osgi.service.log.LogService;

-

-public class LogServiceImpl implements LogService {

-

-	public void log(int arg0, String arg1) {

-		OutputHelper.print(arg1);

-	}

-

-	public void log(int arg0, String arg1, Throwable arg2) {

-		OutputHelper.print(arg1 + " " + arg2);

-	}

-

-	public void log(ServiceReference arg0, int arg1, String arg2) {

-		OutputHelper.print(arg2);

-	}

-

-	public void log(ServiceReference arg0, int arg1, String arg2, Throwable arg3) {

-		log(arg1, arg2, arg3);

-	}

-

-}

diff --git a/bundles/org.eclipse.uomo.core/src/main/java/org/eclipse/uomo/core/impl/OutputHelper.java b/bundles/org.eclipse.uomo.core/src/main/java/org/eclipse/uomo/core/impl/OutputHelper.java
index d44d195..fbc5990 100644
--- a/bundles/org.eclipse.uomo.core/src/main/java/org/eclipse/uomo/core/impl/OutputHelper.java
+++ b/bundles/org.eclipse.uomo.core/src/main/java/org/eclipse/uomo/core/impl/OutputHelper.java
@@ -13,7 +13,7 @@
 /**

  * A static helper class, checking e.g. if some tests require optional console

  * output XXX this could have options for using a logging framework eventually

- * TODO change to Service (either OSGi LogService or separate service)

+ * TODO change to Service

  * @version 0.98, 2013-12-08

  * @author Werner Keil

  */

diff --git a/bundles/org.eclipse.uomo.core/src/main/resources/META-INF/spring/bundle-context-osgi.xml b/bundles/org.eclipse.uomo.core/src/main/resources/META-INF/spring/bundle-context-osgi.xml
deleted file mode 100644
index 82dc439..0000000
--- a/bundles/org.eclipse.uomo.core/src/main/resources/META-INF/spring/bundle-context-osgi.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<beans xmlns="http://www.springframework.org/schema/beans"

-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

-  xmlns:osgi="http://www.springframework.org/schema/osgi"

-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

-                      http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">

-

-  <!-- definitions using elements of the osgi namespace can be included

-       in this file. There is no requirement to keep these definitions

-       in a separate file if you do not want to. The rationale for 

-       keeping these definitions separate is to facilitate integration

-       testing of the bundle outside of an OSGi container -->

-

-</beans>
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.core/src/main/resources/META-INF/spring/bundle-context.xml b/bundles/org.eclipse.uomo.core/src/main/resources/META-INF/spring/bundle-context.xml
deleted file mode 100644
index 2459eb0..0000000
--- a/bundles/org.eclipse.uomo.core/src/main/resources/META-INF/spring/bundle-context.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-  <!-- regular spring configuration file defining the beans for this
-       bundle. We've kept the osgi definitions in a separate 
-       configuration file so that this file can easily be used
-       for integration testing outside of an OSGi environment -->
-
-  <bean name="myBean" class="org.eclipse.uomo.core.impl.BeanImpl" />
-
-</beans>
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.core/src/main/resources/log4j.properties b/bundles/org.eclipse.uomo.core/src/main/resources/log4j.properties
index 18cfaa3..b05c341 100644
--- a/bundles/org.eclipse.uomo.core/src/main/resources/log4j.properties
+++ b/bundles/org.eclipse.uomo.core/src/main/resources/log4j.properties
@@ -2,7 +2,4 @@
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.threshold=TRACE
-
-#log4j.logger.org.springframework.osgi=DEBUG
-#log4j.logger.org.springframework=DEBUG
\ No newline at end of file
+log4j.appender.stdout.threshold=TRACE
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.icu/META-INF/MANIFEST.MF b/bundles/org.eclipse.uomo.icu/META-INF/MANIFEST.MF
index a5c14f1..7358c7e 100644
--- a/bundles/org.eclipse.uomo.icu/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.uomo.icu/META-INF/MANIFEST.MF
@@ -6,10 +6,10 @@
 Export-Package: org.eclipse.uomo.icu,

  org.eclipse.uomo.icu.impl

 Require-Bundle: com.ibm.icu;visibility:=reexport,

- org.eclipse.uomo.core;bundle-version="0.7.1",

- org.eclipse.uomo.units;bundle-version="0.7.1"

+ org.eclipse.uomo.core;bundle-version="0.8.0",

+ tech.units.indriya;bundle-version="1.3.0"

 Bundle-Vendor: Eclipse.org

 Bundle-RequiredExecutionEnvironment: JavaSE-1.7

 Import-Package: javax.measure,

  javax.measure.quantity,

- tec.uom.lib.common.function

+ tech.uom.lib.common.function

diff --git a/bundles/org.eclipse.uomo.ucum/META-INF/MANIFEST.MF b/bundles/org.eclipse.uomo.ucum/META-INF/MANIFEST.MF
index f635afb..852026a 100644
--- a/bundles/org.eclipse.uomo.ucum/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.uomo.ucum/META-INF/MANIFEST.MF
@@ -10,20 +10,20 @@
  org.eclipse.uomo.ucum.model,

  org.eclipse.uomo.ucum.parsers,

  org.eclipse.uomo.ucum.special

-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)",

+Import-Package: javax.measure,

+ javax.measure.format,

+ javax.measure.quantity,

+ javax.measure.spi,

+ systems.uom.quantity,

  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.1.0",

- org.eclipse.uomo.util;bundle-version="0.2.6",

- org.eclipse.uomo.xml;bundle-version="0.2.0",

+ tech.units.indriya.unit

+Require-Bundle: org.eclipse.uomo.core;bundle-version="0.7.0",

+ org.eclipse.uomo.util;bundle-version="0.7.0",

+ org.eclipse.uomo.xml;bundle-version="0.7.0",

  org.apache.commons.lang;bundle-version="2.3.0"

 Bundle-Vendor: Eclipse.org

 Bundle-RequiredExecutionEnvironment: JavaSE-1.8

diff --git a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/impl/UcumConverter.java b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/impl/UcumConverter.java
index af6f781..32ddd0b 100644
--- a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/impl/UcumConverter.java
+++ b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/impl/UcumConverter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************

- * Crown Copyright (c) 2006, 2011, Copyright (c) 2006, 2017 Kestral Computing P/L and others.

+ * Crown Copyright (c) 2006, 2020, Copyright (c) 2006, 2017 Kestral Computing P/L 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

@@ -17,6 +17,7 @@
 import static org.eclipse.uomo.ucum.model.ConceptKind.*;

 import static org.eclipse.uomo.ucum.expression.Operator.*;

 

+import java.io.Serializable;

 import java.math.BigDecimal;

 import java.math.MathContext;

 import java.util.ArrayList;

@@ -45,7 +46,7 @@
  * @author Grahame Grieve

  * @author Werner Keil

  */

-class UcumConverter extends AbstractConverter {

+class UcumConverter implements UnitConverter, Serializable, Comparable<UnitConverter> {

 

 	/**

 	 * 

@@ -300,10 +301,10 @@
 		return compound.convert(value);

 	}

 

-	public BigDecimal convert(BigDecimal value, MathContext ctx)

-			throws ArithmeticException {

-		return ((AbstractConverter)compound).convert(value, ctx);

-	}

+//	public BigDecimal convert(BigDecimal value, MathContext ctx)

+//			throws ArithmeticException {

+//		return ((AbstractConverter)compound).convert(value, ctx);

+//	}

 

 	public List<UnitConverter> getCompoundConverters() {

 		final List<UnitConverter> compound = new ArrayList<UnitConverter>();

@@ -338,4 +339,16 @@
 		// TODO Auto-generated method stub

 		return 0;

 	}

+

+	@Override

+	public int compareTo(UnitConverter o) {

+		// TODO Auto-generated method stub

+		return 0;

+	}

+

+	@Override

+	public List<? extends UnitConverter> getConversionSteps() {

+		// TODO Auto-generated method stub

+		return null;

+	}

 }

diff --git a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/Value.java b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/Value.java
index b536e9f..1f67fa9 100644
--- a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/Value.java
+++ b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/Value.java
@@ -89,5 +89,59 @@
 	 */

 	public Unit<Q> unit() {

 		return realUnit;

+	}

+

+	@Override

+	public Quantity<Q> add(Quantity<Q> augend) {

+		// TODO Auto-generated method stub

+		return null;

+	}

+

+	@Override

+	public Quantity<Q> subtract(Quantity<Q> subtrahend) {

+		// TODO Auto-generated method stub

+		return null;

+	}

+

+	@Override

+	public Quantity<?> divide(Quantity<?> divisor) {

+		// TODO Auto-generated method stub

+		return null;

+	}

+

+	@Override

+	public Quantity<Q> divide(Number divisor) {

+		// TODO Auto-generated method stub

+		return null;

+	}

+

+	@Override

+	public Quantity<?> multiply(Quantity<?> multiplier) {

+		// TODO Auto-generated method stub

+		return null;

+	}

+

+	@Override

+	public Quantity<Q> multiply(Number multiplier) {

+		// TODO Auto-generated method stub

+		return null;

+	}

+

+	@Override

+	public Quantity<?> inverse() {

+		// TODO Auto-generated method stub

+		return null;

+	}

+

+	@Override

+	public Quantity<Q> to(Unit<Q> unit) {

+		// TODO Auto-generated method stub

+		return null;

+	}

+

+	@Override

+	public <T extends Quantity<T>> Quantity<T> asType(Class<T> type) throws ClassCastException {

+		// TODO Auto-generated method stub

+		return null;

 	}		

 }

diff --git a/bundles/org.eclipse.uomo.units.tests/.classpath b/bundles/org.eclipse.uomo.units.tests/.classpath
deleted file mode 100644
index 4e5d4c5..0000000
--- a/bundles/org.eclipse.uomo.units.tests/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?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/">

-		<attributes>

-			<attribute name="test" value="true"/>

-		</attributes>

-	</classpathentry>

-	<classpathentry kind="output" path="target/classes"/>

-</classpath>

diff --git a/bundles/org.eclipse.uomo.units.tests/.gitignore b/bundles/org.eclipse.uomo.units.tests/.gitignore
deleted file mode 100644
index ea8c4bf..0000000
--- a/bundles/org.eclipse.uomo.units.tests/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/target
diff --git a/bundles/org.eclipse.uomo.units.tests/.project b/bundles/org.eclipse.uomo.units.tests/.project
deleted file mode 100644
index 335f2a5..0000000
--- a/bundles/org.eclipse.uomo.units.tests/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.uomo.units.tests</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.m2e.core.maven2Builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.m2e.core.maven2Nature</nature>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.uomo.units.tests/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.uomo.units.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4824b80..0000000
--- a/bundles/org.eclipse.uomo.units.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1

-encoding/<project>=UTF-8

diff --git a/bundles/org.eclipse.uomo.units.tests/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.uomo.units.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 0c68a61..0000000
--- a/bundles/org.eclipse.uomo.units.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.8
diff --git a/bundles/org.eclipse.uomo.units.tests/.settings/org.eclipse.m2e.core.prefs b/bundles/org.eclipse.uomo.units.tests/.settings/org.eclipse.m2e.core.prefs
deleted file mode 100644
index f897a7f..0000000
--- a/bundles/org.eclipse.uomo.units.tests/.settings/org.eclipse.m2e.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-activeProfiles=
-eclipse.preferences.version=1
-resolveWorkspaceProjects=true
-version=1
diff --git a/bundles/org.eclipse.uomo.units.tests/META-INF/MANIFEST.MF b/bundles/org.eclipse.uomo.units.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index ad65c56..0000000
--- a/bundles/org.eclipse.uomo.units.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: UoMO Units Tests
-Bundle-SymbolicName: org.eclipse.uomo.units.tests
-Bundle-Version: 0.8.0.qualifier
-Bundle-Vendor: Eclipse org
-Fragment-Host: org.eclipse.uomo.units;bundle-version="0.8.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Export-Package: org.eclipse.uomo.units,
- org.eclipse.uomo.units.impl,
- org.eclipse.uomo.units.impl.format,
- org.eclipse.uomo.units.impl.quantity
-Require-Bundle: org.junit;bundle-version="4.8.2"
diff --git a/bundles/org.eclipse.uomo.units.tests/build.properties b/bundles/org.eclipse.uomo.units.tests/build.properties
deleted file mode 100644
index ced5f40..0000000
--- a/bundles/org.eclipse.uomo.units.tests/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.. = src/
-output.. = target/classes
-bin.includes = META-INF/,\
-               .
diff --git a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/QuantityAmountTest.java b/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/QuantityAmountTest.java
deleted file mode 100644
index 6ad4d66..0000000
--- a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/QuantityAmountTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/**

- * Copyright (c) 2005, 2010, Werner Keil, JScience 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Martin Desruisseaux, Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import static org.eclipse.uomo.units.SI.METRE;

-import static org.eclipse.uomo.units.SI.Prefix.CENTI;

-import static org.junit.Assert.assertEquals;

-import static org.junit.Assert.assertFalse;

-import static org.junit.Assert.assertSame;

-import static org.junit.Assert.assertTrue;

-

-import java.math.BigInteger;

-

-import org.eclipse.uomo.units.impl.quantity.LengthAmount;

-import org.junit.Test;

-

-/**

- * Tests {@link QuantityAmount} implementations and subclasses.

- * 

- * @author Martin Desruisseaux

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version $Revision$, $Date$

- */

-public class QuantityAmountTest {

-

-    /**

-     * Tests the creation quantities backed by the {@code double} primitive

-     * type.

-     */

-    @Test

-    public void testDouble() {

-	// final QuantityFactory<Length> factory =

-	// QuantityFactory.getInstance(Length.class);

-	final LengthAmount length = new LengthAmount(Double.valueOf(4.0), METRE);

-

-	assertSame("Wrong tuple element.", METRE, length.unit());

-	assertEquals("Wrong tuple element.", Double.valueOf(4.0), 

-			length.value());

-	assertEquals("Wrong conversion.", 4.0, length.doubleValue(METRE), 0.0);

-	assertEquals("Wrong conversion.", 0.04, length

-		.doubleValue(CENTI(METRE)), 0.0);

-

-	final LengthAmount other = new LengthAmount(8.0, METRE);

-	assertSame("Expected same implementation class.", length.getClass(),

-		other.getClass());

-	assertFalse("Quantities shall not be equal.", length.equals(other));

-	assertFalse("Quantities shall not be equal.",

-		length.hashCode() == other.hashCode());

-

-	final LengthAmount equivalent = new LengthAmount(Double.valueOf(4.0),

-		METRE);

-	assertSame("Expected same implementation class.", length.getClass(),

-		equivalent.getClass());

-	assertFalse("Quantities shall not be equal.", equivalent.equals(other));

-	assertEquals("Quantities shall be equal.", equivalent, length); // .equals(length));

-	assertTrue("'equals' shall be symmetric.", length.equals(equivalent));

-	assertEquals("Expected same hash code.", length.hashCode(), equivalent

-		.hashCode());

-    }

-

-    /**

-     * Tests the creation quantities backed by the {@link Number} class.

-     */

-    @Test

-    public void testNumber() {

-	// final QuantityFactory<Length> factory =

-	// QuantityFactory.getInstance(Length.class);

-	final BigInteger value = BigInteger.valueOf(4);

-	final LengthAmount length = new LengthAmount(value, METRE);

-

-	assertSame("Wrong tuple element.", METRE, length.unit());

-	assertEquals("Wrong tuple element.", BigInteger.valueOf(4), length.value());

-	assertEquals("Wrong conversion.", 4.0, length.doubleValue(METRE), 0.0);

-	assertEquals("Wrong conversion.", 0.04, length

-		.doubleValue(CENTI(METRE)), 0.0);

-

-	// Quantity equivalent to 'length', but backed by a double.

-	// This is not the same class, but should nevertheless by considered

-	// equivalent.

-	final LengthAmount equivalent = new LengthAmount(4, METRE);

-	assertTrue("Quantities shall be equal.", equivalent.equals(length));

-	assertTrue("'equals' shall be symmetric.", length.equals(equivalent));

-	assertEquals("Expected same hash code.", length.hashCode(), equivalent

-		.hashCode());

-    }

-}

diff --git a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/SITest.java b/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/SITest.java
deleted file mode 100644
index f5409b7..0000000
--- a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/SITest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/**

- * Copyright (c) 2005, 2010, Werner Keil, Ikayzo 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Ikayzo and others - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import static org.eclipse.uomo.core.impl.OutputHelper.print;

-import static org.eclipse.uomo.core.impl.OutputHelper.println;

-import static org.eclipse.uomo.units.SI.GRAM;

-import static org.eclipse.uomo.units.SI.KILOGRAM;

-import static org.eclipse.uomo.units.SI.METRE;

-import static org.eclipse.uomo.units.SI.Prefix.MILLI;

-import static org.eclipse.uomo.units.impl.system.USCustomary.LITER;

-import static org.eclipse.uomo.units.impl.system.USCustomary.METER;

-import static org.junit.Assert.assertEquals;

-import static org.junit.Assert.assertTrue;

-

-import org.junit.After;

-import org.junit.Before;

-import org.junit.Test;

-import org.unitsofmeasurement.quantity.Mass;

-import org.unitsofmeasurement.quantity.Volume;

-import org.unitsofmeasurement.unit.SystemOfUnits;

-import javax.measure.Unit;

-

-/**

- * Unit test for class org.eclipse.uomo.units.SI

- * 

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version 1.3 ($Revision: 172 $), $Date: 2010-02-21 20:02:14 +0100 (So, 21

- *          Feb 2010) $

- */

-public class SITest {

-	SystemOfUnits result;

-

-	@Before

-	public void setUp() throws Exception {

-		result = SI.getInstance();

-	}

-

-	@After

-	public void tearDown() throws Exception {

-		result = null;

-	}

-

-	//

-	// public static void main(String[] args) {

-	// new SITest("").testGetInstance();

-	// }

-	/**

-	 * Test of getInstance method, of class SI.

-	 */

-	@Test

-	public void testGetInstance() {

-		// print("getInstance: " + NonSI.GALLON_UK.divide(8) + " (" +

-		// NonSI.GALLON_UK.divide(8).getDimension().toString() + ")");

-

-		// Checks SI contains the 7 SI base units.

-		assertTrue(result.getUnits().contains(AbstractUnit.valueOf("m")));

-		assertTrue(result.getUnits().contains(SI.KILOGRAM)); // TODO check

-																// parsing: "kg"

-		assertTrue(result.getUnits().contains(AbstractUnit.valueOf("s")));

-		assertTrue(result.getUnits().contains(AbstractUnit.valueOf("mol")));

-		assertTrue(result.getUnits().contains(AbstractUnit.valueOf("K")));

-		assertTrue(result.getUnits().contains(AbstractUnit.valueOf("cd")));

-		assertTrue(result.getUnits().contains(AbstractUnit.valueOf("A")));

-

-		print(AbstractUnit.valueOf("m"));

-		println(AbstractUnit.valueOf("m").getDimension().toString());

-	}

-

-	@Test

-	public void testMass() {

-		assertTrue(GRAM.isCompatible(KILOGRAM));

-		Unit<Mass> MILLIGRAM = MILLI(GRAM);

-		println(MILLIGRAM);

-	}

-

-	@Test

-	public void testVolume() {

-		// print("ML: ");

-		Unit<Volume> MILLILITER = MILLI(LITER);

-		println(MILLILITER);

-	}

-

-	@Test

-	public void testSIvsUS() {

-		assertEquals(METRE, METER);

-	}

-}

diff --git a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/UnitTest.java b/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/UnitTest.java
deleted file mode 100644
index 9e9ddc2..0000000
--- a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/UnitTest.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/**

- * Copyright (c) 2005, 2010, Werner Keil, Ikayzo 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Ikayzo and others - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import static org.eclipse.uomo.core.impl.OutputHelper.println;

-import static org.eclipse.uomo.units.SI.*;

-import static org.junit.Assert.assertEquals;

-import static org.junit.Assert.assertNotNull;

-import static org.junit.Assert.assertNotSame;

-import static org.junit.Assert.assertTrue;

-import static org.junit.Assert.fail;

-

-import org.eclipse.uomo.units.AbstractConverter;

-import org.eclipse.uomo.units.AbstractUnit;

-import org.eclipse.uomo.units.impl.BaseAmount;

-import org.junit.After;

-import org.junit.Before;

-import org.junit.Ignore;

-import org.junit.Test;

-import org.unitsofmeasurement.quantity.Dimensionless;

-import org.unitsofmeasurement.quantity.Power;

-import javax.measure.Unit;

-import javax.measure.UnitConverter;

-

-

-/**

- * @author  <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version $Revision: 195 $, $LastChangedDate: 2010-02-24 18:40:34 +0100 (Mi, 24 Feb 2010) $

- */

-public class UnitTest {

-	Unit<Dimensionless> one;

-

-    /* (non-Javadoc)

-     * @see junit.framework.TestCase#setUp()

-     */

-    @Before

-    public void setUp() throws Exception {

-//      super.setUp();

-        one = AbstractUnit.ONE;

-    }

-

-    /* (non-Javadoc)

-     * @see junit.framework.TestCase#tearDown()

-     */

-    @After

-    public void tearDown() throws Exception {

-//      super.tearDown();

-        one = null;

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#toMetric()}.

-     */

-//    @Test

-//    public void testToMetric() {

-//        AbstractUnit<? extends QuantityAmount> su = (AbstractUnit<? extends QuantityAmount>) one.toMetric();

-//        assertTrue(su.isUnscaledMetric());

-//    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#getConverterTo}.

-     */

-    @Test

-    public void testConverterToSI() {

-        Double factor = new Double(10);

-        UnitConverter converter = one.getConverterTo(one);

-        Double result = converter.convert(factor.doubleValue());

-        assertEquals(result, factor);

-        println(result.toString());

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#isMetric()}.

-     */

-//    @Test

-//    public void testIsMetric() {

-//        boolean standard = one.isMetric();

-//        assertTrue(standard);

-//    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#asType(java.lang.Class)}.

-     */

-  @Test

-  @Ignore

-  public void testAsType() {

-      one.asType(Dimensionless.class);

-      try {

-          METRE.asType(Dimensionless.class);

-          fail("Should have raised ClassCastException");

-      } catch (ClassCastException e) {

-          assertTrue(true);

-      }

-  }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#getDimension()}.

-     */

-    @Test

-    public void testGetDimension() {

-        one.getDimension();

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#alternate(java.lang.String)}.

-     */

-    @Test

-    public void testAlternate() {

-        Unit<?> alternate = one.alternate(null);

-        assertNotNull(alternate);

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#compound(org.unitsofmeasure.Unit)}.

-     */

-    /*public void testCompound() {

-        Unit<? extends Quantity> compound = one.compound(one);

-        assertNotNull(compound);

-    }*/

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#transform}.

-     */

-    @Test

-    public void testTransform() {

-        Unit<?> result = one.transform(AbstractConverter.IDENTITY);

-        assertEquals(result, one);

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#add(double)}.

-     */

-    @Test

-    public void testAdd() {

-    	Unit<?> result = one.add(10);

-        assertNotSame(result, one);

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#multiply(long)}.

-     */

-    @Test

-    public void testMultiplyLong() {

-    	Unit<?> result = one.multiply(2L);

-        assertNotSame(result, one);

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#multiply(double)}.

-     */

-    @Test

-    public void testMultiplyDouble() {

-    	Unit<?> result = one.multiply(2.1);

-        assertNotSame(result, one);

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#multiply(org.unitsofmeasure.Unit)}.

-     */

-    @Test

-    public void testMultiplyUnitOfQ() {

-        AbstractUnit<?> result = (AbstractUnit<?>) one.multiply(one);

-        assertEquals(result, one);

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#inverse()}.

-     */

-    @Test

-    public void testInverse() {

-    	Unit<?> result = one.inverse();

-        assertEquals(result, one);

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#divide(long)}.

-     */

-    @Test

-    public void testDivideLong() {

-    	Unit<?> result = one.divide(2L);

-        assertNotSame(result, one);

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#divide(double)}.

-     */

-    @Test

-    public void testDivideDouble() {

-    	Unit<?> result = one.divide(3.2);

-        assertNotSame(result, one);

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#divide(org.unitsofmeasure.Unit)}.

-     */

-    @Test

-    public void testDivideUnitOfQ() {

-    	Unit<?> result = one.divide(one);

-        assertEquals(result, one);

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#root(int)}.

-     */

-    @Test

-    public void testRoot() {

-    	Unit<?> result = one.root(2);

-        assertEquals(result, one);

-    }

-

-    /**

-     * Test method for {@link org.unitsofmeasure.Unit#pow(int)}.

-     */

-    @Test

-    public void testPow() {

-    	Unit<?> result = one.pow(10);

-        assertEquals(result, one);

-    }

-    

-    @Test

-    public void testKiloIsAThousand() {

-    	//FIXME: Need to find the org.hamcrest assertion libs

-    	BaseAmount<Power> w2000 = new BaseAmount<Power>(2000, WATT);

-    	BaseAmount<Power> kW2 = new BaseAmount<Power>(2, Prefix.KILO(WATT));

-    	//assertThat(w2000, is(kW2));

-    }

-}

diff --git a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/impl/Benchmark.java b/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/impl/Benchmark.java
deleted file mode 100644
index a8e1245..0000000
--- a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/impl/Benchmark.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * Copyright (c) 2005, 2011, Werner Keil, Ikayzo 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Werner Keil, Ikayzo and others - initial API and implementation
- */
-package org.eclipse.uomo.units.impl;
-
-import static org.eclipse.uomo.units.SI.GRAM;
-import static org.eclipse.uomo.units.SI.KILOGRAM;
-import static org.eclipse.uomo.units.SI.Prefix.*;
-
-import java.util.Random;
-import java.util.logging.Logger;
-
-import org.eclipse.uomo.units.impl.quantity.MassAmount;
-import javax.measure.Quantity;
-import org.unitsofmeasurement.unit.IncommensurableException;
-import org.unitsofmeasurement.unit.UnconvertibleException;
-import javax.measure.Unit;
-import javax.measure.UnitConverter;
-
-/**
- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>
- * @version $Revision$, $Date$
- * @param <Q> a quantity
- */
-public class Benchmark<Q extends Quantity<Q>> {
-    // Create logger object (usually with the class name)
-	private static Logger benchmarkLogger = Logger.getLogger(Benchmark.class.getName());
-	
-	private static final int N = 100000;
-
-	// Because of generic array creation.
-	private static final Unit<?>[] UNITS = new Unit[] { MEGA(GRAM), KILOGRAM,
-			GRAM, CENTI(GRAM), MILLI(GRAM), MICRO(GRAM) };
-
-	@SuppressWarnings("unchecked")
-	private static long usingQuantities(final long seed) {
-		long time = System.currentTimeMillis();
-		final Random r = new Random(seed);
-		// final QuantityFactory<Mass> factory =
-		// QuantityFactory.getInstance(Mass.class);
-		final MassAmount[] m = new MassAmount[N];
-		for (int i = 0; i < N; i++) {
-			m[i] = new MassAmount(r.nextGaussian(), KILOGRAM);
-		}
-		// Now perform some computation in a random unit.
-		@SuppressWarnings("rawtypes")
-		final Unit targetUnit = (Unit<?>) UNITS[r.nextInt(UNITS.length)];
-		double sum = 0;
-		for (int i = 0; i < N; i++) {
-			sum += m[i].doubleValue(targetUnit);
-		}
-		time = System.currentTimeMillis() - time;
-		benchmarkLogger.info("Using quantities: ellapsed time=" + (time / 1000f)
-				+ " s., result=" + sum);
-		return time;
-	}
-
-	private static long usingDouble(final long seed)
-			throws UnconvertibleException, IncommensurableException {
-		long time = System.currentTimeMillis();
-		final Random r = new Random(seed);
-		final double[] m = new double[N];
-		for (int i = 0; i < N; i++) {
-			m[i] = r.nextGaussian();
-		}
-		// Now perform some computation in a random unit.
-		final Unit<?> sourceUnit = KILOGRAM;
-		final Unit<?> targetUnit = (Unit<?>) UNITS[r.nextInt(UNITS.length)];
-		UnitConverter cv = sourceUnit.getConverterToAny((Unit<?>) targetUnit);
-		double sum = 0;
-		for (int i = 0; i < N; i++) {
-			sum += cv.convert(m[i]);
-		}
-		time = System.currentTimeMillis() - time;
-		benchmarkLogger.info("Using primitives: ellapsed time=" + (time / 1000f)
-				+ " s., result=" + sum);
-		return time;
-	}
-
-	public static void main(String[] args) throws InterruptedException {
-		// TODO add IE and UE to main
-		// Execute the loop many time for letting Hotspot to "warn up".
-		try {
-			final Random r = new Random();
-			for (int i = 0; i < 20; i++) {
-				final long seed = r.nextLong();
-				long t1 = usingQuantities(seed);
-				long t2 = usingDouble(seed);
-				benchmarkLogger.fine("Ratio: " + (float) t1 / (float) t2);
-				Thread.sleep(100);
-			}
-		} catch (IncommensurableException ie) {
-			throw new InterruptedException();
-		} catch (UnconvertibleException ue) {
-			throw new InterruptedException();
-		}
-	}
-}
diff --git a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/impl/format/UnitFormatTest.java b/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/impl/format/UnitFormatTest.java
deleted file mode 100644
index da2f73c..0000000
--- a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/impl/format/UnitFormatTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**

- * Copyright (c) 2005, 2010, Werner Keil, Ikayzo 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Ikayzo and others - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.format;

-

-import static org.eclipse.uomo.core.impl.OutputHelper.*;

-import static org.eclipse.uomo.units.SI.METRE;

-import static org.eclipse.uomo.units.SI.Prefix.CENTI;

-import static org.eclipse.uomo.units.SI.Prefix.KILO;

-import static org.eclipse.uomo.units.SI.Prefix.MILLI;

-import static org.eclipse.uomo.units.impl.system.USCustomary.ELECTRON_VOLT;

-import static org.eclipse.uomo.units.impl.system.USCustomary.FOOT;

-import static org.junit.Assert.assertEquals;

-

-import java.math.BigInteger;

-import java.util.Locale;

-

-import org.eclipse.uomo.units.AbstractUnit;

-import org.junit.After;

-import org.junit.Before;

-import org.junit.Test;

-import org.unitsofmeasurement.quantity.Length;

-import javax.measure.Unit;

-

-/**

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version $Revision: 206 $, $Date: 2010-02-25 02:40:17 +0100 (Do, 25 Feb 2010)

- *          $

- */

-public class UnitFormatTest {

-	private static final String COMPARISON_FOOT = "ft";

-	private static final String COMPARISON_KM = "km";

-	private static final Locale COMPARISON_LOCALE = Locale.UK;

-	private static final Locale MULTI_LOCALE = Locale.ENGLISH;

-

-	LocalUnitFormat format;

-	Unit<Length> cm;

-	Unit<Length> mm;

-	Unit<Length> foot;

-

-	@Before

-	public void setUp() throws Exception {

-		// setName(UCUMFormatTest.class.getSimpleName());

-		cm = CENTI(METRE);

-		mm = MILLI(METRE);

-		foot = FOOT;

-	}

-

-	@After

-	public void tearDown() throws Exception {

-		// super.tearDown();

-	}

-

-	@Test

-	public void testDefault() {

-		format = LocalUnitFormat.getInstance();

-		// format.format(unit, appendable);

-		String formattedText = format.format(cm);

-		println(formattedText);

-		// System.out.println(unit2);

-		formattedText = format.format(mm);

-		println(formattedText);

-		formattedText = format.format(foot);

-		print(formattedText);

-	}

-

-	@Test

-	public void testGetInstanceLocale() {

-		format = LocalUnitFormat.getInstance(COMPARISON_LOCALE);

-		String formattedText = format.format(cm);

-		print(formattedText);

-		// System.out.println(unit2);

-		formattedText = format.format(mm);

-		print(formattedText);

-		formattedText = format.format(foot);

-		print(formattedText);

-		assertEquals(COMPARISON_FOOT, formattedText);

-	}

-

-	@Test

-	public void testUSVolt() {

-		print(ELECTRON_VOLT.getDimension().toString());

-		println(ELECTRON_VOLT.toString());

-	}

-

-	@Test

-	public void testSubMultiples() {

-		Unit<Length> u = CENTI(METRE);

-		println(u.toString());

-	}

-

-	/**

-	 * Tests the {@link AbstractUnit#toString()} method, which is backed by

-	 * {@link BaseFormat}.

-	 * 

-	 * @see http://kenai.com/jira/browse/JSR_275-43

-	 */

-	@Test

-	public void testMultiples() {

-		format = LocalUnitFormat.getInstance(MULTI_LOCALE);

-		assertEquals("m", format.format(METRE));

-		// Multiples

-		assertEquals(COMPARISON_KM, format.format(KILO(METRE)));

-		assertEquals(COMPARISON_KM, format.format(METRE.multiply(1000)));

-		assertEquals(COMPARISON_KM, format.format(METRE.multiply(1000d)));

-		assertEquals("Tm", METRE.multiply(BigInteger.TEN.pow(12).longValue())

-				.toString());

-		// Submultiples

-		assertEquals("cm", format.format(METRE.divide(100d)));

-		assertEquals("mm", format.format(METRE.divide(1000d)));

-		assertEquals("fm", format.format(METRE.divide(BigInteger.TEN.pow(15).

-				longValue())));

-	}

-}

diff --git a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/impl/quantity/QuantityTest.java b/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/impl/quantity/QuantityTest.java
deleted file mode 100644
index a9d50aa..0000000
--- a/bundles/org.eclipse.uomo.units.tests/src/org/eclipse/uomo/units/impl/quantity/QuantityTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * Copyright (c) 2005, 2010, Werner Keil, Ikayzo 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Werner Keil, Ikayzo and others - initial API and implementation
- */
-package org.eclipse.uomo.units.impl.quantity;
-
-import static org.eclipse.uomo.core.impl.OutputHelper.*;
-import static org.eclipse.uomo.units.SI.AMPERE_TURN;
-import static org.eclipse.uomo.units.SI.KILOGRAM;
-import static org.eclipse.uomo.units.SI.METRE;
-import static org.eclipse.uomo.units.SI.METRES_PER_SQUARE_SECOND;
-import static org.eclipse.uomo.units.SI.Prefix.KILO;
-import static org.junit.Assert.assertEquals;
-
-import org.eclipse.uomo.units.impl.quantity.AccelerationAmount;
-import org.eclipse.uomo.units.impl.quantity.LengthAmount;
-import org.eclipse.uomo.units.impl.quantity.MagnetomotiveForceAmount;
-import org.eclipse.uomo.units.impl.quantity.MassAmount;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>
- * @version $Revision$, $Date$
- */
-public class QuantityTest {
-	LengthAmount length;
-	AccelerationAmount accel;
-	MagnetomotiveForceAmount magneto;
-	
-    // universal gravitational constant  (m3 kg-1 s-2)
-    private static final double G = 6.67300E-11;
-	
-	private MassAmount mass;   // in kilograms
-	private LengthAmount radius; // in meters
-
-	
-	@Before
-	public void setUp() throws Exception {
-		length  = new LengthAmount(4.0, METRE);
-		accel   = new AccelerationAmount(30, METRES_PER_SQUARE_SECOND);
-		magneto = new MagnetomotiveForceAmount(50, AMPERE_TURN);
-		
-		mass 	= new MassAmount(30, KILOGRAM);
-		radius  = new LengthAmount(400, KILO(METRE));
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		length = null;
-	}
-
-	@Test
-	public void testLength() {
-		LengthAmount len2 = new LengthAmount(4.0, METRE);
-		assertEquals(length, len2);
-	}
-	
-	private AccelerationAmount surfaceGravity() {
-        double m = mass.doubleValue(KILOGRAM);
-        double r = radius.doubleValue(METRE);
-        return new AccelerationAmount(
-                G * m / (r * r), METRES_PER_SQUARE_SECOND);
-    }
-	
-	@Test
-	public void testAccelo1() {
-		AccelerationAmount ac1 = surfaceGravity();
-		print("Gravity: ");
-		println(ac1);
-	}
-}
diff --git a/bundles/org.eclipse.uomo.units/.classpath b/bundles/org.eclipse.uomo.units/.classpath
deleted file mode 100644
index 07a34e9..0000000
--- a/bundles/org.eclipse.uomo.units/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?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">

-		<attributes>

-			<attribute name="owner.project.facets" value="java"/>

-		</attributes>

-	</classpathentry>

-	<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="output" path="target/classes"/>

-</classpath>

diff --git a/bundles/org.eclipse.uomo.units/.gitignore b/bundles/org.eclipse.uomo.units/.gitignore
deleted file mode 100644
index 2c36b17..0000000
--- a/bundles/org.eclipse.uomo.units/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/target
-/.settings
diff --git a/bundles/org.eclipse.uomo.units/.project b/bundles/org.eclipse.uomo.units/.project
deleted file mode 100644
index 174d877..0000000
--- a/bundles/org.eclipse.uomo.units/.project
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.uomo.units</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.jboss.tools.jst.web.kb.kbbuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.jboss.tools.cdi.core.cdibuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.m2e.core.maven2Builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.m2e.core.maven2Nature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.eclipse.pde.PluginNature</nature>
-	</natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.uomo.units/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.uomo.units/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index cf6931b..0000000
--- a/bundles/org.eclipse.uomo.units/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-eclipse.preferences.version=1

-encoding//src/main/java=UTF-8

-encoding//src/main/resources=UTF-8

-encoding/<project>=UTF-8

diff --git a/bundles/org.eclipse.uomo.units/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.uomo.units/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 295926d..0000000
--- a/bundles/org.eclipse.uomo.units/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-eclipse.preferences.version=1

-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled

-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8

-org.eclipse.jdt.core.compiler.compliance=1.8

-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error

-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error

-org.eclipse.jdt.core.compiler.source=1.8

diff --git a/bundles/org.eclipse.uomo.units/.springBeans b/bundles/org.eclipse.uomo.units/.springBeans
deleted file mode 100644
index ef666ef..0000000
--- a/bundles/org.eclipse.uomo.units/.springBeans
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<beansProjectDescription>

-	<version>1</version>

-	<pluginVersion><![CDATA[2.5.0.201010221000-RELEASE]]></pluginVersion>

-	<configSuffixes>

-		<configSuffix><![CDATA[xml]]></configSuffix>

-	</configSuffixes>

-	<enableImports><![CDATA[false]]></enableImports>

-	<configs>

-	</configs>

-	<configSets>

-	</configSets>

-</beansProjectDescription>

diff --git a/bundles/org.eclipse.uomo.units/META-INF/MANIFEST.MF b/bundles/org.eclipse.uomo.units/META-INF/MANIFEST.MF
deleted file mode 100644
index df34c4a..0000000
--- a/bundles/org.eclipse.uomo.units/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,29 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: UOMo Units of Measurement
-Bundle-SymbolicName: org.eclipse.uomo.units;singleton:=true
-Bundle-Version: 0.8.0.qualifier
-Bundle-Activator: org.eclipse.uomo.units.Activator
-Bundle-Vendor: Eclipse.org
-Require-Bundle: org.eclipse.uomo.core;bundle-version="0.1.0"
-Import-Package: javax.measure,
- javax.measure.format,
- javax.measure.quantity,
- javax.measure.spi,
- org.osgi.framework;version="1.3.0",
- org.osgi.util.tracker;version="1.3.1",
- systems.uom.quantity,
- tec.uom.lib.common.function
-Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.uomo.units,
- org.eclipse.uomo.units.impl;uses:="javax.measure,org.eclipse.uomo.units",
- org.eclipse.uomo.units.impl.converter;uses:="javax.measure,org.eclipse.uomo.units",
- org.eclipse.uomo.units.impl.format,
- org.eclipse.uomo.units.impl.quantity;
-  uses:="org.eclipse.uomo.units.impl,
-   javax.measure.quantity,
-   javax.measure,
-   org.eclipse.uomo.units",
- org.eclipse.uomo.units.impl.system;uses:="javax.measure,org.eclipse.uomo.units,javax.measure.service"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Bundle-ClassPath: .
diff --git a/bundles/org.eclipse.uomo.units/build.properties b/bundles/org.eclipse.uomo.units/build.properties
deleted file mode 100644
index d2a44c1..0000000
--- a/bundles/org.eclipse.uomo.units/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-source.. = src/main/java/,\

-           src/main/resources/

-bin.includes = META-INF/,\

-               .,\

-               plugin.xml

-additional.bundles = javax.measure.unit-api

diff --git a/bundles/org.eclipse.uomo.units/libs/README b/bundles/org.eclipse.uomo.units/libs/README
deleted file mode 100644
index 9edcad5..0000000
--- a/bundles/org.eclipse.uomo.units/libs/README
+++ /dev/null
@@ -1,3 +0,0 @@
-This jar file is included here because it cannot be downloaded from a public p2 repository at this time.
-
-If this file is included in Orbit - it can be removed.
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/libs/unit-api-0.6.1.jar b/bundles/org.eclipse.uomo.units/libs/unit-api-0.6.1.jar
deleted file mode 100644
index af84a8a..0000000
--- a/bundles/org.eclipse.uomo.units/libs/unit-api-0.6.1.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.uomo.units/plugin.xml b/bundles/org.eclipse.uomo.units/plugin.xml
deleted file mode 100644
index b60f62a..0000000
--- a/bundles/org.eclipse.uomo.units/plugin.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<?eclipse version="3.4"?>

-<plugin>

-

-</plugin>

diff --git a/bundles/org.eclipse.uomo.units/src/etc/header.txt b/bundles/org.eclipse.uomo.units/src/etc/header.txt
deleted file mode 100644
index 8471428..0000000
--- a/bundles/org.eclipse.uomo.units/src/etc/header.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Copyright (c) 2005, 2010, Werner Keil, Ikayzo 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

-http://www.eclipse.org/legal/epl-v10.html

-

-Contributors:

-    Werner Keil - initial API and implementation
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/.gitignore b/bundles/org.eclipse.uomo.units/src/main/java/.gitignore
deleted file mode 100644
index 1a70481..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/META-INF
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractConverter.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractConverter.java
deleted file mode 100644
index df61330..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractConverter.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/**
- * Copyright (c) 2005, 2017, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Werner Keil and others - initial API and implementation
- */
-package org.eclipse.uomo.units;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.math.MathContext;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.measure.UnitConverter;
-
-/**
- * <p> This class represents a converter of numeric values.</p>
- *
- * <p> It is not required for sub-classes to be immutable
- *     (e.g. currency converter).</p>
- *
- * <p> Sub-classes must ensure unicity of the {@linkplain #IDENTITY identity}
- *     converter. In other words, if the result of an operation is equivalent
- *     to the identity converter, then the unique {@link #IDENTITY} instance
- *     should be returned.</p>
- *
- * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
- * @author  <a href="mailto:uomo@catmedia.us">Werner Keil</a>
- * @version 1.5, $Date: 2017-12-24 $
- */
-public abstract class AbstractConverter implements UnitConverter, Serializable {
-
-    /**
-     * For cross-version compatibility.
-     */
-    private static final long serialVersionUID = 2557410026012911803L;
-
-    /**
-     * Holds the identity converter (unique). This converter does nothing
-     * (<code>ONE.convert(x) == x</code>). This instance is unique.
-     */
-    public static final UnitConverter IDENTITY = new Identity();
-
-    /**
-     * Default constructor.
-     */
-    protected AbstractConverter() {
-    }
-
-    /**
-     * Returns the inverse of this converter. If <code>x</code> is a valid
-     * value, then <code>x == inverse().convert(convert(x))</code> to within
-     * the accuracy of computer arithmetic.
-     *
-     * @return the inverse of this converter.
-     */
-    public abstract UnitConverter inverse();
-    
-    public abstract BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException;
-
-    /**
-     * Indicates whether this converter is considered to be the the same as the
-     * one specified.
-     *
-     * @param  cvtr the converter with which to compare.
-     * @return <code>true</code> if the specified object is a converter
-     *         considered equals to this converter;<code>false</code> otherwise.
-     */
-//    @Override
-//    public abstract boolean equals(Object cvtr);
-
-    /**
-     * Returns a hash code value for this converter. Equals object have equal
-     * hash codes.
-     *
-     * @return this converter hash code value.
-     * @see    #equals
-     */
-    //@Override
-    //public abstract int hashCode();
-
-    /**
-     * Concatenates this converter with another converter. The resulting
-     * converter is equivalent to first converting by the specified converter
-     * (right converter), and then converting by this converter (left converter).
-     *
-     * <p>Note: Implementations must ensure that the {@link #IDENTITY} instance
-     *          is returned if the resulting converter is an identity
-     *          converter.</p>
-     *
-     * @param  converter the other converter.
-     * @return the concatenation of this converter with the other converter.
-     */
-    public UnitConverter concatenate(UnitConverter converter) {
-        return (converter == IDENTITY) ? this : new CompoundImpl(this, converter);
-    }
-	
-    @Override
-	public boolean isIdentity() {
-		return false;
-	}
-
-	@Override
-	public List<UnitConverter> getConversionSteps() {
-		return Arrays.asList((UnitConverter)new CompoundImpl(this, this));
-	}
-	
-    /**
-     * This interface is implemented by converters made up of two
-     * separate converters (in matrix notation
-     * <code>[compound] = [left] x [right]</code>).
-     */
-    public interface Compound {
-
-        /**
-         * Returns the left converter of this compound converter
-         * (the last one performing the conversion).
-         *
-         * @return the left converter.
-         */
-        AbstractConverter getLeft();
-
-        /**
-         * Returns the right converter of this compound converter
-         * (the first one performing the conversion).
-         *
-         * @return the right converter.
-         */
-        AbstractConverter getRight();
-    }
-
-    /**
-     * This inner class represents the identity converter (singleton).
-     */
-    private static final class Identity extends AbstractConverter {
-
-        /**
-         * For cross-version compatibility.
-         */
-        private static final long serialVersionUID = 7675901502919547460L;
-
-        @Override
-        public Identity inverse() {
-            return this;
-        }
-
-        @Override
-        public double convert(double value) {
-            return value;
-        }
-
-        public BigDecimal convert(BigDecimal value, MathContext ctx) {
-            return value;
-        }
-
-		public Number convert(Number value) {
-			return value;
-		}
-		
-        @Override
-        public boolean equals(Object cvtr) {
-            return this == cvtr; // Unique instance.
-        }
-
-        @Override
-        public int hashCode() {
-            return 0;
-        }
-
-        @Override
-        public boolean isLinear() {
-            return true;
-        }
-
-		@Override
-		public boolean isIdentity() {
-			return true;
-		}
-    }
-
-    /**
-     * This inner class represents a compound converter (non-linear).
-     */
-    private static final class CompoundImpl extends AbstractConverter implements Compound {
-
-        /**
-         * For cross-version compatibility.
-         */
-        private static final long serialVersionUID = 2242882007946934958L;
-
-        /**
-         * Holds the first converter.
-         */
-        private final AbstractConverter left;
-
-        /**
-         * Holds the second converter.
-         */
-        private final AbstractConverter right;
-
-        /**
-         * Creates a compound converter resulting from the combined
-         * transformation of the specified converters.
-         *
-         * @param  unitConverter the left converter.
-         * @param  unitConverter2 the right converter.
-         */
-        private CompoundImpl(UnitConverter unitConverter, UnitConverter unitConverter2) {
-            this.left = (AbstractConverter) unitConverter;
-            this.right = (AbstractConverter) unitConverter2;
-        }
-
-        @Override
-        public UnitConverter inverse() {
-            return new CompoundImpl(right.inverse(), left.inverse());
-        }
-
-        @Override
-        public double convert(double value) {
-            return left.convert(right.convert(value));
-        }
-
-        public BigDecimal convert(BigDecimal value, MathContext ctx) {
-            return ((CompoundImpl)left).convert(((CompoundImpl)right).convert(value, ctx), ctx);
-        }
-
-
-		public Number convert(Number value) {
-			return left.convert(right.convert(value));
-		}
-        
-        @Override
-        public boolean equals(Object cvtr) {
-            if (this == cvtr)
-                return true;
-            if (!(cvtr instanceof Compound))
-                return false;
-            Compound that = (Compound) cvtr;
-            return (this.left.equals(that.getLeft()))
-                    && (this.right.equals(that.getRight()));
-        }
-
-        @Override
-        public int hashCode() {
-            return left.hashCode() + right.hashCode();
-        }
-
-        @Override
-        public boolean isLinear() {
-            return left.isLinear() && right.isLinear();
-        }
-
-        public AbstractConverter getLeft() {
-            return left;
-        }
-
-        public AbstractConverter getRight() {
-            return right;
-        }
-
-		@Override
-		public UnitConverter concatenate(UnitConverter converter) {
-			return (converter == IDENTITY) ? this : new CompoundImpl(this, converter);
-		}
-
-		@Override
-		public List<UnitConverter> getConversionSteps() {
-			return Arrays.asList((UnitConverter)new CompoundImpl(this, this));
-		}
-    }
-}
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
deleted file mode 100644
index 87c2ff8..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractQuantity.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil 

- *    - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import java.util.Comparator;

-import java.util.Objects;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-import javax.measure.quantity.Dimensionless;

-

-import org.eclipse.uomo.units.impl.NaturalOrder;

-import org.eclipse.uomo.units.impl.NumberQuantity;

-import org.eclipse.uomo.units.impl.format.QuantityFormat;

-

-import tec.uom.lib.common.function.UnitSupplier;

-import tec.uom.lib.common.function.ValueSupplier;

-

-/**

- * <p>

- * This class represents the immutable result of a scalar measurement stated in a known unit.

- * </p>

- * 

- * <p>

- * <code>

- *         public static final Quantity&lt;Speed&gt; C = NumberQuantity.parse("299792458 m/s").asType(Speed.class);

- *         // Speed of Light (exact).

- *    </code>

- * </p>

- * 

- * <p>

- * Quantities can be converted to different units.<br>

- * <code>

- *         Quantity&lt;Speed&gt; milesPerHour = C.to(MILES_PER_HOUR); // Use double implementation (fast).

- *         System.out.println(milesPerHour);

- * 

- *         &gt; 670616629.3843951 m/h

- *     </code>

- * </p>

- * 

- * <p>

- * Applications may sub-class {@link AbstractQuantity} for particular quantity types.<br>

- * <code>

- *         // Quantity of type Mass based on double primitive types.<br>

- * public class MassAmount extends AbstractQuantity&lt;Mass&gt; {<br>

- * private final double kilograms; // Internal SI representation.<br>

- * private Mass(double kg) { kilograms = kg; }<br>

- * public static Mass of(double value, Unit&lt;Mass&gt; unit) {<br>

- * return new Mass(unit.getConverterTo(SI.KILOGRAM).convert(value));<br>

- * }<br>

- * public Unit&lt;Mass&gt; getUnit() { return SI.KILOGRAM; }<br>

- * public Double getValue() { return kilograms; }<br>

- * ...<br>

- * }<br>

- * <p>

- * // Complex numbers measurements.<br>

- * public class ComplexQuantity

- * &lt;Q extends Quantity&gt;extends AbstractQuantity

- * &lt;Q&gt;{<br>

- * public Complex getValue() { ... } // Assuming Complex is a Number.<br>

- * ...<br>

- * }<br>

- * <br>

- * // Specializations of complex numbers measurements.<br>

- * public final class Current extends ComplexQuantity&lt;ElectricCurrent&gt; {...}<br>

- * public final class Tension extends ComplexQuantity&lt;ElectricPotential&gt; {...} <br>

- * </code>

- * </p>

- * 

- * <p>

- * All instances of this class shall be immutable.

- * </p>

- * 

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @version 1.4, December 21, 2017

- * @since 0.6

- */

-public abstract class AbstractQuantity<Q extends Quantity<Q>> implements Quantity<Q>, Comparable<Quantity<Q>>, UnitSupplier<Q>, ValueSupplier<Number> {

-

-  /**

-     * 

-     */

-  // private static final long serialVersionUID = -4993173119977931016L;

-

-  private final Unit<Q> unit;

-

-  /**

-   * Holds a dimensionless quantity of none (exact).

-   */

-  public static final Quantity<Dimensionless> NONE = NumberQuantity.of(0, AbstractUnit.ONE);

-

-  /**

-   * Holds a dimensionless quantity of one (exact).

-   */

-  public static final Quantity<Dimensionless> ONE = NumberQuantity.of(1, AbstractUnit.ONE);

-

-  /**

-   * constructor.

-   */

-  protected AbstractQuantity(Unit<Q> unit) {

-    this.unit = unit;

-  }

-

-  /**

-   * Returns the measurement numeric value.

-   *

-   * @return the measurement value.

-   */

-  public abstract Number getValue();

-

-  /**

-   * Returns the measurement unit.

-   *

-   * @return the measurement unit.

-   */

-  public Unit<Q> getUnit() {

-    return unit;

-  }

-

-  /**

-   * Convenient method equivalent to {@link #to(javax.measure.unit.Unit) to(this.getUnit().toSI())}.

-   *

-   * @return this measure or a new measure equivalent to this measure but stated in SI units.

-   * @throws ArithmeticException

-   *           if the result is inexact and the quotient has a non-terminating decimal expansion.

-   */

-  public Quantity<Q> toSI() {

-    return to(this.getUnit().getSystemUnit());

-  }

-

-  /**

-   * Returns this measure after conversion to specified unit. The default implementation returns <code>Measure.valueOf(doubleValue(unit), unit)</code>

-   * . If this measure is already stated in the specified unit, then this measure is returned and no conversion is performed.

-   *

-   * @param unit

-   *          the unit in which the returned measure is stated.

-   * @return this measure or a new measure equivalent to this measure but stated in the specified unit.

-   * @throws ArithmeticException

-   *           if the result is inexact and the quotient has a non-terminating decimal expansion.

-   */

-  public Quantity<Q> to(Unit<Q> unit) {

-    if (unit.equals(this.getUnit())) {

-      return this;

-    }

-    return NumberQuantity.of(doubleValue(unit), unit);

-  }

-

-  /**

-   * Compares this measure to the specified Measurement quantity. The default implementation compares the {@link AbstractQuantity#doubleValue(Unit)}

-   * of both this measure and the specified Measurement stated in the same unit (this measure's {@link #getUnit() unit}).

-   *

-   * @return a negative integer, zero, or a positive integer as this measure is less than, equal to, or greater than the specified Measurement

-   *         quantity.

-   * @see {@link NaturalOrder}

-   */

-  public int compareTo(Quantity<Q> that) {

-    final Comparator<Quantity<Q>> comparator = new NaturalOrder<Q>();

-    return comparator.compare(this, that);

-  }

-

-  /**

-   * Compares this measure against the specified object for <b>strict</b> equality (same unit and same amount).

-   *

-   * <p>

-   * Similarly to the {@link BigDecimal#equals} method which consider 2.0 and 2.00 as different objects because of different internal scales,

-   * measurements such as <code>Measure.valueOf(3.0, KILOGRAM)</code> <code>Measure.valueOf(3, KILOGRAM)</code> and

-   * <code>Quantities.getQuantity("3 kg")</code> might not be considered equals because of possible differences in their implementations.

-   * </p>

-   *

-   * <p>

-   * To compare measures stated using different units or using different amount implementations the {@link #compareTo compareTo} or

-   * {@link #equals(javax.measure.Measurement, double, javax.measure.unit.Unit) equals(Measurement, epsilon, epsilonUnit)} methods should be used.

-   * </p>

-   *

-   * @param obj

-   *          the object to compare with.

-   * @return <code>this.getUnit.equals(obj.getUnit())

-   *         &amp;&amp; this.getValue().equals(obj.getValue())</code>

-   */

-  @Override

-  public boolean equals(Object obj) {

-    if (!(obj instanceof AbstractQuantity<?>)) {

-      return false;

-    }

-    AbstractQuantity<?> that = (AbstractQuantity<?>) obj;

-    return this.getUnit().equals(that.getUnit()) && this.getValue().equals(that.getValue());

-  }

-

-  /**

-   * Compares this measure and the specified Measurement to the given accuracy. Measurements are considered approximately equals if their absolute

-   * differences when stated in the same specified unit is less than the specified epsilon.

-   *

-   * @param that

-   *          the Measurement to compare with.

-   * @param epsilon

-   *          the absolute error stated in epsilonUnit.

-   * @param epsilonUnit

-   *          the epsilon unit.

-   * @return <code>abs(this.doubleValue(epsilonUnit) - that.doubleValue(epsilonUnit)) &lt;= epsilon</code>

-   */

-  public boolean equals(AbstractQuantity<Q> that, double epsilon, Unit<Q> epsilonUnit) {

-    return Math.abs(this.doubleValue(epsilonUnit) - that.doubleValue(epsilonUnit)) <= epsilon;

-  }

-

-  /**

-   * Returns the hash code for this quantity.

-   *

-   * @return the hash code value.

-   */

-  @Override

-  public int hashCode() {

-    return getUnit().hashCode() + getValue().hashCode();

-  }

-

-  protected abstract boolean isBig();

-

-  /**

-   * Returns the <code>String</code> representation of this quantity. The string produced for a given quantity is always the same; it is not affected

-   * by locale. This means that it can be used as a canonical string representation for exchanging quantity, or as a key for a Hashtable, etc.

-   * Locale-sensitive quantity formatting and parsing is handled by the {@link QuantityFormat} class and its subclasses.

-   *

-   * @return <code>UnitFormat.getInternational().format(this)</code>

-   */

-  @Override

-  public String toString() {

-    // return MeasureFormat.getStandard().format(this); TODO improve

-    // MeasureFormat

-    // return String.valueOf(getValue()) + " " + String.valueOf(getUnit());

-    return QuantityFormat.getInstance().format(this);

-  }

-

-  public abstract double doubleValue(Unit<Q> unit) throws ArithmeticException;

-

-  protected long longValue(Unit<Q> unit) throws ArithmeticException {

-    double result = doubleValue(unit);

-    if ((result < Long.MIN_VALUE) || (result > Long.MAX_VALUE)) {

-      throw new ArithmeticException("Overflow (" + result + ")");

-    }

-    return (long) result;

-  }

-

-  protected float floatValue(Unit<Q> unit) {

-    return (float) doubleValue(unit);

-  }

-

-  /**

-   * Casts this quantity to a parameterized unit of specified nature or throw a <code>ClassCastException</code> if the dimension of the specified

-   * quantity and this measure unit's dimension do not match. For example: <br>

-   * <code>

-   *     Measure&lt;Length&gt; length = Quantities.getQuantity("2 km").asType(Length.class);

-   * </code>

-   *

-   * @param type

-   *          the quantity class identifying the nature of the quantity.

-   * @return this quantity parameterized with the specified type.

-   * @throws ClassCastException

-   *           if the dimension of this unit is different from the specified quantity dimension.

-   * @throws UnsupportedOperationException

-   *           if the specified quantity class does not have a public static field named "UNIT" holding the SI unit for the quantity.

-   * @see Unit#asType(Class)

-   */

-  @SuppressWarnings("unchecked")

-  public final <T extends Quantity<T>> Quantity<T> asType(Class<T> type) throws ClassCastException {

-    this.getUnit().asType(type); // Raises ClassCastException is dimension

-    // mismatches.

-    return (Quantity<T>) this;

-  }

-

-  /**

-   * Returns the quantity of unknown type corresponding to the specified representation. This method can be used to parse dimensionless quantities.<br/>

-   * <code>

-   *     Quantity<Dimensionless> proportion = AbstractQuantity.parse("0.234").asType(Dimensionless.class);

-   * </code>

-   *

-   * <p>

-   * Note: This method handles only {@link org.eclipse.uomo.units.SimpleUnitFormat.UnitFormat#getStandard standard} unit format.

-   * </p>

-   *

-   * @param csq

-   *          the decimal value and its unit (if any) separated by space(s).

-   * @return <code>QuantityFormat.getInstance().parse(csq)</code>

-   */

-  public static Quantity<?> parse(CharSequence csq) {

-    return QuantityFormat.getInstance().parse(csq);

-  }

-

-  /**

-   * Utility class for number comparison and equality

-   */

-  protected static final class Equalizer {

-

-    /**

-     * Converts a number to {@link Double}

-     *

-     * @param value

-     *          the value to be converted

-     * @return the value converted

-     */

-    public static Double toDouble(Number value) {

-      if (Double.class.isInstance(value)) {

-        return Double.class.cast(value);

-      }

-      return value.doubleValue();

-    }

-

-    /**

-     * Check if the both value has equality number, in other words, 1 is equals to 1.0000 and 1.0.

-     * 

-     * If the first value is a <type>Number</type> of either <type>Double</type>, <type>Float</type>, <type>Integer</type>, <type>Long</type>,

-     * <type>Short</type> or <type>Byte</type> it is compared using the respective <code>*value()</code> method of <type>Number</type>. Otherwise it

-     * is checked, if {@link Double#compareTo(Object)} is equal to zero.

-     *

-     * @param valueA

-     *          the value a

-     * @param valueB

-     *          the value B

-     * @return {@link Double#compareTo(Object)} == zero

-     */

-    public static boolean hasEquality(Number valueA, Number valueB) {

-      Objects.requireNonNull(valueA);

-      Objects.requireNonNull(valueB);

-

-      if (valueA instanceof Double && valueB instanceof Double) {

-        return valueA.doubleValue() == valueB.doubleValue();

-      } else if (valueA instanceof Float && valueB instanceof Float) {

-        return valueA.floatValue() == valueB.floatValue();

-      } else if (valueA instanceof Integer && valueB instanceof Integer) {

-        return valueA.intValue() == valueB.intValue();

-      } else if (valueA instanceof Long && valueB instanceof Long) {

-        return valueA.longValue() == valueB.longValue();

-      } else if (valueA instanceof Short && valueB instanceof Short) {

-        return valueA.shortValue() == valueB.shortValue();

-      } else if (valueA instanceof Byte && valueB instanceof Byte) {

-        return valueA.byteValue() == valueB.byteValue();

-      }

-      return toDouble(valueA).compareTo(toDouble(valueB)) == 0;

-    }

-  }

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractSystemOfUnits.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractSystemOfUnits.java
deleted file mode 100644
index aad4892..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractSystemOfUnits.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**

- * Copyright (c) 2005, 2011, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import java.util.Collections;

-import java.util.HashSet;

-import java.util.Set;

-

-import org.eclipse.uomo.core.IName;

-import javax.measure.Quantity;

-import javax.measure.Dimension;

-import javax.measure.spi.ServiceProvider;

-import javax.measure.spi.SystemOfUnits;

-import javax.measure.Unit;

-

-/**

- * <p> An abstract base class for unit systems.</p>

- *

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version 1.2, $Date: 2011-09-11 14:52:11 +0200 (So, 11 Sep 2011) $

- */

-public abstract class AbstractSystemOfUnits implements SystemOfUnits, IName {

-	/**

-	 * Holds collection of units.

-	 */

-	protected static final Set<Unit<?>> UNITS = new HashSet<Unit<?>>();

-

-	// ///////////////////

-	// Collection View //

-	// ///////////////////

-	/**

-	 * Returns a read only view over the units defined in this class.

-	 * 

-	 * @return the collection of units.

-	 */

-	public Set<Unit<?>> getUnits() {

-		return Collections.unmodifiableSet(UNITS);

-	}

-	

-	@Override

-	public Set<Unit<?>> getUnits(Dimension dimension) {

-		return Helper.getUnitsOfDimension(UNITS, dimension);

-	}

-

-	@Override

-	public <T extends Quantity<T>> Unit<T> getUnit(Class<T> quantityType) {

-		return ServiceProvider.current().getQuantityFactory(quantityType).getSystemUnit();

-	}

-	

-	/**

-	 * Adds a new named unit to the collection.

-	 * 

-	 * @param unit the unit being added.

-	 * @param name the name of the unit.

-	 * @return <code>unit</code>.

-	 */

-	@SuppressWarnings("unchecked")

-	protected static <U extends Unit<?>> U addUnit(U unit, String name) {

-		if (name != null && unit instanceof AbstractUnit) {

-			AbstractUnit<?> aUnit = (AbstractUnit<?>)unit;

-			aUnit.setName(name);

-			UNITS.add(aUnit);

-			return (U) aUnit;

-		}

-		UNITS.add(unit);

-		return unit;

-	}

-

-	/**

-	 * Adds a new unit to the collection.

-	 * 

-	 * @param unit

-	 *            the unit being added.

-	 * @return <code>unit</code>.

-	 */

-	protected static <U extends Unit<?>> U addUnit(U unit) {

-		UNITS.add(unit);

-		return unit;

-	}

-	static class Helper {

-		static Set<Unit<?>> getUnitsOfDimension(final Set<Unit<?>> units, 

-				Dimension dimension) {

-			if (dimension != null) {

-				Set<Unit<?>>dimSet = new HashSet<Unit<?>>();

-				for (Unit<?> u : units) {

-					if (dimension.equals(u.getDimension())) {

-						dimSet.add(u);

-					}

-				}

-				return dimSet;

-			}

-			return null;

-		}

-	}

-}

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
deleted file mode 100644
index 0c3d57b..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractUnit.java
+++ /dev/null
@@ -1,647 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, Jean-Marie Dautelle, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Jean-Marie Dautelle, Steve Emmerson  

- *    - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import java.io.IOException;

-import java.io.Serializable;

-import java.math.BigInteger;

-import java.text.ParsePosition;

-import java.util.HashMap;

-import java.util.Map;

-

-import javax.measure.IncommensurableException;

-import javax.measure.Dimension;

-import javax.measure.Quantity;

-import javax.measure.UnconvertibleException;

-import javax.measure.Unit;

-import javax.measure.UnitConverter;

-import javax.measure.format.UnitFormat;

-import javax.measure.quantity.Dimensionless;

-

-import tec.uom.lib.common.function.Nameable;

-import tec.uom.lib.common.function.SymbolSupplier;

-import org.eclipse.uomo.units.impl.AlternateUnit;

-import org.eclipse.uomo.units.impl.BaseUnit;

-import org.eclipse.uomo.units.impl.DimensionImpl;

-import org.eclipse.uomo.units.impl.ProductUnit;

-import org.eclipse.uomo.units.impl.QuantityFactoryImpl;

-import org.eclipse.uomo.units.impl.TransformedUnit;

-import org.eclipse.uomo.units.impl.converter.AddConverter;

-import org.eclipse.uomo.units.impl.converter.LogConverter;

-import org.eclipse.uomo.units.impl.converter.MultiplyConverter;

-import org.eclipse.uomo.units.impl.converter.RationalConverter;

-import org.eclipse.uomo.units.impl.format.LocalUnitFormat;

-import org.eclipse.uomo.units.impl.system.SI;

-

-/**

- * <p>

- * This class represents a determinate

- * {@linkplain javax.measure.quantity.Quantity quantity} (as of length, time,

- * heat, or value) adopted as a standard of measurement.

- * </p>

- * 

- * <p>

- * It is helpful to think of instances of this class as recording the history by

- * which they are created. Thus, for example, the string "g/kg" (which is a

- * dimensionless unit) would result from invoking the method toString() on a

- * unit that was created by dividing a gram unit by a kilogram unit. Yet, "kg"

- * divided by "kg" returns {@link #ONE} and not "kg/kg" due to automatic unit

- * factorization.

- * </p>

- * 

- * <p>

- * This class supports the multiplication of offsets units. The result is

- * usually a unit not convertible to its {@linkplain #toMetric metric unit}.

- * Such units may appear in derivative quantities. For example Celsius per meter

- * is an unit of gradient, which is common in atmospheric and oceanographic

- * research.

- * </p>

- * 

- * <p>

- * Units raised at non-integral powers are not supported. For example,

- * <code>LITRE.root(2)</code> raises an <code>ArithmeticException</code>; but

- * <code>LITRE.toMetric().root(2)</code> returns <code>METRE</code>.

- * </p>

- * 

- * <p>

- * Instances of this class and sub-classes are immutable.

- * </p>

- * 

- * @param <Q>

- *            The type of the quantity measured by this unit.

- * 

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author <a href="mailto:steve@unidata.ucar.edu">Steve Emmerson</a>

- * @author <a href="mailto:desruisseaux@users.sourceforge.net">Martin

- *         Desruisseaux</a>

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * 

- * @version 1.9, $Date: 2017-11-24 $

- * @see <a href="http://en.wikipedia.org/wiki/Units_of_measurement"> Wikipedia:

- *      Units of measurement</a>

- */

-public abstract class AbstractUnit<Q extends Quantity<Q>> implements Unit<Q>, Nameable, SymbolSupplier, Serializable {

-

-	/**

-	 * For cross-version compatibility.

-	 */

-	private static final long serialVersionUID = -2107517222666572443L;

-

-	/**

-	 * Holds the name.

-	 */

-	private String name;

-

-	/**

-	 * Holds the symbol.

-	 */

-	private String symbol;

-

-	/**

-	 * Holds the dimensionless unit <code>ONE</code>.

-	 */

-	public static final Unit<Dimensionless> ONE = new ProductUnit<Dimensionless>();

-

-	/**

-	 * Holds the unique symbols collection (base unit or alternate units).

-	 */

-	protected static final HashMap<String, Unit<?>> SYMBOL_TO_UNIT = new HashMap<String, Unit<?>>();

-

-	/**

-	 * Default constructor.

-	 */

-	protected AbstractUnit() {

-		this(null);

-	}

-

-	/**

-	 * Named constructor.

-	 */

-	protected AbstractUnit(String name) {

-		this.name = name;

-	}

-

-	protected void setName(String name) {

-		this.name = name;

-	}

-

-	@Override

-	public String getName() {

-		return name;

-	}

-

-	/**

-	 * Returns the symbol (if any) of this unit. The default implementation

-	 * returns <code>null</code> (no symbol).

-	 * 

-	 * @return this unit symbol or <code>null</code> if this unit has not

-	 *         specific symbol associated with (e.g. product of units).

-	 */

-	public String getSymbol() {

-		return null;

-	}

-

-	protected void setSymbol(String s) {

-		this.symbol = s;

-	}

-

-	/**

-	 * Returns the simple units and their exponent whose product is this unit or

-	 * <code>null</code> if this unit is a simple unit (not a product of

-	 * existing units).

-	 * 

-	 * @return the simple units and their exponent making up this unit.

-	 */

-	public Map<Unit<?>, Integer> getProductUnits() {

-		return null;

-	}

-

-	// ////////////////////////////////////////////////////

-	// Contract methods (for sub-classes to implement). //

-	// ////////////////////////////////////////////////////

-	/**

-	 * Returns the unscaled metric unit from which this unit is derived.

-	 * <p>

-	 * Metric units are either {@link BaseUnit base units}, {@link #alternate

-	 * alternate units} or product of rational powers of metric units.

-	 * </p>

-	 * <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

-	 * isAngularSpeed(Unit<?> unit) { return

-	 * unit.toMetric().equals(RADIAN.divide(SECOND)); }

-	 * assert(REVOLUTION.divide(MINUTE).isAngularSpeed()); // Returns true.

-	 * [/code]

-	 * 

-	 * @return the metric unit this unit is derived from or <code>this</code> if

-	 *         this unit {@link #isMetric() is a metric} unit.

-	 * @see #isMetric()

-	 */

-	protected abstract Unit<Q> toMetric();

-

-	/**

-	 * Returns the converter to the metric unit.

-	 * 

-	 * <p>

-	 * <i> Note: Having the same metric unit is not sufficient to ensure that a

-	 * converter exists between the two units (e.g. °C/m and K/m).</i>

-	 * </p>

-	 * 

-	 * @return the unit converter from this unit to its metric unit.

-	 */

-	public abstract UnitConverter getConverterToMetric();

-

-	/**

-	 * Returns the hash code for this unit.

-	 * 

-	 * @return this unit hashcode value.

-	 */

-	@Override

-	public abstract int hashCode();

-

-	/**

-	 * Indicates if the specified unit can be considered equals to the one

-	 * specified.

-	 * 

-	 * @param that

-	 *            the object to compare to.

-	 * @return <code>true</code> if this unit is considered equal to that unit;

-	 *         <code>false</code> otherwise.

-	 */

-	@Override

-	public abstract boolean equals(Object that);

-

-	/**

-	 * Indicates if this unit is an unscaled metric unit. Metric units are

-	 * either {@link BaseUnit base units}, {@link #alternate alternate units} or

-	 * product of rational powers of metric units. Because metric units are

-	 * unscaled units, {@link SI#METRE METRE} is a metric units; but

-	 * <code>KILO(METRE)</code> is not.

-	 * 

-	 * @return <code>this.toMetric().equals(this)</code>

-	 * @see #toMetric()

-	 */

-	public boolean isUnscaledMetric() {

-		return toMetric().equals(this);

-	}

-

-	/**

-	 * Indicates if this unit is compatible with the unit specified. Units don't

-	 * need to be equals to be compatible. For example:[code] RADIAN.equals(ONE)

-	 * == false RADIAN.isCompatible(ONE) == true [/code]

-	 * 

-	 * @param that

-	 *            the other unit.

-	 * @return <code>this.getDimension().equals(that.getDimension())</code>

-	 * @see #getDimension()

-	 */

-	public final boolean isCompatible(Unit<?> that) {

-		return (this == that) || this.toMetric().equals(that.getSystemUnit())

-				|| (!"".equals(this.getDimension().toString()) && this //$NON-NLS-1$

-						.getDimension().equals(that.getDimension()));

-	}

-

-	/**

-	 * 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<Speed> C =

-	 * METRE.times(299792458).divide(SECOND).asType(Speed.class); [/code]

-	 * 

-	 * @param <T>

-	 *            The type of the quantity measured by the unit.

-	 * @param type

-	 *            the quantity class identifying the nature of the unit.

-	 * @return this unit parameterized with the specified type.

-	 * @throws ClassCastException

-	 *             if the dimension of this unit is different from the specified

-	 *             quantity dimension.

-	 * @throws UnsupportedOperationException

-	 *             if the specified type is not recognized.

-	 */

-	@SuppressWarnings("unchecked")

-	public final <T extends Quantity<T>> Unit<T> asType(Class<T> type) throws ClassCastException {

-		Unit<T> metricUnit = QuantityFactoryImpl.getInstance(type).getSystemUnit();

-		if ((metricUnit == null) || metricUnit.isCompatible(this))

-			return (Unit<T>) this;

-		throw new ClassCastException("The unit: " + this //$NON-NLS-1$

-				+ " is not of parameterized type " + type); //$NON-NLS-1$

-		// TODO use NLS

-	}

-

-	/**

-	 * Returns the dimension of this unit (depends upon the current dimension

-	 * {@linkplain QuantityDimension.Model model}).

-	 * 

-	 * @return the dimension of this unit for the current model.

-	 */

-	public Dimension getDimension() {

-		// All possible metric units (BaseUnit, AlternateUnit and ProductUnit)

-		// overrides this method.

-		return this.toMetric().getDimension();

-	}

-

-	/**

-	 * Returns the intrinsic dimensional transform of this unit (depends upon

-	 * the current {@linkplain QuantityDimension.Model model} for

-	 * {@link BaseUnit} instance). Metric units should override this method.

-	 * 

-	 * @return the intrinsic transformation of this unit relatively to its

-	 *         dimension.

-	 * @throws UnsupportedOperationException

-	 *             if this unit is a metric unit and it does not override this

-	 *             method.

-	 */

-	public UnitConverter getDimensionalTransform() {

-		// All possible metric units (BaseUnit, AlternateUnit and ProductUnit)

-		// overrides this method.

-		return this.getConverterToMetric().concatenate(((AbstractUnit<Q>) this.toMetric()).getDimensionalTransform());

-	}

-

-	/**

-	 * Returns a converter of numeric values from this unit to another unit of

-	 * same type (convenience method not raising checked exception).

-	 * 

-	 * @param that

-	 *            the unit of same type to which to convert the numeric values.

-	 * @return the converter from this unit to <code>that</code> unit.

-	 * @throws UnconvertibleException

-	 *             if the converter cannot be constructed.

-	 */

-	public UnitConverter getConverterTo(Unit<Q> that) throws UnconvertibleException {

-		return searchConverterTo(that);

-	}

-

-	/**

-	 * Returns a converter form this unit to the specified unit of type unknown.

-	 * This method can be used when the dimension of the specified unit is

-	 * unknown at compile-time or when the {@linkplain QuantityDimension.Model

-	 * dimensional model} allows for conversion between units of different type.

-	 * To convert to a unit having the same parameterized type,

-	 * {@link #getConverterTo(AbstractUnit)} is preferred (no checked exception

-	 * raised).

-	 * 

-	 * @param that

-	 *            the unit to which to convert the numeric values.

-	 * @return the converter from this unit to <code>that</code> unit.

-	 * @throws ConversionException

-	 *             if the units are not compatible (e.g.

-	 *             <code>!this.isCompatible(that)</code>).

-	 * @throws UnsupportedOperationException

-	 *             if the converter cannot be constructed.

-	 */

-	public UnitConverter getConverterToAny(Unit<?> that) throws IncommensurableException, UnconvertibleException {

-		return ((this == that) || this.equals(that)) ? AbstractConverter.IDENTITY : searchConverterTo(that);

-	}

-

-	@SuppressWarnings("unchecked")

-	private UnitConverter searchConverterTo(Unit<?> that) throws UnconvertibleException {

-		// First we have find a common dimension to convert to.

-

-		// Try the SI unit.

-		Unit<Q> thisSI = this.toMetric();

-		Unit<?> thatSI = that.getSystemUnit();

-		if (thisSI.equals(thatSI))

-			return ((AbstractUnit<?>) that).getConverterToMetric().inverse().concatenate(this.getConverterToMetric());

-

-		// Use dimensional unit.

-		if (!thisSI.getDimension().equals(thatSI.getDimension()))

-			throw new UnconvertibleException(this + " is not compatible with " //$NON-NLS-1$

-					+ that);

-		UnitConverter thisTransform = ((AbstractUnit<?>) thisSI).getDimensionalTransform()

-				.concatenate(this.getConverterToMetric());

-		@SuppressWarnings("rawtypes")

-		UnitConverter thatTransform = ((AbstractUnit<Dimensionless>) thatSI).getDimensionalTransform()

-				.concatenate(((AbstractUnit) that).getConverterToMetric());

-		return thatTransform.inverse().concatenate(thisTransform);

-	}

-

-	/**

-	 * Returns a metric unit equivalent to this unscaled metric unit but used in

-	 * expressions to distinguish between quantities of a different nature but

-	 * of the same dimensions.

-	 * 

-	 * <p>

-	 * Examples of alternate units:[code] Unit<Angle> RADIAN =

-	 * ONE.alternate("rad"); Unit<Force> NEWTON =

-	 * METRE.times(KILOGRAM).divide(SECOND.pow(2)).alternate("N");

-	 * Unit<Pressure> PASCAL = NEWTON.divide(METRE.pow(2)).alternate("Pa");

-	 * [/code]

-	 * </p>

-	 * 

-	 * @param <Q>

-	 *            the type of the quantity measured by the new alternate unit.

-	 * 

-	 * @param symbol

-	 *            the new symbol for the alternate unit.

-	 * @return the alternate unit.

-	 * @throws UnsupportedOperationException

-	 *             if this unit is not an unscaled metric unit.

-	 * @throws IllegalArgumentException

-	 *             if the specified symbol is already associated to a different

-	 *             unit.

-	 */

-	@SuppressWarnings({ "unchecked", "rawtypes" })

-	public final Unit<Q> alternate(String symbol) {

-		return new AlternateUnit(this, symbol);

-	}

-

-	/**

-	 * Returns the unit derived from this unit using the specified converter.

-	 * The converter does not need to be linear. For example:[code]

-	 * Unit<Dimensionless> DECIBEL = Unit.ONE.transform( new

-	 * LogConverter(10).inverse().concatenate( new RationalConverter(1, 10)));

-	 * [/code]

-	 * 

-	 * @param operation

-	 *            the converter from the transformed unit to this unit.

-	 * @return the unit after the specified transformation.

-	 */

-	@SuppressWarnings("unchecked")

-	public final Unit<Q> transform(UnitConverter operation) {

-		if (this instanceof TransformedUnit) {

-			Unit<Q> tf = this;

-			Unit<?> parent = (Unit<?>) ((TransformedUnit<?>) tf).getParentUnit();

-			UnitConverter toParent = ((TransformedUnit<?>) tf).toParentUnit();

-			if (toParent == null)

-				return (Unit<Q>) parent;

-			UnitConverter toParentConcat = toParent.concatenate(operation);

-			if (toParentConcat == AbstractConverter.IDENTITY)

-				return (Unit<Q>) parent;

-			return new TransformedUnit<Q>((Unit<Q>) parent, (AbstractConverter) toParentConcat);

-		}

-		if (operation == AbstractConverter.IDENTITY)

-			return this;

-		return new TransformedUnit<Q>(this, (AbstractConverter) operation);

-	}

-

-	/**

-	 * Returns the result of adding an offset to this unit. The returned unit is

-	 * convertible with all units that are convertible with this unit.

-	 * 

-	 * @param offset

-	 *            the offset added (expressed in this unit, e.g.

-	 *            <code>CELSIUS = KELVIN.add(273.15)</code>).

-	 * @return <code>this.transform(new AddConverter(offset))</code>

-	 */

-	public final Unit<Q> shift(double offset) {

-		if (offset == 0)

-			return this;

-		return transform(new AddConverter(offset));

-	}

-

-	/**

-	 * Returns the result of multiplying this unit by an exact factor.

-	 * 

-	 * @param factor

-	 *            the exact scale factor (e.g.

-	 *            <code>KILOMETRE = METRE.multiply(1000)</code>).

-	 * @return <code>this.transform(new RationalConverter(factor, 1))</code>

-	 */

-	final Unit<Q> multiply(long factor) {

-		if (factor == 1)

-			return this;

-		return transform(new RationalConverter(BigInteger.valueOf(factor), BigInteger.ONE));

-	}

-

-	/**

-	 * Returns the result of multiplying this unit by a an approximate factor.

-	 * 

-	 * @param factor

-	 *            the approximate factor (e.g.

-	 *            <code>ELECTRON_MASS = KILOGRAM.multiply(9.10938188e-31)</code>

-	 *            ).

-	 * @return <code>this.transform(new MultiplyConverter(factor))</code>

-	 */

-	public final Unit<Q> multiply(double factor) {

-		if (factor == 1)

-			return this;

-		return transform(new MultiplyConverter(factor));

-	}

-

-	/**

-	 * Returns the product of this unit with the one specified.

-	 * 

-	 * @param that

-	 *            the unit multiplicand.

-	 * @return <code>this * that</code>

-	 */

-	@SuppressWarnings({ "unchecked", "rawtypes" })

-	public final Unit<?> multiply(Unit<?> that) {

-		if (this.equals(ONE))

-			return that;

-		if (that.equals(ONE))

-			return this;

-		if (this.isRationalFactor())

-			return that.transform(this.getConverterTo((Unit) ONE));

-		if (((AbstractUnit) that).isRationalFactor())

-			return this.transform(that.getConverterTo((Unit) ONE));

-		return ProductUnit.getProductInstance(this, (AbstractUnit<?>) that);

-	}

-

-	private boolean isRationalFactor() {

-		if (!(this instanceof TransformedUnit<?>))

-			return false;

-		TransformedUnit<Q> tu = (TransformedUnit<Q>) this;

-		return tu.getParentUnit().equals(ONE) && (tu.getConverterTo(tu.getSystemUnit()) instanceof RationalConverter);

-	}

-

-	/**

-	 * Returns the inverse of this unit.

-	 * 

-	 * @return <code>1 / this</code>

-	 */

-	@SuppressWarnings({ "unchecked", "rawtypes" })

-	public final Unit<?> inverse() {

-		if (this.equals(ONE))

-			return this;

-		if (this.isRationalFactor())

-			return this.transform(this.getConverterTo((Unit) ONE).inverse());

-		return ProductUnit.getQuotientInstance((AbstractUnit<?>) ONE, this);

-	}

-

-	/**

-	 * Returns the result of dividing this unit by an exact divisor.

-	 * 

-	 * @param divisor

-	 *            the exact divisor. (e.g.

-	 *            <code>QUART = GALLON_LIQUID_US.divide(4)</code>).

-	 * @return <code>this.transform(new RationalConverter(1 , divisor))</code>

-	 */

-	public final Unit<Q> divide(long divisor) {

-		if (divisor == 1)

-			return this;

-		return transform(new RationalConverter(BigInteger.ONE, BigInteger.valueOf(divisor)));

-	}

-

-	/**

-	 * Returns the result of dividing this unit by an approximate divisor.

-	 * 

-	 * @param divisor

-	 *            the approximate divisor.

-	 * @return <code>this.transform(new MultiplyConverter(1.0 / divisor))</code>

-	 */

-	public final Unit<Q> divide(double divisor) {

-		if (divisor == 1)

-			return this;

-		return transform(new MultiplyConverter(1.0 / divisor));

-	}

-

-	/**

-	 * Returns the logarithmic result of this unit.

-	 * 

-	 * @param base

-	 *            the logarithmic base.

-	 * @return <code>this.transform(new MultiplyConverter(1.0 / divisor))</code>

-	 */

-	public final Unit<Q> log(double base) {

-		return transform(new LogConverter(base));

-	}

-

-	/**

-	 * Returns the quotient of this unit with the one specified.

-	 * 

-	 * @param that

-	 *            the unit divisor.

-	 * @return <code>this / that</code>

-	 */

-	public final Unit<?> divide(Unit<?> that) {

-		return (AbstractUnit<?>) this.multiply(that.inverse());

-	}

-

-	/**

-	 * Returns a unit equals to the given root of this unit.

-	 * 

-	 * @param n

-	 *            the root's order.

-	 * @return the result of taking the given root of this unit.

-	 * @throws ArithmeticException

-	 *             if <code>n == 0</code> or if this operation would result in

-	 *             an unit with a fractional exponent.

-	 */

-	public final Unit<?> root(int n) {

-		if (n > 0)

-			return ProductUnit.getRootInstance(this, n);

-		else if (n == 0)

-			throw new ArithmeticException("Root's order of zero"); //$NON-NLS-1$

-		else

-			// n < 0

-			return ONE.divide(this.root(-n));

-	}

-

-	/**

-	 * Returns a unit equals to this unit raised to an exponent.

-	 * 

-	 * @param n

-	 *            the exponent.

-	 * @return the result of raising this unit to the exponent.

-	 */

-	public final Unit<?> pow(int n) {

-		if (n > 0)

-			return this.multiply(this.pow(n - 1));

-		else if (n == 0)

-			return ONE;

-		else

-			// n < 0

-			return ONE.divide(this.pow(-n));

-	}

-

-	/**

-	 * Returns a unit instance that is defined from the specified character

-	 * sequence (text) using the {@linkplain AbstractUnitFormat#getInstance

-	 * default} unit format (<a href="http://unitsofmeasure.org/">UCUM</a>

-	 * based). This method is capable of parsing any units representations

-	 * produced by {@link #toString()}. Locale-sensitive unit formatting and

-	 * parsing are handled by the {@link AbstractUnitFormat} class and its

-	 * subclasses.

-	 * 

-	 * <p>

-	 * This method can be used to parse dimensionless units.[code]

-	 * Unit<Dimensionless> PERCENT =

-	 * Unit.valueOf("100").inverse().asType(Dimensionless.class); [/code]

-	 * 

-	 * @param charSequence

-	 *            the character sequence to parse.

-	 * @return <code>UnitFormat.getInstance().parse(csq, new ParsePosition(0))</code>

-	 * @throws IllegalArgumentException

-	 *             if the specified character sequence cannot be correctly

-	 *             parsed (e.g. not UCUM compliant).

-	 */

-	public static Unit<?> valueOf(CharSequence charSequence) {

-		return LocalUnitFormat.getInstance().parse(charSequence, new ParsePosition(0));

-	}

-

-	// ////////////////////

-	// GENERAL CONTRACT //

-	// ////////////////////

-	/**

-	 * Returns the international <code>String</code> representation of this unit

-	 * (<a href="http://unitsofmeasure.org/">UCUM</a> based). The string

-	 * produced for a given unit is always the same; it is not affected by the

-	 * locale. This means that it can be used as a canonical string

-	 * representation for exchanging units, or as a key for a Hashtable, etc.

-	 * Locale-sensitive unit formatting and parsing is handled by

-	 * {@link AbstractUnitFormat} class and its subclasses.

-	 * 

-	 * @return <code>UnitFormat.getInstance().format(this)</code>

-	 */

-	@Override

-	public String toString() {

-		try {

-			UnitFormat format = LocalUnitFormat.getInstance();

-			return String.valueOf(format.format(this, new StringBuilder()));

-		} catch (IOException e) {

-			// TODO should this happen?

-			return ""; //$NON-NLS-1$

-		}

-	}

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractUnitFormat.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractUnitFormat.java
deleted file mode 100644
index 349a5b6..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/AbstractUnitFormat.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * Copyright (c) 2005, 2017, Werner Keil, Ikayzo 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Werner Keil, Ikayzo and others - initial API and implementation
- */
-package org.eclipse.uomo.units;
-
-import java.io.IOException;
-import java.text.Format;
-import java.text.ParsePosition;
-import java.util.Locale;
-
-import org.eclipse.uomo.units.impl.format.LocalUnitFormat;
-import org.eclipse.uomo.units.impl.system.USCustomary;
-import javax.measure.Unit;
-import javax.measure.format.UnitFormat;
-
-
-/**
- * <p> This class provides the interface for formatting and parsing {@link
- *     AbstractUnit units}.</p>
- *
- * <p> For all metric units, the 20 SI prefixes used to form decimal
- *     multiples and sub-multiples of SI units are recognized.
- *     {@link USCustomary US Customary} units are directly recognized. For example:[code]
- *        Unit.valueOf("m°C").equals(SI.MILLI(SI.CELSIUS))
- *        Unit.valueOf("kW").equals(SI.KILO(SI.WATT))
- *        Unit.valueOf("ft").equals(SI.METRE.multiply(3048).divide(10000))[/code]</p>
- *
- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
- * @author  <a href="mailto:uomo@catmedia.us">Werner Keil</a>
- * @version 1.5.1 ($Revision: 215 $), $Date: 2010-09-19 22:12:08 +0200 (So, 19 Sep 2010) $
- * 
- */
-public abstract class AbstractUnitFormat extends Format implements UnitFormat {
-
-   /**
-     * Returns the {@link SymbolMap} for this unit format.
-     *
-     * @return the symbol map used by this format.
-     */
-    protected abstract SymbolMap getSymbolMap();
-
-    /**
-     * Formats the specified unit.
-     *
-     * @param unit the unit to format.
-     * @param appendable the appendable destination.
-     * @return The appendable destination passed in as {@code appendable},
-     *         with formatted text appended.
-     * @throws IOException if an error occurs.
-     */
-    public abstract Appendable format(Unit<?> unit, Appendable appendable)
-            throws IOException;
-
-    /**
-     * Parses a portion of the specified <code>CharSequence</code> from the
-     * specified position to produce a unit. If there is no unit to parse
-     * {@link AbstractUnit#ONE} is returned.
-     *
-     * @param csq the <code>CharSequence</code> to parse.
-     * @param cursor the cursor holding the current parsing index.
-     * @return the unit parsed from the specified character sub-sequence.
-     * @throws IllegalArgumentException if any problem occurs while parsing the
-     *         specified character sequence (e.g. illegal syntax).
-     */
-    public abstract Unit<?> parse(CharSequence csq, ParsePosition cursor)
-            throws IllegalArgumentException;
-
-    /**
-     * Return a formatter for CurrencyAmount objects in the given
-     * locale.
-     * @param locale desired locale
-     * @return a formatter object
-     * @stable ICU 3.0
-     */
-    public static AbstractUnitFormat getUnitFormat(Locale locale) {
-        return LocalUnitFormat.getInstance(locale);
-    }
-
-    /**
-     * Return a formatter for CurrencyAmount objects in the default
-     * locale.
-     * @return a formatter object
-     * @stable ICU 3.0
-     */
-    public static AbstractUnitFormat getUnitFormat() {
-        return getUnitFormat(Locale.getDefault());
-    }
-    
-    /**
-     * Convenience method equivalent to {@link #format(AbstractUnit, Appendable)}
-     * except it does not raise an IOException.
-     *
-     * @param unit the unit to format.
-     * @param dest the appendable destination.
-     * @return the specified <code>StringBuilder</code>.
-     */
-    final StringBuilder format(AbstractUnit<?> unit, StringBuilder dest) {
-        try {
-            return (StringBuilder) this.format(unit, (Appendable) dest);
-        } catch (IOException ex) {
-            throw new Error(ex); // Can never happen.
-        }
-    }
-
-    /**
-     * serialVersionUID
-     */
-    private static final long serialVersionUID = -2046025267890654321L;
-}
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/Activator.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/Activator.java
deleted file mode 100644
index 9a2482f..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/Activator.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2005, 2017, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Werner Keil - initial API and implementation
- */
-package org.eclipse.uomo.units;
-
-import java.util.Dictionary;
-import java.util.Locale;
-
-import javax.measure.spi.SystemOfUnits;
-import javax.measure.spi.SystemOfUnitsService;
-import javax.measure.spi.UnitFormatService;
-
-import org.eclipse.uomo.units.impl.format.UnitFormatServiceImpl;
-import org.eclipse.uomo.units.impl.system.SystemOfUnitsServiceImpl;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * OSGi part of implementation.
- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>
- * @version 0.6, $Date: 2017-07-31 $
- */
-public class Activator implements BundleActivator, ServiceListener {
-	private SystemOfUnitsService souService;
-	private ServiceTracker souServiceTracker;
-	private UnitFormatService formatService;
-	private ServiceTracker formatServiceTracker;
-	private BundleContext fContext;
-	
-	/*
-	 * (non-Javadoc)
-	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
-	 */
-	public void start(BundleContext context) throws Exception {
-		fContext = context;
-		
-		// register the services
-		startFormat(context, null);
-		startSOU(context, null);
-//		startDictionary(context, props);
-	}
-	
-	private void startFormat(BundleContext context, Dictionary<String, ?> props) throws Exception {
-		formatService = new UnitFormatServiceImpl();
-		
-		// register the service
-		context.registerService(UnitFormatService.class.getName(), formatService, props);
-
-		// create a tracker and track the service
-		formatServiceTracker = new ServiceTracker(context, UnitFormatService.class.getName(), null);
-		formatServiceTracker.open();
-
-		// have a service listener to implement the whiteboard pattern
-	    fContext.addServiceListener(this, "(objectclass=" + Locale.class.getName() + ")");
-		
-		// grab the service
-//		formatService = (LocalFormatService) formatServiceTracker.getService();
-		
-		// register the locale
-//		formatService.registerDictionary(new DictionaryImpl());
-	}
-	
-	private void startSOU(BundleContext context, Dictionary<String, ?> props) throws Exception {
-		souService = new SystemOfUnitsServiceImpl();
-		
-		// register the service
-		context.registerService(SystemOfUnitsService.class.getName(), souService, props);
-
-		// create a tracker and track the service
-		souServiceTracker = new ServiceTracker(context, SystemOfUnitsService.class.getName(), null);
-		souServiceTracker.open();
-
-		// have a service listener to implement the whiteboard pattern
-	    fContext.addServiceListener(this, "(objectclass=" + SystemOfUnits.class.getName() + ")");
-		
-		// grab the service
-//		formatService = (LocalFormatService) formatServiceTracker.getService();
-		
-	}	
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
-	 */
-	public void stop(BundleContext context) throws Exception {
-		// close the service tracker(s)
-		stopFormat();
-		stopSOU();
-//		stopDictionary();
-		fContext = null;
-	}
-	
-	private void stopFormat() throws Exception {
-		formatServiceTracker.close();
-		formatServiceTracker = null;
-
-		formatService = null;
-	}
-	
-	private void stopSOU() throws Exception {
-		souServiceTracker.close();
-		souServiceTracker = null;
-
-		souService = null;
-	}
-
-	public void serviceChanged(ServiceEvent ev) {
-//		ServiceReference sr = ev.getServiceReference();
-		switch(ev.getType()) {
-			case ServiceEvent.REGISTERED:
-			{
-//				Dictionary dictionary = (Dictionary) fContext.getService(sr);
-//				dictService.registerDictionary(dictionary);
-			}
-			break;
-			case ServiceEvent.UNREGISTERING:
-			{
-//				Dictionary dictionary = (Dictionary) fContext.getService(sr);
-//				dictService.unregisterDictionary(dictionary);
-			}
-			break;
-		}
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/BinaryPrefix.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/BinaryPrefix.java
deleted file mode 100644
index ef57a5c..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/BinaryPrefix.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Jean-Marie Dautelle - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import java.math.BigInteger;

-

-import org.eclipse.uomo.units.impl.converter.RationalConverter;

-import javax.measure.Quantity;

-import javax.measure.Unit;

-

-// ///////////////////

-// BINARY PREFIXES  //

-// ///////////////////

-/**

- * Utility class holding binary prefixes.

- * 

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version 1.1 ($Revision: 212 $), $Date: 2010-09-13 23:50:44 +0200 (Mo, 13 Sep 2010) $

- * @see <a href="http://en.wikipedia.org/wiki/Binary_prefix">Wikipedia: Binary

- *      Prefix</a>

- * @deprecated use org.eclipse.uomo.units.impl.system.BinaryPrefix

- */

-public final class BinaryPrefix {

-

-	private BinaryPrefix() {

-		// Utility class no visible constructor.

-	}

-

-	/**

-	 * Returns the specified unit multiplied by the factor

-	 * <code>2<sup>10</sup></code> (binary prefix).

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1024)</code>.

-	 */

-	public static <Q extends Quantity<Q>> Unit<?> KIBI(Unit<?> unit) {

-		return unit.multiply(K);

-	}

-

-	/**

-	 * Returns the specified unit multiplied by the factor

-	 * <code>2<sup>20</sup></code> (binary prefix).

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1048576)</code>.

-	 */

-	public static <Q extends Quantity<Q>> Unit<?> MEBI(Unit<?> unit) {

-		return unit.multiply(K2);

-	}

-

-	/**

-	 * Returns the specified unit multiplied by the factor

-	 * <code>2<sup>30</sup></code> (binary prefix).

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1073741824)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<?> GIBI(Unit<?> unit) {

-		return unit.multiply(K3);

-	}

-

-	/**

-	 * Returns the specified unit multiplied by the factor

-	 * <code>2<sup>40</sup></code> (binary prefix).

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1099511627776L)</code>.

-	 */

-	public static <Q extends Quantity<Q>> Unit<?> TEBI(Unit<?> unit) {

-		return unit.multiply(1099511627776L);

-	}

-

-	/**

-	 * Returns the specified unit multiplied by the factor

-	 * <code>2<sup>50</sup></code> (binary prefix).

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1125899906842624L)</code>.

-	 */

-	public static <Q extends Quantity<Q>> Unit<?> PEBI(Unit<?> unit) {

-		return unit.multiply(1125899906842624L);

-	}

-

-	/**

-	 * Returns the specified unit multiplied by the factor

-	 * <code>2<sup>60</sup></code> (binary prefix).

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1152921504606846976L)</code>.

-	 */

-	public static <Q extends Quantity<Q>> Unit<?> EXBI(Unit<?> unit) {

-		return unit.multiply(1152921504606846976L);

-	}

-

-	/**

-	 * Returns the specified unit multiplied by the factor

-	 * <code>2<sup>70</sup></code> (binary prefix).

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.transform(2<sup>70</sup>)</code>.

-	 */

-	public static <Q extends Quantity<Q>> Unit<?> ZEBI(Unit<?> unit) {

-		return unit.transform(K70);

-	}

-

-	/**

-	 * Returns the specified unit multiplied by the factor

-	 * <code>2<sup>80</sup></code> (binary prefix).

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.transform(2<sup>80</sup>)</code>.

-	 */

-	public static <Q extends Quantity<Q>> Unit<?> YOBI(Unit<?> unit) {

-		return unit.transform(K80);

-	}

-

-	// ///////////////////

-	//  JDEC PREFIXES   //

-	// ///////////////////

-	

-	/**

-	 * <p>

-	 * kilo (K)

-	 * </p>

-	 * This JEDEC prefix is equivalent to <{@link #KIBI}>.

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1024)</code>.

-	 * @see <a

-	 *      href="http://en.wikipedia.org/wiki/JEDEC_memory_standards">Wikipedia:

-	 *      JEDEC memory standards</a>

-	 */

-	public static <Q extends Quantity<Q>> Unit<?> JEDEC_KILO(Unit<?> unit) {

-		return unit.multiply(K);

-	}

-

-	/**

-	 * <p>

-	 * mega (M)

-	 * </p>

-	 * This JEDEC prefix is equal to <{@link #MEBI}>.

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1048576)</code>.

-	 * @see <a

-	 *      href="http://en.wikipedia.org/wiki/JEDEC_memory_standards">Wikipedia:

-	 *      JEDEC memory standards</a>

-	 */

-	public static <Q extends Quantity<Q>> Unit<?> JEDEC_MEGA(Unit<?> unit) {

-		return unit.multiply(K2);

-	}

-

-	/**

-	 * <p>

-	 * giga (G)

-	 * </p>

-	 * This JEDEC prefix is equal to <{@link #GIBI}>.

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1073741824)</code>.

-	 * @see <a

-	 *      href="http://en.wikipedia.org/wiki/JEDEC_memory_standards">Wikipedia:

-	 *      JEDEC memory standards</a>

-	 */

-	public static <Q extends Quantity<Q>> Unit<?> JEDEC_GIGA(Unit<?> unit) {

-		return unit.multiply(K3);

-	}

-

-	// Holds prefix converters (optimization).

-	private static int K = 1024;

-

-	private static int K2 = 1048576;

-

-	private static int K3 = 1073741824;

-

-	private static RationalConverter K70 = new RationalConverter(BigInteger

-			.valueOf(2).pow(70), BigInteger.ONE);

-

-	private static RationalConverter K80 = new RationalConverter(BigInteger

-			.valueOf(2).pow(80), BigInteger.ONE);

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/ComparableQuantity.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/ComparableQuantity.java
deleted file mode 100644
index 52055cd..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/ComparableQuantity.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units;

-import java.io.Serializable;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-

-/**

- * Quantity specialized for the Java SE platform. It extends {@link Quantity} with {@linkplain Comparable} and {@linkplain Serializable }

- * 

- * @see {@link Quantity}

- * @author otaviojava

- * @author werner

- * @param <Q>

- * @version 1.0.1, August 7, 2017

- * @since 0.7

- */

-public interface ComparableQuantity<Q extends Quantity<Q>> extends Quantity<Q>, Comparable<Quantity<Q>>, Serializable {

-

-  /**

-   * @see Quantity#add(Quantity)

-   */

-  ComparableQuantity<Q> add(Quantity<Q> that);

-

-  /**

-   * @see Quantity#subtract(Quantity)

-   */

-  ComparableQuantity<Q> subtract(Quantity<Q> that);

-

-  /**

-   * @see Quantity#divide(Quantity)

-   */

-  ComparableQuantity<?> divide(Quantity<?> that);

-

-  /**

-   * @see Quantity#divide(Number)

-   */

-  ComparableQuantity<Q> divide(Number that);

-

-  /**

-   * @see Quantity#multiply(Quantity)

-   */

-  ComparableQuantity<?> multiply(Quantity<?> multiplier);

-

-  /**

-   * @see Quantity#multiply(Number)

-   */

-  ComparableQuantity<Q> multiply(Number multiplier);

-

-  /**

-   * @see Quantity#inverse()

-   */

-  ComparableQuantity<?> inverse();

-

-  /**

-   * invert and already cast to defined quantityClass

-   * 

-   * @param quantityClass

-   *          Quantity to be converted

-   * @see Quantity#inverse()

-   * @see Quantity#asType(Class)

-   */

-  <T extends Quantity<T>> ComparableQuantity<T> inverse(Class<T> quantityClass);

-

-  /**

-   * @see Quantity#to(Unit)

-   */

-  ComparableQuantity<Q> to(Unit<Q> unit);

-

-  /**

-   * @see Quantity#asType(Class)

-   */

-  <T extends Quantity<T>> ComparableQuantity<T> asType(Class<T> type) throws ClassCastException;

-

-  /**

-   * Compares two instances of {@link Quantity <Q>}. Conversion of unit can happen if necessary

-   *

-   * @param that

-   *          the {@code quantity<Q>} to be compared with this instance.

-   * @return {@code true} if {@code that > this}.

-   * @throws NullPointerException

-   *           if the that is null

-   */

-  boolean isGreaterThan(Quantity<Q> that);

-

-  /**

-   * Compares two instances of {@link Quantity <Q>}, doing the conversion of unit if necessary.

-   *

-   * @param that

-   *          the {@code quantity<Q>} to be compared with this instance.

-   * @return {@code true} if {@code that >= this}.

-   * @throws NullPointerException

-   *           if the that is null

-   */

-  boolean isGreaterThanOrEqualTo(Quantity<Q> that);

-

-  /**

-   * Compares two instances of {@link Quantity <Q>}, doing the conversion of unit if necessary.

-   *

-   * @param that

-   *          the {@code quantity<Q>} to be compared with this instance.

-   * @return {@code true} if {@code that < this}.

-   * @throws NullPointerException

-   *           if the quantity is null

-   */

-  boolean isLessThan(Quantity<Q> that);

-

-  /**

-   * Compares two instances of {@link Quantity <Q>}, doing the conversion of unit if necessary.

-   *

-   * @param that

-   *          the {@code quantity<Q>} to be compared with this instance.

-   * @return {@code true} if {@code that < this}.

-   * @throws NullPointerException

-   *           if the quantity is null

-   */

-  boolean isLessThanOrEqualTo(Quantity<Q> that);

-

-  /**

-   * Compares two instances of {@link Quantity <Q>}, doing the conversion of unit if necessary.

-   *

-   * @param that

-   *          the {@code quantity<Q>} to be compared with this instance.

-   * @return {@code true} if {@code that < this}.

-   * @throws NullPointerException

-   *           if the quantity is null

-   */

-  boolean isEquivalentOf(Quantity<Q> that);

-

-  /**

-   * Multiply and cast the {@link ComparableQuantity}

-   * 

-   * @param that

-   *          quantity to be multiplied

-   * @param asTypeQuantity

-   *          quantity to be converted

-   * @return the QuantityOperations multiplied and converted

-   * @see Quantity#divide(Quantity)

-   * @see Quantity#asType(Class)

-   * @exception NullPointerException

-   */

-  <T extends Quantity<T>, E extends Quantity<E>> ComparableQuantity<E> divide(Quantity<T> that, Class<E> asTypeQuantity);

-

-  /**

-   * Divide and cast the {@link ComparableQuantity}

-   * 

-   * @param that

-   *          quantity to be divided

-   * @param asTypeQuantity

-   *          quantity to be converted

-   * @return the QuantityOperations multiplied and converted

-   * @see QuantityOperations

-   * @see QuantityOperations#of(Quantity, Class)

-   * @see Quantity#asType(Class)

-   * @see Quantity#multiply(Quantity)

-   * @exception NullPointerException

-   */

-  <T extends Quantity<T>, E extends Quantity<E>> ComparableQuantity<E> multiply(Quantity<T> that, Class<E> asTypeQuantity);

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/ComparableUnit.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/ComparableUnit.java
deleted file mode 100644
index 750df2b..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/ComparableUnit.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import java.io.Serializable;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-

-/**

- * Unit specialized for the Java SE platform. It extends {@link Unit} with {@linkplain Comparable} and {@linkplain Serializable }

- * 

- * @see {@link Unit}

- * @author werner

- * @param <Q>

- * @since 0.8

- */

-public interface ComparableUnit<Q extends Quantity<Q>> extends Unit<Q>, Comparable<Unit<Q>>, Serializable {

-

-  /**

-   * Compares two instances of {@link Unit <Q>}, doing the conversion of unit if necessary.

-   *

-   * @param that

-   *          the {@code Unit<Q>} to be compared with this instance.

-   * @return {@code true} if {@code that < this}.

-   * @throws NullPointerException

-   *           if the unit is null

-   */

-  boolean isEquivalentOf(Unit<Q> that);

-

-  /**

-   * Indicates if this unit belongs to the set of coherent SI units (unscaled SI units).

-   * 

-   * The base and coherent derived units of the SI form a coherent set, designated the set of coherent SI units. The word coherent is used here in the

-   * following sense: when coherent units are used, equations between the numerical values of quantities take exactly the same form as the equations

-   * between the quantities themselves. Thus if only units from a coherent set are used, conversion factors between units are never required.

-   * 

-   * @return <code>equals(toSystemUnit())</code>

-   */

-  boolean isSystemUnit();

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/IState.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/IState.java
deleted file mode 100644
index 2ead1e9..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/IState.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Copyright (c) 2005, 2011, Werner Keil, JScience 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Werner Keil - initial API and implementation
- */
-package org.eclipse.uomo.units;
-
-import org.eclipse.uomo.core.IName;
-import javax.measure.Quantity;
-import javax.measure.quantity.Time;
-
-/**
- * Groups a state name, value and timestamp.
- * The state itself is represented as a <type>Number</type> and the time is measured in IMeasure<Time>
- * A State object is immutable so that it may be easily shared.
- * 
- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>
- * @version 1.1, $Date: 2011-04-07 02:02:02 +0430 $
- */
-public interface IState<Q extends Quantity<Q>> extends IName {
-	IMeasure<Time> time();
-	IMeasure<Q> value(); // TODO get* vs. getter-less, also avoid value().value()
-}
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/IndianPrefix.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/IndianPrefix.java
deleted file mode 100644
index 70bab1a..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/IndianPrefix.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import java.math.BigInteger;

-

-import org.eclipse.uomo.units.impl.converter.RationalConverter;

-import javax.measure.Quantity;

-import javax.measure.Unit;

-

-/**

- * Utility class holding prefixes used today in India, Pakistan, Bangladesh, Nepal

- * and Myanmar (Burma); based on grouping by two decimal places, rather than the

- * three decimal places common in most parts of the world. [code] import static

- * org.eclipse.uomo.units.IndianPrefix.*; // Static import. ... Unit<Pressure>

- * LAKH_PASCAL = LAKH(PASCAL);

- * Unit<Length>CRORE_METER = CRORE(METER); [/code]

- * 

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version 1.4 ($Revision: 212 $), $Date: 2010-09-13 23:50:44 +0200 (Mo, 13 Sep 2010) $

- * @see <a

- *      href="http://en.wikipedia.org/wiki/Indian_numbering_system">Wikipedia: Indian numbering system</a>

- * @deprecated use org.eclipse.uomo.units.impl.system.IndianPrefix

- */

-public abstract class IndianPrefix {

-

-	/**

-	 * <p>

-	 * एक (Ek)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor <code>1</code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> EK(Unit<Q> unit) {

-		return unit;

-	}

-

-	/**

-	 * <p>

-	 * दस (Das)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>1</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(10)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> DAS(Unit<Q> unit) {

-		return unit.transform(E1);

-	}

-

-	/**

-	 * <p>

-	 * सौ (Sau)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>2</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(100)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> SAU(Unit<Q> unit) {

-		return unit.transform(E2);

-	}

-

-	/**

-	 * <p>

-	 * सहस्र (Sahasr)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>3</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e3)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> SAHASR(Unit<Q> unit) {

-		return unit.transform(E3);

-	}

-

-	/**

-	 * <p>

-	 * हजार (Hazaar)

-	 * </p>

-	 * Equivalent to {@link #SAHASR}.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> HAZAAR(Unit<Q> unit) {

-		return SAHASR(unit);

-	}

-

-	/**

-	 * <p>

-	 * लाख (Lakh)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>5</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e5)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> LAKH(Unit<Q> unit) {

-		return unit.transform(E5);

-	}

-

-	static final RationalConverter E5 = new RationalConverter(

-			BigInteger.TEN.pow(5), BigInteger.ONE);

-

-	/**

-	 * <p>

-	 * करोड़ (Crore)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>7</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e7)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> CRORE(Unit<Q> unit) {

-		return unit.transform(E7);

-	}

-

-	static final RationalConverter E7 = new RationalConverter(

-			BigInteger.TEN.pow(7), BigInteger.ONE);

-

-	/**

-	 * <p>

-	 * अरब (Arawb)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>9</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e9)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> ARAWB(Unit<Q> unit) {

-		return unit.transform(E9);

-	}

-

-	/**

-	 * <p>

-	 * खरब (Kharawb)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>11</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e11)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> KHARAWB(Unit<Q> unit) {

-		return unit.transform(E11);

-	}

-

-	/**

-	 * <p>

-	 * नील (Neel)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>13</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e13)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> NEEL(Unit<Q> unit) {

-		return unit.transform(E13);

-	}

-

-	/**

-	 * <p>

-	 * पद्म (Padma)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>15</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e15)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> PADMA(Unit<Q> unit) {

-		return unit.transform(E15);

-	}

-

-	/**

-	 * <p>

-	 * शंख (Shankh)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>17</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e17)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> SHANKH(Unit<Q> unit) {

-		return unit.transform(E17);

-	}

-

-	/**

-	 * <p>

-	 * महाशंख (Mahashankh)

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>19</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e19)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> MAHASHANKH(Unit<Q> unit) {

-		return unit.transform(E19);

-	}

-

-	// Holds prefix converters (optimization).

-	private static RationalConverter E19 = new RationalConverter(

-			BigInteger.TEN.pow(19), BigInteger.ONE);

-	private static RationalConverter E17 = new RationalConverter(

-			BigInteger.TEN.pow(17), BigInteger.ONE);

-	private static RationalConverter E15 = new RationalConverter(

-			BigInteger.TEN.pow(15), BigInteger.ONE);

-	private static RationalConverter E13 = new RationalConverter(

-			BigInteger.TEN.pow(13), BigInteger.ONE);

-	private static RationalConverter E11 = new RationalConverter(

-			BigInteger.TEN.pow(11), BigInteger.ONE);

-	private static RationalConverter E9 = new RationalConverter(

-			BigInteger.TEN.pow(9), BigInteger.ONE);

-	private static RationalConverter E3 = new RationalConverter(

-			BigInteger.TEN.pow(3), BigInteger.ONE);

-	private static RationalConverter E2 = new RationalConverter(

-			BigInteger.TEN.pow(2), BigInteger.ONE);

-	private static RationalConverter E1 = new RationalConverter(

-			BigInteger.TEN.pow(1), BigInteger.ONE);

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/Messages.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/Messages.java
deleted file mode 100644
index 6b723d0..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/Messages.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**

- * Copyright (c) 2005, 2011, Werner Keil, Ikayzo 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Ikayzo and others - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import org.eclipse.osgi.util.NLS;

-

-/**

- * Message class for unit messages. These messages are used throughout the

- * package.

- * 

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- */

-public class Messages extends NLS {

-	private static final String BUNDLE_NAME = Messages.class.getPackage()

-			.getName() + ".messages";//$NON-NLS-1$

-

-	private Messages() {

-	}

-

-	static {

-		// load message values from bundle file

-		NLS.initializeMessages(BUNDLE_NAME, Messages.class);

-	}

-	public static String LocalFormat_Pattern;

-	public static String SI_A;

-	public static String SI_At;

-	public static String SI_bit;

-	public static String SI_Bq;

-	public static String SI_C;

-	public static String SI_cd;

-	public static String SI_F;

-	public static String SI_Gy;

-	public static String SI_H;

-	public static String SI_Hz;

-	public static String SI_J;

-	public static String SI_K;

-	public static String SI_kat;

-	public static String SI_kg;

-	public static String SI_kg_name;

-	public static String SI_lm;

-	public static String SI_lx;

-	public static String SI_m;

-	public static String SI_m_name;

-	public static String SI_mol;

-	public static String SI_N;

-	public static String SI_OhmS;

-	public static String SI_Pa;

-	public static String SI_rad;

-	public static String SI_s;

-	public static String SI_S;

-	public static String SI_Sv;

-	public static String SI_sr;

-	public static String SI_T;

-	public static String SI_V;

-	public static String SI_W;

-	public static String SI_Wb;

-	public static String US_lb_name;

-	public static String NonSI_R;

-	public static String NonSI_R_name;

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/QuantityAmount.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/QuantityAmount.java
deleted file mode 100644
index 80b2951..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/QuantityAmount.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/**

- * Copyright (c) 2005, 2014, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import java.math.BigDecimal;

-

-import org.eclipse.uomo.units.impl.QuantityFactoryImpl;

-import org.eclipse.uomo.units.internal.MeasureAmount;

-import javax.measure.quantity.Dimensionless;

-import javax.measure.Quantity;

-import javax.measure.Unit;

-import com.ibm.icu.util.Measure;

-import com.ibm.icu.util.MeasureUnit;

-

-/**

- * An amount of quantity, consisting of a Number and a Unit. QuantityAmount

- * objects are immutable.

- * 

- * @see java.lang.Number

- * @see MeasureUnit

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @param <Q>

- *            The type of the quantity.

- * @version 1.3.4 ($Revision: 212 $), $Date: 2011-09-12 01:20:44 +0200 (Mo, 12

- *          Sep 2011) $ XXX rename to Amount, AbstractAmount or MeasureAmount?

- *          FIXME Bug 338334 overwrite equals()

- * @deprecated use AbstractQuantity

- */

-public abstract class QuantityAmount<Q extends Quantity<Q>>

-		implements IMeasure<Q> {

-	

-	private final Measure measure;

-	private final Unit<Q> unit;

-	

-	/**

-	 * Holds a dimensionless measure of one (exact).

-	 */

-	public static final Quantity<Dimensionless> ONE =

-			QuantityFactoryImpl.getInstance(Dimensionless.class).create(

-					BigDecimal.ONE, AbstractUnit.ONE);

-	

-	@Override

-	public int hashCode() {

-		final int prime = 31;

-		int result = 1;

-		result = prime * result + ((measure == null) ? 0 : measure.hashCode());

-		return result;

-	}

-

-	@Override

-	public boolean equals(Object obj) {

-		if (this == obj)

-			return true;

-		if (obj == null)

-			return false;

-		if (getClass() != obj.getClass())

-			return false;

-		@SuppressWarnings("unchecked")

-		QuantityAmount<Q> other = (QuantityAmount<Q>) obj;

-		if (measure == null) {

-			if (other.measure != null)

-				return false;

-		} else if (!measure.equals(other.measure))

-			return false;

-		return true;

-	}

-

-	@Override

-	public String toString() {

-		return String.valueOf(measure);

-	}

-

-	/**

-	 * Indicates if this measure is exact.

-	 */

-	private boolean isExact;

-

-	/**

-	 * Holds the exact value (when exact) stated in this measure unit.

-	 */

-	// private long _exactValue;

-

-	/**

-	 * Holds the minimum value stated in this measure unit. For inexact

-	 * measures: _minimum < _maximum

-	 */

-	// private double _minimum;

-

-	/**

-	 * Holds the maximum value stated in this measure unit. For inexact

-	 * measures: _maximum > _minimum

-	 */

-	// private double _maximum;

-

-	protected QuantityAmount(Number number, Unit unit, MeasureUnit mUnit) {

-		this.unit = unit;

-		measure = MeasureAmount.of(number, mUnit);

-	}

-	

-	protected QuantityAmount(Number number, Unit unit) {

-		this(number, unit, null);

-	}

-

-	/**

-	 * Returns the <b>ICU4J</b> <type>Measure</type> object.

-	 * @return the backing measure.

-	 */

-	public Measure getMeasure() {

-		return measure;

-	}

-	

-	/*

-	 * (non-Javadoc)

-	 * 

-	 * @see

-	 * org.eclipse.uomo.units.IMeasure#doubleValue(javax.measure.unit

-	 * .Unit)

-	 */

-	@Override

-    public double doubleValue(Unit<Q> unit) {

-        return (internalUnit().equals(unit)) ? value().doubleValue() : unit().getConverterTo(unit).convert(value().doubleValue());

-    }

-

-	/*

-	 * (non-Javadoc)

-	 * 

-	 * @see

-	 * org.eclipse.uomo.units.IMeasure#longValue(javax.measure.unit

-	 * .Unit)

-	 */

-	@Override

-	public long longValue(Unit<Q> unit) {

-        double result = doubleValue(unit);

-        if ((result < Long.MIN_VALUE) || (result > Long.MAX_VALUE)) {

-            throw new ArithmeticException("Overflow (" + result + ")");

-        }

-        return (long) result;

-	}

-

-	/*

-	 * (non-Javadoc)

-	 * 

-	 * @see javax.measure.Quantity#unit()

-	 */

-	@Override

-	public Unit<Q> unit() {

-		return unit;

-	}

-	

-	/*

-	 * (non-Javadoc)

-	 * 

-	 * @see javax.measure.Quantity#value()

-	 */

-	@Override

-	public Number value() {

-		return getNumber();

-	}

-

-	/**

-	 * Indicates if this measure amount is exact. An exact amount is guarantee

-	 * exact only when stated in this measure unit (e.g.

-	 * <code>this.longValue()</code>); stating the amount in any other unit may

-	 * introduce conversion errors.

-	 * 

-	 * @return <code>true</code> if this measure is exact; <code>false</code>

-	 *         otherwise.

-	 */

-	public boolean isExact() {

-		return isExact;

-	}

-	

-	public Number getValue() {

-		return getNumber();

-	}

-	

-	public Unit<Q> getUnit() {

-		return unit();

-	}

-

-	/**

-	 * Get the unit (convenience to avoid cast).

-	 * 

-	 * @provisional This API might change or be removed in a future release.

-	 */

-	private final MeasureUnit internalUnit() {

-		return measure.getUnit();

-	}

-	

-	protected final Number getNumber() {

-		return measure.getNumber();

-	}

-}

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
deleted file mode 100644
index 4b2bc05..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/SI.java
+++ /dev/null
@@ -1,744 +0,0 @@
-/**

- * Copyright (c) 2005, 2011, Werner Keil, JScience 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Jean-Marie Dautelle - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import static org.eclipse.uomo.units.AbstractUnit.ONE;

-

-import java.math.BigInteger;

-import org.eclipse.uomo.units.Messages;

-import org.eclipse.uomo.units.impl.AlternateUnit;

-import org.eclipse.uomo.units.impl.BaseUnit;

-import org.eclipse.uomo.units.impl.ProductUnit;

-import org.eclipse.uomo.units.impl.TransformedUnit;

-import org.eclipse.uomo.units.impl.converter.RationalConverter;

-import javax.measure.spi.SystemOfUnits;

-import javax.measure.Unit;

-import javax.measure.quantity.*;

-

-/**

- * <p>

- * This class contains SI (Système International d'Unités) base units, and

- * derived units.

- * </p>

- * 

- * <p>

- * It also defines an inner class for the 20 SI prefixes used to form decimal

- * multiples and submultiples of SI units. For example:[code] import static

- * org.eclipse.uomo.units.SI.*; // Static import. ... Unit<Pressure> HECTOPASCAL

- * = HECTO(PASCAL); Unit<Length> KILOMETRE = KILO(METRE); [/code]

- * </p>

- * 

- * @noextend This class is not intended to be extended by clients.

- * 

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @version 1.32 ($Revision: 232 $), $Date: 2011-09-11 14:50:08 +0200 $

- * @see <a

- *      href="http://en.wikipedia.org/wiki/International_System_of_Units">Wikipedia:

- *      International System of Units</a>

- */

-public final class SI extends AbstractSystemOfUnits {

-

-	/**

-	 * The singleton instance of {@code SI}.

-	 */

-	private static final SI INSTANCE = new SI();

-

-	/**

-	 * Returns the singleton instance of this class.

-	 * 

-	 * @return the SI (metric) system instance.

-	 */

-	public static final SystemOfUnits getInstance() {

-		return INSTANCE;

-	}

-

-	// //////////////

-	// BASE UNITS //

-	// //////////////

-	/**

-	 * The base unit for electric current quantities (<code>A</code>). The

-	 * Ampere is that constant current which, if maintained in two straight

-	 * parallel conductors of infinite length, of negligible circular

-	 * cross-section, and placed 1 meter apart in vacuum, would produce between

-	 * these conductors a force equal to 2 * 10-7 newton per meter of length. It

-	 * is named after the French physicist Andre Ampere (1775-1836).

-	 */

-	public static final Unit<ElectricCurrent> AMPERE = addUnit(new BaseUnit<ElectricCurrent>(

-			Messages.SI_A));

-

-	/**

-	 * The base unit for luminous intensity quantities (<code>cd</code>). The

-	 * candela is the luminous intensity, in a given direction, of a source that

-	 * emits monochromatic radiation of frequency 540 * 1012 hertz and that has

-	 * a radiant intensity in that direction of 1/683 watt per steradian

-	 * 

-	 * @see <a href="http://en.wikipedia.org/wiki/Candela"> Wikipedia:

-	 *      Candela</a>

-	 */

-	public static final Unit<LuminousIntensity> CANDELA = addUnit(new BaseUnit<LuminousIntensity>(

-			Messages.SI_cd));

-

-	/**

-	 * The base unit for thermodynamic temperature quantities (<code>K</code>).

-	 * The kelvin is the 1/273.16th of the thermodynamic temperature of the

-	 * triple point of water. It is named after the Scottish mathematician and

-	 * physicist William Thomson 1st Lord Kelvin (1824-1907)

-	 */

-	public static final Unit<Temperature> KELVIN = addUnit(new BaseUnit<Temperature>(

-			Messages.SI_K));

-

-	/**

-	 * The base unit for mass quantities (<code>kg</code>). It is the only SI

-	 * unit with a prefix as part of its name and symbol. The kilogram is equal

-	 * to the mass of an international prototype in the form of a

-	 * platinum-iridium cylinder kept at Sevres in France.

-	 * 

-	 * @see #GRAM

-	 */

-	public static final Unit<Mass> KILOGRAM = addUnit(new BaseUnit<Mass>(

-			Messages.SI_kg, Messages.SI_kg_name));

-

-	/**

-	 * The base unit for length quantities (<code>m</code>). One metre was

-	 * redefined in 1983 as the distance traveled by light in a vacuum in

-	 * 1/299,792,458 of a second.

-	 */

-	public static final Unit<Length> METRE = addUnit(new BaseUnit<Length>(

-			Messages.SI_m, Messages.SI_m_name));

-

-	/**

-	 * The base unit for amount of substance quantities (<code>mol</code>). The

-	 * mole is the amount of substance of a system which contains as many

-	 * elementary entities as there are atoms in 0.012 kilogram of carbon 12.

-	 */

-	public static final Unit<AmountOfSubstance> MOLE = addUnit(new BaseUnit<AmountOfSubstance>(

-			Messages.SI_mol));

-

-	/**

-	 * The base unit for time quantities (<code>s</code>). It is defined as the

-	 * duration of 9,192,631,770 cycles of radiation corresponding to the

-	 * transition between two hyperfine levels of the ground state of cesium

-	 * (1967 Standard).

-	 * 

-	 * FIXME this is not aligned with TimeUnit from ICU4J due to TimeUnit so far cannot be extended 

-	 */

-	public static final Unit<Time> SECOND = addUnit(new BaseUnit<Time>(

-			Messages.SI_s));

-	// //////////////////////////////

-	// SI DERIVED ALTERNATE UNITS //

-	// //////////////////////////////

-

-	/**

-	 * The unit for magnetomotive force (<code>At</code>).

-	 */

-	public static final Unit<MagnetomotiveForce> AMPERE_TURN = addUnit(new AlternateUnit<MagnetomotiveForce>(

-			Messages.SI_At, (AbstractUnit<?>) SI.AMPERE));

-

-	/**

-	 * The derived unit for mass quantities (<code>g</code>). The base unit for

-	 * mass quantity is {@link #KILOGRAM}.

-	 */

-	public static final Unit<Mass> GRAM = KILOGRAM.divide(1000);

-

-	/**

-	 * The unit for plane angle quantities (<code>rad</code>). One radian is the

-	 * angle between two radii of a circle such that the length of the arc

-	 * between them is equal to the radius.

-	 */

-	public static final Unit<Angle> RADIAN = addUnit(new AlternateUnit<Angle>(

-			Messages.SI_rad, AbstractUnit.ONE));

-

-	/**

-	 * The unit for solid angle quantities (<code>sr</code>). One steradian is

-	 * the solid angle subtended at the center of a sphere by an area on the

-	 * surface of the sphere that is equal to the radius squared. The total

-	 * solid angle of a sphere is 4*Pi steradians.

-	 */

-	public static final Unit<SolidAngle> STERADIAN = addUnit(new AlternateUnit<SolidAngle>(

-			Messages.SI_sr, AbstractUnit.ONE));

-

-	/**

-	 * The derived unit for frequency (<code>Hz</code>). A unit of frequency

-	 * equal to one cycle per second. After Heinrich Rudolf Hertz (1857-1894),

-	 * German physicist who was the first to produce radio waves artificially.

-	 */

-	public static final Unit<Frequency> HERTZ = addUnit(new AlternateUnit<Frequency>(

-			Messages.SI_Hz,

-			(AbstractUnit<?>) AbstractUnit.ONE.divide(SECOND)));

-

-	/**

-	 * The derived unit for force (<code>N</code>). One newton is the force

-	 * required to give a mass of 1 kilogram an Force of 1 metre per second per

-	 * second. It is named after the English mathematician and physicist Sir

-	 * Isaac Newton (1642-1727).

-	 */

-	public static final Unit<Force> NEWTON = addUnit(new AlternateUnit<Force>(

-			Messages.SI_N, (AbstractUnit<?>) METRE.multiply(KILOGRAM)

-					.divide(SECOND.pow(2))));

-

-	/**

-	 * The derived unit for pressure, stress (<code>Pa</code>). One pascal is

-	 * equal to one newton per square meter. It is named after the French

-	 * philosopher and mathematician Blaise Pascal (1623-1662).

-	 */

-	public static final Unit<Pressure> PASCAL = addUnit(new AlternateUnit<Pressure>(

-			Messages.SI_Pa, (AbstractUnit<?>) NEWTON.divide(METRE.pow(2))));

-

-	/**

-	 * The derived unit for energy, work, quantity of heat (<code>J</code>). One

-	 * joule is the amount of work done when an applied force of 1 newton moves

-	 * through a distance of 1 metre in the direction of the force. It is named

-	 * after the English physicist James Prescott Joule (1818-1889).

-	 */

-	public static final Unit<Energy> JOULE = addUnit(new AlternateUnit<Energy>(

-			Messages.SI_J, (AbstractUnit<?>) NEWTON.multiply(METRE)));

-

-	/**

-	 * The derived unit for power, radiant, flux (<code>W</code>). One watt is

-	 * equal to one joule per second. It is named after the British scientist

-	 * James Watt (1736-1819).

-	 */

-	public static final Unit<Power> WATT = addUnit(new AlternateUnit<Power>(

-			Messages.SI_W, (AbstractUnit<?>) JOULE.divide(SECOND)));

-

-	/**

-	 * The derived unit for electric charge, quantity of electricity (

-	 * <code>C</code>). One Coulomb is equal to the quantity of charge

-	 * transferred in one second by a steady current of one ampere. It is named

-	 * after the French physicist Charles Augustin de Coulomb (1736-1806).

-	 */

-	public static final Unit<ElectricCharge> COULOMB = addUnit(new AlternateUnit<ElectricCharge>(

-			Messages.SI_C, (AbstractUnit<?>) SECOND.multiply(AMPERE)));

-

-	/**

-	 * The derived unit for electric potential difference, electromotive force (

-	 * <code>V</code>). One Volt is equal to the difference of electric

-	 * potential between two points on a conducting wire carrying a constant

-	 * current of one ampere when the power dissipated between the points is one

-	 * watt. It is named after the Italian physicist Count Alessandro Volta

-	 * (1745-1827).

-	 */

-	public static final Unit<ElectricPotential> VOLT = addUnit(new AlternateUnit<ElectricPotential>(

-			Messages.SI_V, (AbstractUnit<?>) WATT.divide(AMPERE)));

-

-	/**

-	 * The derived unit for capacitance (<code>F</code>). One Farad is equal to

-	 * the capacitance of a capacitor having an equal and opposite charge of 1

-	 * coulomb on each plate and a potential difference of 1 volt between the

-	 * plates. It is named after the British physicist and chemist Michael

-	 * Faraday (1791-1867).

-	 */

-	public static final Unit<ElectricCapacitance> FARAD = addUnit(new AlternateUnit<ElectricCapacitance>(

-			Messages.SI_F, (AbstractUnit<?>) COULOMB.divide(VOLT)));

-

-	/**

-	 * The derived unit for electric resistance (<code>Ohm</code>). One Ohm is

-	 * equal to the resistance of a conductor in which a current of one ampere

-	 * is produced by a potential of one volt across its terminals. It is named

-	 * after the German physicist Georg Simon Ohm (1789-1854).

-	 */

-	public static final Unit<ElectricResistance> OHM = addUnit(new AlternateUnit<ElectricResistance>(

-			Messages.SI_OhmS, (AbstractUnit<?>) VOLT.divide(AMPERE)));

-

-	/**

-	 * The derived unit for electric conductance (<code>S</code>). One Siemens

-	 * is equal to one ampere per volt. It is named after the German engineer

-	 * Ernst Werner von Siemens (1816-1892).

-	 */

-	public static final Unit<ElectricConductance> SIEMENS = addUnit(new AlternateUnit<ElectricConductance>(

-			Messages.SI_S, (AbstractUnit<?>) AMPERE.divide(VOLT)));

-

-	/**

-	 * The derived unit for magnetic flux (<code>Wb</code>). One Weber is equal

-	 * to the magnetic flux that in linking a circuit of one turn produces in it

-	 * an electromotive force of one volt as it is uniformly reduced to zero

-	 * within one second. It is named after the German physicist Wilhelm Eduard

-	 * Weber (1804-1891).

-	 */

-	public static final Unit<MagneticFlux> WEBER = addUnit(new AlternateUnit<MagneticFlux>(

-			Messages.SI_Wb, (AbstractUnit<?>) VOLT.multiply(SECOND)));

-

-	/**

-	 * The derived unit for magnetic flux density (<code>T</code>). One Tesla is

-	 * equal equal to one weber per square metre. It is named after the

-	 * Serbian-born American electrical engineer and physicist Nikola Tesla

-	 * (1856-1943).

-	 */

-	public static final Unit<MagneticFluxDensity> TESLA = addUnit(new AlternateUnit<MagneticFluxDensity>(

-			Messages.SI_T, (AbstractUnit<?>) WEBER.divide(METRE.pow(2))));

-

-	/**

-	 * The derived unit for inductance (<code>H</code>). One Henry is equal to

-	 * the inductance for which an induced electromotive force of one volt is

-	 * produced when the current is varied at the rate of one ampere per second.

-	 * It is named after the American physicist Joseph Henry (1791-1878).

-	 */

-	public static final Unit<ElectricInductance> HENRY = addUnit(new AlternateUnit<ElectricInductance>(

-			Messages.SI_H, (AbstractUnit<?>) WEBER.divide(AMPERE)));

-

-	/**

-	 * The derived unit for Celsius temperature (<code>Cel</code>). This is a

-	 * unit of temperature such as the freezing point of water (at one

-	 * atmosphere of pressure) is 0 Cel, while the boiling point is 100 Cel.

-	 */

-	public static final Unit<Temperature> CELSIUS = addUnit(KELVIN.add(273.15));

-

-	/**

-	 * The derived unit for luminous flux (<code>lm</code>). One Lumen is equal

-	 * to the amount of light given out through a solid angle by a source of one

-	 * candela intensity radiating equally in all directions.

-	 */

-	public static final Unit<LuminousFlux> LUMEN = addUnit(new AlternateUnit<LuminousFlux>(

-			Messages.SI_lm, (AbstractUnit<?>) CANDELA.multiply(STERADIAN)));

-

-	/**

-	 * The derived unit for illuminance (<code>lx</code>). One Lux is equal to

-	 * one lumen per square metre.

-	 */

-	public static final Unit<Illuminance> LUX = addUnit(new AlternateUnit<Illuminance>(

-			Messages.SI_lx, (AbstractUnit<?>) LUMEN.divide(METRE.pow(2))));

-

-	/**

-	 * The derived unit for activity of a radionuclide (<code>Bq</code>). One

-	 * 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<Radioactivity> BECQUEREL = addUnit(new AlternateUnit<Radioactivity>(

-			Messages.SI_Bq,

-			(AbstractUnit<?>) AbstractUnit.ONE.divide(SECOND)));

-

-	/**

-	 * The derived unit for absorbed dose, specific energy (imparted), kerma (

-	 * <code>Gy</code>). One gray is equal to the dose of one joule of energy

-	 * absorbed per one kilogram of matter. It is named after the British

-	 * physician L. H. Gray (1905-1965).

-	 */

-	public static final Unit<RadiationDoseAbsorbed> GRAY = addUnit(new AlternateUnit<RadiationDoseAbsorbed>(

-			Messages.SI_Gy, (AbstractUnit<?>) JOULE.divide(KILOGRAM)));

-

-	/**

-	 * The derived unit for dose equivalent (<code>Sv</code>). One Sievert is

-	 * equal is equal to the actual dose, in grays, multiplied by a

-	 * "quality factor" which is larger for more dangerous forms of radiation.

-	 * It is named after the Swedish physicist Rolf Sievert (1898-1966).

-	 */

-	public static final Unit<RadiationDoseEffective> SIEVERT = addUnit(new AlternateUnit<RadiationDoseEffective>(

-			Messages.SI_Sv, (AbstractUnit<?>) JOULE.divide(KILOGRAM)));

-

-	/**

-	 * The derived unit for catalytic activity (<code>kat</code>).

-	 */

-	public static final Unit<CatalyticActivity> KATAL = addUnit(new AlternateUnit<CatalyticActivity>(

-			Messages.SI_kat, (AbstractUnit<?>) MOLE.divide(SECOND)));

-	// ////////////////////////////

-	// SI DERIVED PRODUCT UNITS //

-	// ////////////////////////////

-

-	/**

-	 * The metric unit for Speed quantities (<code>m/s</code>).

-	 * 

-	 */

-	public static final Unit<Speed> METRES_PER_SECOND = addUnit(new ProductUnit<Speed>(

-			(AbstractUnit<?>) METRE.divide(SECOND)));

-

-	/**

-	 * The metric unit for acceleration quantities (<code>m/s2</code>).

-	 */

-	public static final Unit<Acceleration> METRES_PER_SQUARE_SECOND = addUnit(new ProductUnit<Acceleration>(

-			(AbstractUnit<?>) METRES_PER_SECOND.divide(SECOND)));

-

-	/**

-	 * The metric unit for area quantities (<code>m2</code>).

-	 */

-	public static final Unit<Area> SQUARE_METRE = addUnit(new ProductUnit<Area>(

-			(AbstractUnit<?>) METRE.multiply(METRE)));

-

-	/**

-	 * The metric unit for volume quantities (<code>m3</code>).

-	 */

-	public static final Unit<Volume> CUBIC_METRE = addUnit(new ProductUnit<Volume>(

-			(AbstractUnit<?>) SQUARE_METRE.multiply(METRE)));

-

-    /////////////////////////////////////////////////////////////////

-	// Units outside the SI that are accepted for use with the SI. //

-	/////////////////////////////////////////////////////////////////

-

-	/**

-	* A dimensionless unit accepted for use with SI units (standard name <code>%</code>).

-	*/

-	public static final TransformedUnit<Dimensionless> PERCENT

-	= new TransformedUnit<Dimensionless>(ONE, new RationalConverter(1, 100));

-	

-	// //////////

-	// Others //

-	// //////////

-	/**

-	 * A unit used to measure the ionizing ability of radiation (standard name

-	 * <code>Roentgen</code>).

-	 */

-	@SuppressWarnings("unchecked")

-	public static final Unit<IonizingRadiation> ROENTGEN = (Unit<IonizingRadiation>) addUnit(COULOMB.divide(KILOGRAM)

-			.multiply(2.58e-4), Messages.NonSI_R_name);

-	

-	public static class Prefix {

-

-		private Prefix() {

-			// Utility class no visible constructor.

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>24</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e24)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> YOTTA(Unit<Q> unit) {

-			return unit.transform(E24);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>21</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e21)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> ZETTA(Unit<Q> unit) {

-			return unit.transform(E21);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>18</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e18)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> EXA(Unit<Q> unit) {

-			return unit.transform(E18);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>15</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e15)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> PETA(Unit<Q> unit) {

-			return (AbstractUnit<Q>) unit.transform(E15);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>12</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e12)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> TERA(Unit<Q> unit) {

-			return unit.transform(E12);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>9</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e9)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> GIGA(Unit<Q> unit) {

-			return unit.transform(E9);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>6</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e6)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> MEGA(Unit<Q> unit) {

-			return unit.transform(E6);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>3</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e3)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> KILO(Unit<Q> unit) {

-			return unit.transform(E3);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>2</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e2)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> HECTO(AbstractUnit<Q> unit) {

-			return unit.transform(E2);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>1</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e1)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> DEKA(AbstractUnit<Q> unit) {

-			return unit.transform(E1);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>-1</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e-1)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> DECI(Unit<Q> unit) {

-			return unit.transform(Em1);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>-2</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e-2)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> CENTI(Unit<Q> unit) {

-			return unit.transform(Em2);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>-3</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e-3)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> MILLI(Unit<Q> unit) {

-			return unit.transform(Em3);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>-6</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e-6)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> MICRO(Unit<Q> unit) {

-			return unit.transform(Em6);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>-9</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e-9)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> NANO(Unit<Q> unit) {

-			return unit.transform(Em9);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>-12</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e-12)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> PICO(Unit<Q> unit) {

-			return unit.transform(Em12);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>-15</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e-15)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> FEMTO(Unit<Q> unit) {

-			return unit.transform(Em15);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>-18</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e-18)</code>.

-		 */

-		public static final <Q extends Quantity<Q>> Unit<Q> ATTO(Unit<Q> unit) {

-			return unit.transform(Em18);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>-21</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e-21)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> ZEPTO(AbstractUnit<Q> unit) {

-			return unit.transform(Em21);

-		}

-

-		/**

-		 * Returns the specified unit multiplied by the factor

-		 * <code>10<sup>-24</sup></code>

-		 * 

-		 * @param <Q>

-		 *            The type of the quantity measured by the unit.

-		 * @param unit

-		 *            any unit.

-		 * @return <code>unit.times(1e-24)</code>.

-		 */

-		public static <Q extends Quantity<Q>> Unit<Q> YOCTO(AbstractUnit<Q> unit) {

-			return unit.transform(Em24);

-		}

-

-		// Holds prefix converters (optimization).

-		private static final RationalConverter E24 = new RationalConverter(

-				BigInteger.TEN.pow(24), BigInteger.ONE);

-

-		private static final RationalConverter E21 = new RationalConverter(

-				BigInteger.TEN.pow(21), BigInteger.ONE);

-

-		private static final RationalConverter E18 = new RationalConverter(

-				BigInteger.TEN.pow(18), BigInteger.ONE);

-

-		private static final RationalConverter E15 = new RationalConverter(

-				BigInteger.TEN.pow(15), BigInteger.ONE);

-

-		private static final RationalConverter E12 = new RationalConverter(

-				BigInteger.TEN.pow(12), BigInteger.ONE);

-

-		private static final RationalConverter E9 = new RationalConverter(

-				BigInteger.TEN.pow(9), BigInteger.ONE);

-

-		private static final RationalConverter E6 = new RationalConverter(

-				BigInteger.TEN.pow(6), BigInteger.ONE);

-

-		private static final RationalConverter E3 = new RationalConverter(

-				BigInteger.TEN.pow(3), BigInteger.ONE);

-

-		private static final RationalConverter E2 = new RationalConverter(

-				BigInteger.TEN.pow(2), BigInteger.ONE);

-

-		private static final RationalConverter E1 = new RationalConverter(

-				BigInteger.TEN.pow(1), BigInteger.ONE);

-

-		private static final RationalConverter Em1 = new RationalConverter(

-				BigInteger.ONE, BigInteger.TEN.pow(1));

-

-		private static final RationalConverter Em2 = new RationalConverter(

-				BigInteger.ONE, BigInteger.TEN.pow(2));

-

-		private static final RationalConverter Em3 = new RationalConverter(

-				BigInteger.ONE, BigInteger.TEN.pow(3));

-

-		private static final RationalConverter Em6 = new RationalConverter(

-				BigInteger.ONE, BigInteger.TEN.pow(6));

-

-		private static final RationalConverter Em9 = new RationalConverter(

-				BigInteger.ONE, BigInteger.TEN.pow(9));

-

-		private static final RationalConverter Em12 = new RationalConverter(

-				BigInteger.ONE, BigInteger.TEN.pow(12));

-

-		private static final RationalConverter Em15 = new RationalConverter(

-				BigInteger.ONE, BigInteger.TEN.pow(15));

-

-		private static final RationalConverter Em18 = new RationalConverter(

-				BigInteger.ONE, BigInteger.TEN.pow(18));

-

-		private static final RationalConverter Em21 = new RationalConverter(

-				BigInteger.ONE, BigInteger.TEN.pow(21));

-

-		private static final RationalConverter Em24 = new RationalConverter(

-				BigInteger.ONE, BigInteger.TEN.pow(24));

-	}

-

-	@Override

-	public String getName() {

-		return getClass().getSimpleName();

-	}

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/SymbolMap.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/SymbolMap.java
deleted file mode 100644
index e95cc5e..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/SymbolMap.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Eric Russell - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import org.eclipse.uomo.units.impl.system.USCustomary;

-import javax.measure.Unit;

-import javax.measure.UnitConverter;

-

-/**

- * <p> This interface provides a set of mappings between

- *     {@link Unit Units} and symbols (both ways),

- *     and from {@link javax.measure.UnitConverter

- *     UnitConverter}s to prefixes symbols (also both ways).</p>

- *     

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author Eric Russell

- * @author  <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version 1.2 , $Date: 2017-12-25 $

- */

-public interface SymbolMap {

-

-    /**

-     * Attaches a label to the specified unit. For example:[code]

-     *    symbolMap.label(DAY.multiply(365), "year");

-     *    symbolMap.label({@link USCustomary USCustomary}.FOOT, "ft");

-     * [/code]

-     *

-     * @param unit the unit to label.

-     * @param symbol the new symbol for the unit.

-     * @throws UnsupportedOperationException if setting a unit label

-     *         is not allowed.

-     */

-    void label(Unit<?> unit, String symbol);

-

-    /**

-     * Attaches an alias to the specified unit. Multiple aliases may be

-     * attached to the same unit. Aliases are used during parsing to

-     * recognize different variants of the same unit.[code]

-     *     symbolMap.alias({@link USCustomary USCustomary}.FOOT, "foot");

-     *     symbolMap.alias({@link USCustomary USCustomary}.FOOT, "feet");

-     *     symbolMap.alias({@link SI SI}.METRE, "meter");

-     *     symbolMap.alias({@link SI SI}.METRE, "metre");

-     * [/code]

-     *

-     * @param unit the unit to label.

-     * @param symbol the new symbol for the unit.

-     * @throws UnsupportedOperationException if setting a unit alias

-     *         is not allowed.

-     */

-    void alias(Unit<?> unit, String symbol);

-

-    /**

-     * Attaches a label to the specified prefix. For example:[code]

-     *    symbolMap.prefix(new RationalConverter(1000000000, 1), "G"); // GIGA

-     *    symbolMap.prefix(new RationalConverter(1, 1000000), "µ"); // MICRO

-     * [/code]

-     *

-     * @param cvtr the unit converter.

-     * @param prefix the prefix for the converter.

-     * @throws UnsupportedOperationException if setting a prefix

-     *         is not allowed.

-     */

-    void prefix(UnitConverter cvtr, String prefix);

-

-    /**

-     * Returns the unit for the specified symbol.

-     *

-     * @param symbol the symbol.

-     * @return the corresponding unit or <code>null</code> if none.

-     */

-    Unit<?> getUnit(String symbol);

-

-    /**

-     * Returns the symbol (label) for the specified unit.

-     *

-     * @param unit the corresponding symbol.

-     * @return the corresponding symbol or <code>null</code> if none.

-     */

-    String getSymbol(Unit<?> unit);

-

-    /**

-     * Returns the unit converter for the specified prefix.

-     *

-     * @param prefix the prefix symbol.

-     * @return the corresponding converter or <code>null</code> if none.

-     */

-    UnitConverter getConverter(String prefix);

-

-    /**

-     * Returns the prefix for the specified converter.

-     *

-     * @param converter the unit converter.

-     * @return the corresponding prefix or <code>null</code> if none.

-     */

-    String getPrefix(UnitConverter converter);

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/TamilPrefix.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/TamilPrefix.java
deleted file mode 100644
index 42ca79b..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/TamilPrefix.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units;

-

-import java.math.BigInteger;

-

-import org.eclipse.uomo.units.impl.converter.RationalConverter;

-import javax.measure.Quantity;

-import javax.measure.Unit;

-

-

-/**

- * Utility class holding prefixes used today in parts of India and Sri Lanka;

- * based on grouping by two decimal places, rather than the

- * three decimal places common in most parts of the world.</br><code> import static

- * org.eclipse.uomo.units.TamilPrefix.*; // Static import. ... Unit<Pressure>

- * ONDRU_PASCAL = ONDRU(PASCAL); 

- * Unit<Length> PATHU_METER = PATHU(METER); </code>

- * 

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version 1.2 ($Revision$), $Date: 2012-04-02 $

- * @see <a

- *      href="http://en.wikipedia.org/wiki/Tamil_units_of_measurement#Whole_numbers">Wikipedia:

- *      Tamil units of measurement - Whole numbers</a>

- * @deprecated use org.eclipse.uomo.units.impl.system.TamilPrefix

- */

-public abstract class TamilPrefix  {

-

-	/**

-	 * <p>

-	 * onRu

-	 * </p>

-	 * Returns the specified unit multiplied by the factor <code>1</code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> onRu(Unit<Q> unit) {

-		return unit;

-	}

-	

-	/**

-	 * <p>

-	 * patthu

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>1</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(10)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> patthu(Unit<Q> unit) {

-		return unit.transform(E1);

-	}

-

-	/**

-	 * <p>

-	 * nooRu

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>2</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(100)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> nooRu(Unit<Q> unit) {

-		return unit.transform(E2);

-	}

-

-	/**

-	 * <p>

-	 * aayiram

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>3</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e3)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> aayiram(Unit<Q> unit) {

-		return unit.transform(E3);

-	}

-

-	/**

-	 * <p>

-	 * nooRaayiram

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>5</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e5)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> nooRaayiram(Unit<Q> unit) {

-		return unit.transform(E5);

-	}

-

-	static final RationalConverter E5 = new RationalConverter(

-			BigInteger.TEN.pow(5), BigInteger.ONE);

-

-	/**

-	 * <p>

-	 * thoLLunn

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>9</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e9)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> thoLLunn(Unit<Q> unit) {

-		return unit.transform(E9);

-	}

-

-	/**

-	 * <p>

-	 * eegiyam

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>12</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e12)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> eegiyam(Unit<Q> unit) {

-		return unit.transform(E12);

-	}

-

-	/**

-	 * <p>

-	 * neLai

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>15</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e15)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> neLai(Unit<Q> unit) {

-		return unit.transform(E15);

-	}

-

-	/**

-	 * <p>

-	 * iLanji

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>18</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e18)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> iLanji(Unit<Q> unit) {

-		return unit.transform(E18);

-	}

-

-	/**

-	 * <p>

-	 * veLLam

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>20</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e20)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> veLLam(Unit<Q> unit) {

-		return unit.transform(E20);

-	}

-	

-	/**

-	 * <p>

-	 * aambal

-	 * </p>

-	 * Returns the specified unit multiplied by the factor

-	 * <code>10<sup>21</sup></code>

-	 * 

-	 * @param unit

-	 *            any unit.

-	 * @return <code>unit.times(1e21)</code>.

-	 */

-	public static final <Q extends Quantity<Q>> Unit<Q> aambal(Unit<Q> unit) {

-		return unit.transform(E21);

-	}

-	

-	public static final class Sanskrit {

-		/**

-		 * <p>

-		 * ONDRU -one

-		 * </p>

-		 * Sanskrit translation for {@link #onRu}.

-		 */

-		public static final <Q extends Quantity<Q>> Unit<Q> ONDRU (Unit<Q> unit) {

-			return onRu(unit);

-		}

-		

-		/**

-		 * <p>

-		 * PATHU -ten

-		 * </p>

-		 * Sanskrit translation for {@link #patthu}.

-		 */

-		public static final <Q extends Quantity<Q>> Unit<Q> PATHU(Unit<Q> unit) {

-			return patthu(unit);

-		}

-	}

-

-	// Holds prefix converters (optimization).

-	private static RationalConverter E21 = new RationalConverter(

-			BigInteger.TEN.pow(21), BigInteger.ONE);

-	private static RationalConverter E20 = new RationalConverter(

-			BigInteger.TEN.pow(20), BigInteger.ONE);

-	private static RationalConverter E18 = new RationalConverter(

-			BigInteger.TEN.pow(18), BigInteger.ONE);

-	private static RationalConverter E15 = new RationalConverter(

-			BigInteger.TEN.pow(15), BigInteger.ONE);

-	private static RationalConverter E12 = new RationalConverter(

-			BigInteger.TEN.pow(12), BigInteger.ONE);

-	private static RationalConverter E9 = new RationalConverter(

-			BigInteger.TEN.pow(9), BigInteger.ONE);

-	private static RationalConverter E3 = new RationalConverter(

-			BigInteger.TEN.pow(3), BigInteger.ONE);

-	private static RationalConverter E2 = new RationalConverter(

-			BigInteger.TEN.pow(2), BigInteger.ONE);

-	private static RationalConverter E1 = new RationalConverter(

-			BigInteger.TEN.pow(1), BigInteger.ONE);

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/AbstractQuantityFactory.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/AbstractQuantityFactory.java
deleted file mode 100644
index d31454a..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/AbstractQuantityFactory.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import java.util.HashMap;

-import java.util.Map;

-import java.util.logging.Level;

-import java.util.logging.Logger;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-import javax.measure.spi.QuantityFactory;

-

-/**

- * An abstract factory producing simple quantities instances (tuples {@link Number}/ {@link Unit}).

- *

- * For example:<br>

- * <code>

- *      Mass m = QuantityFactoryImpl.of(Mass.class).create(23.0, KILOGRAM); // 23.0 kg<br>

- *      Time m = QuantityFactoryImpl.of(Time.class).create(124, MILLI(SECOND)); // 124 ms

- * </code>

- * 

- * @param <Q>

- *          The type of the quantity.

- *

- * @author <a href="mailto:martin.desruisseaux@geomatys.com">Martin Desruisseaux</a>

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @version 1.0.0, $Date: 2017-06-16 $

- * @since 0.7

- */

-abstract class AbstractQuantityFactory<Q extends Quantity<Q>> implements QuantityFactory<Q> {

-

-  /**

-   * Holds the current instances.

-   */

-  @SuppressWarnings("rawtypes")

-  static final Map<Class, QuantityFactory> INSTANCES = new HashMap<Class, QuantityFactory>();

-

-  static final Logger logger = Logger.getLogger(AbstractQuantityFactory.class.getName());

-

-  static final Level LOG_LEVEL = Level.FINE;

-

-  /**

-   * Overrides the default implementation of the factory for the specified quantity type.

-   *

-   * @param <Q>

-   *          The type of the quantity

-   * @param type

-   *          the quantity type

-   * @param factory

-   *          the quantity factory

-   */

-  protected static <Q extends Quantity<Q>> void setInstance(final Class<Q> type, QuantityFactory<Q> factory) {

-    if (!Quantity.class.isAssignableFrom(type))

-      // This exception is not documented because it should never happen

-      // if the

-      // user don't try to trick the Java generic types system with unsafe

-      // cast.

-      throw new ClassCastException();

-    INSTANCES.put(type, factory);

-  }

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/AlternateUnit.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/AlternateUnit.java
deleted file mode 100644
index 76524fd..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/AlternateUnit.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil and others - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import org.eclipse.uomo.units.AbstractConverter;

-import org.eclipse.uomo.units.AbstractUnit;

-import javax.measure.Quantity;

-

-import java.util.Map;

-

-import javax.measure.Dimension;

-import javax.measure.Unit;

-import javax.measure.UnitConverter;

-

-

-/**

- * <p> This class represents metric units used in expressions to distinguish

- *     between quantities of a different nature but of the same dimensions.

- *     Alternate units are always unscaled metric units.</p>

- *

- * <p> Instances of this class are created through the

- *     {@link AbstractUnit#alternate(String)} method.</p>

- *

- * @param <Q> The type of the quantity measured by this unit.

- *

- * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @version 1.2, $Date: 2017-12-21 $

- */

-public final class AlternateUnit<Q extends Quantity<Q>> extends AbstractUnit<Q> {

-

-    /** The serialVersionUID */

-    private static final long serialVersionUID = -1234567854321234567L;

-

-	/**

-     * Holds the parent unit (a system unit).

-     */

-    private final Unit<?> parent;

-

-    /**

-     * Holds the parent unit (a system unit).

-     */

-    private final String symbol;

-

-    /**

-     * Creates an alternate unit for the specified unit identified by the

-     * specified name and symbol.

-     *

-     * @param symbol the symbol for this alternate unit.

-     * @param parent the system unit from which this alternate unit is

-     *        derived.

-     * @throws UnsupportedOperationException if the parent is not

-     *         an unscaled metric unit.

-     * @throws IllegalArgumentException if the specified symbol is

-     *         associated to a different unit.

-     */

-    @SuppressWarnings("rawtypes")

-	public AlternateUnit(Unit<?> parent, String symbol) {

-	this((AbstractUnit)parent, symbol);

-    }

-    

-    

-    /**

-     * Creates an alternate unit for the specified unit identified by the

-     * specified name and symbol.

-     *

-     * @param symbol the symbol for this alternate unit.

-     * @param parent the system unit from which this alternate unit is

-     *        derived.

-     * @throws UnsupportedOperationException if the parent is not

-     *         an unscaled metric unit.

-     * @throws IllegalArgumentException if the specified symbol is

-     *         associated to a different unit.

-     */

-    public AlternateUnit(AbstractUnit<?> parent, String symbol) {

-        if (parent == null || !parent.isUnscaledMetric())

-            throw new UnsupportedOperationException(parent + " is not an unscaled metric unit");

-        this.parent = parent;

-        this.symbol = symbol;

-        // Checks if the symbol is associated to a different unit.

-        synchronized (AbstractUnit.SYMBOL_TO_UNIT) {

-            AbstractUnit<?> unit = (AbstractUnit<?>) AbstractUnit.SYMBOL_TO_UNIT.get(symbol);

-            if (unit == null) {

-                AbstractUnit.SYMBOL_TO_UNIT.put(symbol, this);

-                return;

-            }

-            if (unit instanceof AlternateUnit<?>) {

-                AlternateUnit<?> existingUnit = (AlternateUnit<?>) unit;

-                if (symbol.equals(existingUnit.getSymbol()) && this.parent.equals(existingUnit.parent))

-                    return; // OK, same unit.

-            }

-            throw new IllegalArgumentException("Symbol " + symbol + " is associated to a different unit");

-        }

-    }

-

-    @Override

-    public String getSymbol() {

-        return symbol;

-    }

-    

-	@Override

-	public Unit<Q> getSystemUnit() {

-		return toMetric();

-	}

-	

-    @Override

-    protected final AbstractUnit<Q> toMetric() {

-        return this;

-    }

-

-    @Override

-    public final UnitConverter getConverterToMetric() {

-        return AbstractConverter.IDENTITY;

-    }

-

-    @Override

-    public boolean equals(Object that) {

-        if (this == that)

-            return true;

-        if (!(that instanceof AlternateUnit<?>))

-            return false;

-        AlternateUnit<?> thatUnit = (AlternateUnit<?>) that;

-        return this.symbol.equals(thatUnit.symbol); // Symbols are unique.

-    }

-

-    @Override

-    public Dimension getDimension() {

-        return parent.getDimension();

-    }

-

-    @SuppressWarnings("rawtypes")

-	@Override

-    public UnitConverter getDimensionalTransform() {

-        return ((AbstractUnit)parent).getDimensionalTransform();

-    }

-

-    @Override

-    public Map<? extends Unit<?>, Integer> getBaseUnits() {

-      return parent.getBaseUnits();

-    }

-    

-    @Override

-    public int hashCode() {

-        return symbol.hashCode();

-    }

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/AnnotatedUnit.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/AnnotatedUnit.java
deleted file mode 100644
index c67de6b..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/AnnotatedUnit.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2005, 2017, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Werner Keil and others - initial API and implementation
- */
-package org.eclipse.uomo.units.impl;
-
-import java.util.Map;
-
-import org.eclipse.uomo.units.AbstractUnit;
-import javax.measure.Quantity;
-import javax.measure.Unit;
-import javax.measure.UnitConverter;
-
-/**
- * <p> This class represents an annotated unit. It  allows for unit specialization
- *     and annotation without changing the unit semantic. For example:[code]
- *        public class Size implements Length {
- *             private double meters;
- *             ...
- *             public static class Unit extends AnnotatedUnit<Length> {
- *                  private Unit(org.unitsofmeasure.Unit<Length> realUnit, String annotation) {
- *                      super(actualUnit, annotation);
- *                  }
- *                  public static Size.Unit METER = new Size.Unit(SI.METRE, "size"); // Equivalent to SI.METRE
- *                  public static Size.Unit INCH = new Size.Unit(NonSI.INCH, "size"); // Equivalent to NonSI.INCH
- *             }
- *        }[/code]</p>
- * <p> Annotation are often written between curly braces behind units
- *     but they do not change, for example "%{vol}", "kg{total}", or
- *     "{RBC}" (for "red blood cells") are equivalent to "%", "kg", and "1"
- *      respectively.</p>
- *
- * <p><b>Note:</b> This class supports the {@code UnitFormat} implementation {@code LocalFormat}, 
- * hence it is currently part of the internal format API. If required and made public, it's possible
- * to locate in the "unit" package.</p>    
- *
- * @param <Q> The type of the quantity measured by this unit.
- *
- * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
- * @author  <a href="mailto:units@catmedia.us">Werner Keil</a>
- * @version 1.2, $Date: 2017-12-25 $
- */
-public class AnnotatedUnit<Q extends Quantity<Q>> extends AbstractUnit<Q> {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Holds the annotation.
-     */
-    private final String annotation;
-
-    /**
-     * Holds the actual unit, never an annotated unit.
-     */
-    private final AbstractUnit<Q> actualUnit;
-
-    public AbstractUnit<Q> getActualUnit() {
-		return actualUnit;
-	}
-
-	/**
-     * Creates an annotated unit for the specified unit.
-     *
-     * @param actualUnit the real unit.
-     * @param annotation the annotation.
-     */
-    public AnnotatedUnit(AbstractUnit<Q> actualUnit, String annotation) {
-        this.actualUnit = (actualUnit instanceof AnnotatedUnit<?>)
-                ? ((AnnotatedUnit<Q>) actualUnit).actualUnit : actualUnit;
-        this.annotation = annotation;
-    }
-
-    /**
-     * Returns an annotated unit equivalent to this unit. The annotation
-     * does not change the unit semantic.
-     * Annotation are often written between curly braces behind units.
-     * For example, annotated units "%{vol}", "kg{total}", or "{RBC}"
-     * (for "red blood cells") are equivalent to "%", "kg", and "1" respectively.
-     *
-     * @param annotation the new symbol for the alternate unit.
-     * @return the alternate unit.
-     * @throws UnsupportedOperationException if this unit is not a metric unit.
-     * @throws IllegalArgumentException if the specified symbol is already
-     *         associated to a different unit.
-     */
-    public final AbstractUnit<Q> annotate(String annotation) {
-        return new AnnotatedUnit<Q>(this, annotation);
-    }
-    
-    /**
-     * Returns the annotation (if any) of this unit.
-     * The default implementation returns <code>null</code> (no annotation).
-     *
-     * @return this unit annotation or <code>null</code> if this unit has not
-     *         specific symbol associated with (e.g. product of units).
-     */
-    public String getAnnotation() {
-        return annotation;
-    }
-
-   @Override
-    public String getSymbol() {
-        return actualUnit.getSymbol();
-    }
-   
-	@Override
-	public Unit<Q> getSystemUnit() {
-		return toMetric();
-	}
-	
-    @Override
-    public Map<Unit<?>, Integer> getBaseUnits() {
-        return actualUnit.getProductUnits();
-    }
-  
-   @Override
-    protected Unit<Q> toMetric() {
-        return actualUnit.getSystemUnit();
-    }
-
-    @Override
-    public UnitConverter getConverterToMetric() {
-        return actualUnit.getConverterToMetric();
-    }
-
-    @Override
-    public boolean equals(Object that) {
-        if (this == that)
-            return true;
-        if (!(that instanceof AnnotatedUnit<?>))
-            return false;
-        AnnotatedUnit<?> thatUnit = (AnnotatedUnit<?>) that;
-        return this.actualUnit.equals(thatUnit.actualUnit) &&
-                this.annotation.equals(thatUnit.annotation);
-    }
-
-    @Override
-    public int hashCode() {
-        return actualUnit.hashCode() + annotation.hashCode();
-    }
-}
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/BaseAmount.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/BaseAmount.java
deleted file mode 100644
index eeb4aa5..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/BaseAmount.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/**
- * Copyright (c) 2005, 2013, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Werner Keil - initial API and implementation
- */
-package org.eclipse.uomo.units.impl;
-
-import static org.eclipse.uomo.core.impl.OutputHelper.println;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.math.MathContext;
-
-import org.eclipse.uomo.units.AbstractConverter;
-import org.eclipse.uomo.units.AbstractQuantity;
-import org.eclipse.uomo.units.AbstractUnit;
-import org.eclipse.uomo.units.IMeasure;
-import org.eclipse.uomo.units.impl.converter.RationalConverter;
-import org.eclipse.uomo.units.internal.MeasureAmount;
-import javax.measure.quantity.Dimensionless;
-import javax.measure.Quantity;
-import javax.measure.Unit;
-import javax.measure.UnitConverter;
-
-import com.ibm.icu.util.Measure;
-import com.ibm.icu.util.MeasureUnit;
-
-/**
- * Represents a generic quantity amount.
- * 
- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>
- * @version 1.3.3, $Date: 2013-05-21 $
- * @deprecated use BaseQuantity
- */
-public class BaseAmount<Q extends Quantity<Q>> extends AbstractQuantity<Q>
-		implements Comparable<BaseAmount<Q>> {
-	
-	private final Measure measure;
-	
-	/**
-	 * @param number
-	 * @param unit
-	 */
-	public BaseAmount(Number number, Unit<Q> unit) {
-		super(unit);
-		measure = MeasureAmount.of(number,  (MeasureUnit)unit);
-		//super(number, (MeasureUnit) unit);
-	}
-
-	/**
-	 * Returns the amount corresponding to the specified value and unit.
-	 * 
-	 * @param value
-	 *            the value stated in the specified unit.
-	 * @param unit
-	 *            the unit in which the value is stated.
-	 * @return the corresponding amount.
-	 */
-	public static <Q extends Quantity<Q>> BaseAmount<Q> valueOf(Number value,
-			Unit<Q> unit) {
-		BaseAmount<Q> amount = new BaseAmount<Q>(value, unit);
-		return amount;
-	}
-
-	/**
-	 * Holds a dimensionless measure of one (exact).
-	 */
-	protected static final BaseAmount<Dimensionless> ONE = new BaseAmount<Dimensionless>(
-			BigDecimal.ONE, AbstractUnit.ONE);
-
-	@SuppressWarnings({ "rawtypes", "unchecked" })
-	public BaseAmount<Q> add(IMeasure<Q> that) {
-		final IMeasure<Q> thatToUnit = that.to(unit());
-		return new BaseAmount(this.value().doubleValue()
-				+ thatToUnit.value().doubleValue(), unit());
-	}
-
-	@SuppressWarnings({ "rawtypes", "unchecked" })
-	@Override
-	public BaseAmount<Q> subtract(IMeasure<Q> that) {
-		final IMeasure<Q> thatToUnit = that.to(unit());
-		return new BaseAmount(this.value().doubleValue()
-				- thatToUnit.value().doubleValue(), unit());
-
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public BaseAmount<Q> multiply(IMeasure<?> that) {
-		Unit<?> unit = unit().multiply(that.unit());
-		return (BaseAmount<Q>) valueOf((value().doubleValue() * that.value()
-				.doubleValue()), unit);
-	}
-	
-	@Override
-	public BaseAmount<?> multiply(Number that) {
-		return (BaseAmount<Q>) valueOf((value().doubleValue() * that
-				.doubleValue()), unit());	
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public BaseAmount<Q> divide(IMeasure<?> that) {
-		Unit<?> unit = unit().divide(that.unit());
-		return (BaseAmount<Q>) valueOf((value().doubleValue() / that.value()
-				.doubleValue()), unit);
-	}
-
-	@Override
-	public BaseAmount<Q> to(Unit<Q> unit) {
-		return to(unit, MathContext.DECIMAL128);
-	}
-
-	public BaseAmount<Q> to(Unit<Q> unit, MathContext ctx) {
-		if (this.unit().equals(unit))
-			return this;
-		UnitConverter cvtr = this.unit().getConverterTo(unit);
-		if (cvtr == AbstractConverter.IDENTITY)
-			return (BaseAmount<Q>) valueOf(this.value(), unit);
-		return (BaseAmount<Q>) valueOf(convert(this.value(), cvtr, ctx), unit);
-	}
-
-	// Try to convert the specified value.
-	private static Number convert(Number value, UnitConverter cvtr,
-			MathContext ctx) {
-		if (cvtr instanceof RationalConverter) { // Try converting through Field
-													// methods.
-			RationalConverter rCvtr = (RationalConverter) cvtr;
-			BigInteger dividend = rCvtr.getDividend();
-			BigInteger divisor = rCvtr.getDivisor();
-			if (dividend.abs().compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0)
-				throw new ArithmeticException("Multiplier overflow"); //$NON-NLS-1$
-			if (divisor.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0)
-				throw new ArithmeticException("Divisor overflow"); //$NON-NLS-1$
-			if (value instanceof BigInteger || value instanceof Long || value instanceof Integer) {
-				return (value.longValue() * dividend.longValue())
-					/ (divisor.longValue());
-			} else {
-				return (value.doubleValue() * dividend.doubleValue())
-					/ (divisor.doubleValue());
-				// TODO use actual BigDecimal methods for BigDecimal
-			}
-		} else if (cvtr instanceof AbstractConverter.Compound
-				&& cvtr.isLinear()) { // Do it in two parts.
-			AbstractConverter.Compound compound = (AbstractConverter.Compound) cvtr;
-			Number firstConversion = convert(value, compound.getRight(), ctx);
-			Number secondConversion = convert(firstConversion,
-					compound.getLeft(), ctx);
-			return secondConversion;
-		} else { // Try using BigDecimal as intermediate.
-			BigDecimal decimalValue = BigDecimal.valueOf(value.doubleValue());
-			BigDecimal newValue = cvtr.convert(decimalValue, ctx);
-			return newValue;
-			// if (((FieldNumber)value) instanceof Decimal)
-			// return (N)((FieldNumber)Decimal.valueOf(newValue));
-			// if (((FieldNumber)value) instanceof Float64)
-			// return (N)((FieldNumber)Float64.valueOf(newValue.doubleValue()));
-			// throw new ArithmeticException(
-			// "Generic amount conversion not implemented for amount of type " +
-			// value.getClass());
-		}
-	}
-
-	/**
-	 * Returns this measure raised at the specified exponent.
-	 * 
-	 * @param exp
-	 *            the exponent.
-	 * @return <code>this<sup>exp</sup></code>
-	 */
-	@SuppressWarnings("unchecked")
-	public IMeasure<? extends IMeasure<Q>> pow(int exp) {
-		if (exp < 0)
-			return (IMeasure<? extends IMeasure<Q>>) this.pow(-exp).inverse();
-		if (exp == 0)
-
-			return (IMeasure<? extends IMeasure<Q>>) ONE;
-
-		IMeasure<? extends IMeasure<Q>> pow2 = (IMeasure<? extends IMeasure<Q>>) this;
-		IMeasure<? extends IMeasure<Q>> result = null;
-		while (exp >= 1) { // Iteration.
-
-			if ((exp & 1) == 1) {
-				result = (IMeasure<? extends IMeasure<Q>>) ((result == null) ? pow2
-						: result.multiply(pow2));
-
-			}
-
-			pow2 = (IMeasure<? extends IMeasure<Q>>) pow2.multiply(pow2);
-
-			exp >>>= 1;
-
-		}
-
-		return result;
-
-	}
-
-	public IMeasure<? extends IMeasure<Q>> inverse() {
-		@SuppressWarnings({ "rawtypes", "unchecked" })
-		final IMeasure<? extends IMeasure<Q>> m = new BaseAmount(value(),
-				unit().inverse());
-		return m;
-	}
-
-	@Override
-	public int compareTo(BaseAmount<Q> o) {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public boolean equals(Object obj) {
-		if (obj == null)
-			return false;
-		if (obj == this)
-			return true;
-		if (obj instanceof BaseAmount<?>) {
-			BaseAmount<?> ba = (BaseAmount<?>) obj;
-			if (this.unit().getClass() == ba.unit().getClass()) {
-				return super.equals(obj);
-			}
-			if (ba.unit() instanceof AlternateUnit<?>) {
-				AlternateUnit<?> baa = (AlternateUnit<?>) ba.unit();
-				if (this.unit() instanceof AlternateUnit<?>) {
-					return super.equals(obj);
-				} else if (this.unit() instanceof AnnotatedUnit<?>) {
-					AnnotatedUnit<?> au = (AnnotatedUnit<?>) this.unit();
-					println("Ann: " + au); //$NON-NLS-1$
-				} else if (this.unit() instanceof BaseUnit<?>) {
-					BaseUnit<?> bu = (BaseUnit<?>) this.unit();
-					println("Bas: " + bu); //$NON-NLS-1$
-				} else if (this.unit() instanceof ProductUnit<?>) {
-					ProductUnit<?> pu = (ProductUnit<?>) this.unit();
-					println("Pro: " + pu); //$NON-NLS-1$
-				} else if (this.unit() instanceof TransformedUnit<?>) {
-					TransformedUnit<?> tu = (TransformedUnit<?>) this.unit();
-					println("Tran: " + tu); //$NON-NLS-1$
-					if (tu.getParentUnit().equals(baa)) {
-						return true; // FIXME use number here, too
-					}
-				} else {
-					return super.equals(obj);
-				}
-			}
-			if (ba.unit() instanceof BaseUnit<?>) {
-				if (this.unit() instanceof AlternateUnit<?>) {
-					AlternateUnit<?> au = (AlternateUnit<?>) this.unit();
-					println("Alt: " + au); //$NON-NLS-1$
-				} else if (this.unit() instanceof AnnotatedUnit<?>) {
-					AnnotatedUnit<?> au = (AnnotatedUnit<?>) this.unit();
-					println("Ann: " + au); //$NON-NLS-1$
-				} else if (this.unit() instanceof BaseUnit<?>) {
-					return super.equals(obj);
-				} else if (this.unit() instanceof ProductUnit<?>) {
-					ProductUnit<?> pu = (ProductUnit<?>) this.unit();
-					println("Pro: " + pu); //$NON-NLS-1$
-				} else if (this.unit() instanceof TransformedUnit<?>) {
-					TransformedUnit<?> tu = (TransformedUnit<?>) this.unit();
-					println("Tran: " + tu); //$NON-NLS-1$
-				} else {
-					return super.equals(obj);
-				}
-			}
-			if (ba.unit() instanceof TransformedUnit<?>) {
-				TransformedUnit<?> bat = (TransformedUnit<?>) ba.unit();
-				if (this.unit() instanceof AlternateUnit<?>) {
-					AlternateUnit<?> au = (AlternateUnit<?>) this.unit();
-					println("Alt: " + au); //$NON-NLS-1$
-					if (bat.getParentUnit().equals(au)) {
-						return true;
-					}
-				} else if (this.unit() instanceof AnnotatedUnit<?>) {
-					AnnotatedUnit<?> au = (AnnotatedUnit<?>) this.unit();
-					System.out.println("Ann: " + au); //$NON-NLS-1$
-				} else if (this.unit() instanceof BaseUnit<?>) {
-					BaseUnit<?> bu = (BaseUnit<?>) this.unit();
-					println("Bas: " + bu); //$NON-NLS-1$
-				} else if (this.unit() instanceof ProductUnit<?>) {
-					ProductUnit<?> pu = (ProductUnit<?>) this.unit();
-					println("Pro: " + pu); //$NON-NLS-1$
-				} else if (this.unit() instanceof TransformedUnit<?>) {
-					return super.equals(obj);
-				} else {
-					return super.equals(obj);
-				}
-			}
-		}
-		return super.equals(obj);
-	}
-
-	@Override
-	public Number value() {
-		return measure.getNumber();
-	}
-
-	@Override
-	public Number getValue() {
-		return value();
-	}
-
-	@Override
-	public boolean isBig() {
-		return value() instanceof BigDecimal;
-	}
-
-	@Override
-	public BigDecimal decimalValue(Unit<Q> unit, MathContext ctx)
-			throws ArithmeticException {
-		   BigDecimal decimal = (value() instanceof BigDecimal) ? (BigDecimal)value() : BigDecimal.valueOf(value().doubleValue()); // TODO check value if it is a BD, otherwise use different converter
-           return (unit().equals(unit)) ? decimal : ((AbstractConverter)unit().getConverterTo(unit)).convert(decimal, ctx);
-
-	}
-
-	@Override
-	public double doubleValue(Unit<Q> unit) throws ArithmeticException {
-		return (unit().equals(unit)) ? value().doubleValue() : unit().getConverterTo(unit).convert(value().doubleValue());
-	}
-}
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/BaseQuantity.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/BaseQuantity.java
deleted file mode 100644
index 2f36c56..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/BaseQuantity.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/**
- *  Unit-API - Units of Measurement API for Java
- *  Copyright 2013-2014, Jean-Marie Dautelle, Werner Keil, V2COM and individual
- *  contributors by the @author tag.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *  http://www.apache.org/licenses/LICENSE-2.0
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.eclipse.uomo.units.impl;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.math.MathContext;
-
-import org.eclipse.uomo.units.AbstractConverter;
-import org.eclipse.uomo.units.AbstractQuantity;
-import javax.measure.Quantity;
-import javax.measure.IncommensurableException;
-import javax.measure.UnconvertibleException;
-import javax.measure.Unit;
-import javax.measure.UnitConverter;
-
-/**
- * An amount of quantity, consisting of a Number and a Unit. BaseMeasurement
- * objects are immutable.
- * 
- * @see java.lang.Number
- * @see MeasureUnit
- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>
- * @param <Q>
- *            The type of the quantity.
- * @version 1.6, $Date: 2014-04-08 $
- */
-public class BaseQuantity<Q extends Quantity<Q>> extends AbstractQuantity<Q>
-		implements Quantity<Q>, Comparable<BaseQuantity<Q>> {
-//FIXME Bug 338334 overwrite equals()
-    
-
-	/**
-	 * 
-	 */
-//	private static final long serialVersionUID = 7312161895652321241L;
-
-	private final Number value;
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see AbstractMeasurement#equals(java.lang.Object)
-	 */
-	@Override
-	public boolean equals(Object obj) {
-		if (obj == null)
-			return false;
-		if (obj == this)
-			return true;
-		if (this.getClass() == obj.getClass()) {
-			return super.equals(obj);
-		} else {
-			if (obj instanceof Quantity) {
-				@SuppressWarnings("rawtypes")
-				Quantity m = (Quantity) obj;
-				if (m.getValue().getClass() == this.getValue().getClass()
-						&& m.getUnit().getClass() == this.getUnit().getClass()) {
-					return super.equals(obj);
-				} else {
-					// if (this.getQuantityUnit() instanceof AbstractUnit<?>) {
-					// if
-					// }
-					return super.equals(obj);
-				}
-			}
-			return false;
-		}
-	}
-
-	/**
-	 * Indicates if this measure is exact.
-	 */
-	private final boolean isExact;
-
-	/**
-	 * Indicates if this measure is big.
-	 */
-	private final boolean isBig;
-	
-	/**
-	 * Holds the exact value (when exact) stated in this measure unit.
-	 */
-	// private long exactValue;
-
-	/**
-	 * Holds the minimum value stated in this measure unit. For inexact
-	 * measures: minimum < maximum
-	 */
-	// private double minimum;
-
-	/**
-	 * Holds the maximum value stated in this measure unit. For inexact
-	 * measures: maximum > minimum
-	 */
-	// private double maximum;
-
-	protected BaseQuantity(Number number, Unit<Q> unit) {
-		super(unit);
-		value = number;
-		isExact = false;
-		isBig = false;;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * Measurement#doubleValue(javax.measure.Unit)
-	 */
-	public double doubleValue(Unit<Q> unit) {
-		Unit<Q> myUnit = getUnit();
-		try {
-			UnitConverter converter = unit.getConverterTo(myUnit);
-			return converter.convert(getValue().doubleValue());
-		} catch (UnconvertibleException e) {
-			throw e;
-		} // catch (IncommensurableException e) {
-		// throw new IllegalArgumentException(e.getMessage());
-		// }
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.eclipse.uomo.units.AbstractMeasurement#longValue(javax.measure
-	 * .Unit)
-	 */
-	public long longValue(Unit<Q> unit) {
-		Unit<Q> myUnit = getUnit();
-		try {
-			UnitConverter converter = unit.getConverterToAny(myUnit);
-			if ((getValue() instanceof BigDecimal || getValue() instanceof BigInteger) 
-					&& converter instanceof AbstractConverter) {
-				return (((AbstractConverter)converter).convert(
-						BigDecimal.valueOf(getValue().longValue()),
-						MathContext.DECIMAL128)).longValue();
-			} else {
-		        double result = doubleValue(unit);
-		        if ((result < Long.MIN_VALUE) || (result > Long.MAX_VALUE)) {
-		            throw new ArithmeticException("Overflow (" + result + ")");
-		        }
-		        return (long) result;
-			}
-		} catch (UnconvertibleException e) {
-			throw e;
-		} catch (IncommensurableException e) {
-			throw new IllegalArgumentException(e.getMessage());
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see javax.measure.Quantity#getValue()
-	 */
-	public Number getValue() {
-		return value;
-	}
-
-	/**
-	 * Indicates if this measured amount is exact. An exact amount is guarantee
-	 * exact only when stated in this measure unit (e.g.
-	 * <code>this.longValue()</code>); stating the amount in any other unit may
-	 * introduce conversion errors.
-	 * 
-	 * @return <code>true</code> if this measure is exact; <code>false</code>
-	 *         otherwise.
-	 */
-	public boolean isExact() {
-		return isExact;
-	}
-	
-	/**
-	 * Indicates if this measured amount is a big number, i.E. BigDecimal or BigInteger.
-	 * In all other cases this would be false.
-	 * 
-	 * @return <code>true</code> if this measure is big; <code>false</code>
-	 *         otherwise.
-	 */
-	public boolean isBig() {
-		return isBig;
-	}
-	
-	@SuppressWarnings({ "rawtypes", "unchecked" })
-	public BaseQuantity<Q> add(AbstractQuantity<Q> that) {
-		final AbstractQuantity<Q> thatToUnit = that.to(getUnit());
-		return new BaseQuantity(this.getValue().doubleValue()
-				+ thatToUnit.getValue().doubleValue(), 
-                                  getUnit());
-	}
-	
-	public String toString() {
-		return  String.valueOf(getValue()) + " " 
-                        + String.valueOf(getUnit());
-	}
-
-	@Override
-	public IMeasure<?> multiply(IMeasure<?> that) {
-		final Unit<?> unit = getUnit().multiply(that.unit());
-		return of((getValue().doubleValue() * that.value()
-				.doubleValue()), unit);	
-	}
-        
-        @Override
-	public BaseQuantity<?> multiply(Number that) {
-		return (BaseQuantity<Q>) of((getValue().doubleValue() * that
-				.doubleValue()), getUnit());	
-	}
-        
-	@Override
-	public IMeasure<?> divide(IMeasure<?> that) {
-		final Unit<?> unit = getUnit().divide(that.unit());
-		return of((getValue().doubleValue() / that.value()
-				.doubleValue()), unit);	
-	}
-
-	public IMeasure<?> divide(Number that) {
-		// TODO may use isBig() here, too
-		if (value instanceof BigDecimal && that instanceof BigDecimal) {
-			return of(((BigDecimal)value).divide((BigDecimal)that), 
-                                getUnit());
-		}
-		return of(getValue().doubleValue() / that.doubleValue(), 
-                        getUnit());	
-	}
-	
-//	@Override
-//	public IMeasure<Q> inverse() {
-//		@SuppressWarnings({ "rawtypes", "unchecked" })
-//		final IMeasure<Q> m = new BaseQuantity(getValue(),
-//				getUnit().inverse()); // TODO keep value same?
-//		return m;
-//	}
-
-	@Override
-	public BigDecimal decimalValue(Unit<Q> unit, MathContext ctx)
-			throws ArithmeticException {
-		if (value instanceof BigDecimal) {
-                    return (BigDecimal)value;
-                }
-                if (value instanceof BigInteger) {
-                    return new BigDecimal((BigInteger)value);
-                }
-		return BigDecimal.valueOf(value.doubleValue());
-	}
-
-	@Override
-	public int compareTo(BaseQuantity<Q> o) {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public Number value() {
-		return getValue();
-	}
-
-	@Override
-	public IMeasure<? extends IMeasure<Q>> inverse() {
-		final IMeasure<? extends IMeasure<Q>> m = new BaseQuantity(getValue(),
-		getUnit().inverse()); // TODO keep value same?
-		return m;
-	}
-}
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/BaseUnit.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/BaseUnit.java
deleted file mode 100644
index 2247a70..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/BaseUnit.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/**

- * Copyright (c) 2005, 2011, Werner Keil, Ikayzo 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import java.io.Serializable;

-

-import org.eclipse.uomo.units.AbstractConverter;

-import org.eclipse.uomo.units.AbstractUnit;

-import javax.measure.Quantity;

-import javax.measure.Dimension;

-import javax.measure.Unit;

-import javax.measure.UnitConverter;

-

-/**

- * <p> This class represents the building blocks on top of which all others

- *     units are created. Base units are always unscaled metric units.</p>

- * 

- * <p> When using the {@linkplain Dimensional.Model#STANDARD standard} model

- *     (default), all seven base units are dimensionally independent.</p>

- *

- * @param <Q> The type of the quantity measured by this unit.

- *

- * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author  <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @version 1.10 ($Revision: 212 $), $Date: 2010-09-13 23:50:44 +0200 (Mo, 13 Sep 2010) $

- * @see <a href="http://en.wikipedia.org/wiki/SI_base_unit">

- *       Wikipedia: SI base unit</a>

- */

-public class BaseUnit<Q extends Quantity<Q>> extends AbstractUnit<Q> implements Serializable {

-    

-    /**

-     * Holds the symbol.

-     */

-    private final String symbol;

-

-    /** The serialVersionUID */

-    private static final long serialVersionUID = 1234567654321265167L;

-

-    /**

-     * Creates a base unit having the specified symbol.

-     *

-     * @param symbol the symbol of this base unit.

-     * @throws IllegalArgumentException if the specified symbol is

-     *         associated to a different unit.

-     */

-    public BaseUnit(String symbol, String name) {

-        super(name);

-    	this.symbol = symbol;

-        // Checks if the symbol is associated to a different unit.

-        synchronized (AbstractUnit.SYMBOL_TO_UNIT) {

-            Unit<?> unit = AbstractUnit.SYMBOL_TO_UNIT.get(symbol);

-            if (unit == null) {

-                AbstractUnit.SYMBOL_TO_UNIT.put(symbol, this);

-                return;

-            }

-            if (!(unit instanceof BaseUnit<?>))

-                throw new IllegalArgumentException("Symbol " + symbol + " is associated to a different unit");

-        }

-    }

-    

-    /**

-     * Creates a base unit having the specified symbol.

-     *

-     * @param symbol the symbol of this base unit.

-     * @throws IllegalArgumentException if the specified symbol is

-     *         associated to a different unit.

-     */

-    public BaseUnit(String symbol) {

-    	this(symbol, null);

-    }

-	

-    @Override

-    public String getSymbol() {

-        return symbol;

-    }

-    

-	@Override

-	public Unit<Q> getSystemUnit() {

-		return toMetric();

-	}

-	

-    @Override

-    public boolean equals(Object that) {

-        if (this == that)

-            return true;

-        if (!(that instanceof BaseUnit<?>)) {

-        	if (!(that instanceof Unit<?>)) {

-        		return false;

-        	} else {

-        		if (that instanceof TransformedUnit<?>) {

-        			if (((TransformedUnit<?>) that).getParentUnit() instanceof BaseUnit<?>) {        				

-        				if(this.getSymbol().equals(((TransformedUnit<?>)that).getParentUnit().getSymbol())) {

-        					for (@SuppressWarnings("unused") UnitConverter comp : ((TransformedUnit<?>) that).toParentUnit().getCompoundConverters()) {

-        						// FIXME Bug 338334 evaluate factor 1 for TU

-//								System.out.println(comp.toString());

-							}

-        				}

-        			}

-        		}

-        		if (that instanceof ProductUnit<?>) {

-        			ProductUnit<?> pu = (ProductUnit<?>) that;

-//        			System.out.println("Product Unit: " + pu.getProductUnits());

-        			return this.symbol.equals(pu.getSymbol());

-        		}

-        		return false;

-        	}

-        }  else {        	

-	        BaseUnit<?> thatUnit = (BaseUnit<?>) that;

-	        return this.symbol.equals(thatUnit.symbol);

-        }

-    }

-

-    @Override

-    public int hashCode() {

-        return symbol.hashCode();

-    }

-

-    @Override

-    protected Unit<Q> toMetric() {

-        return this;

-    }

-

-    @Override

-    public UnitConverter getConverterToMetric() {

-        return AbstractConverter.IDENTITY;

-    }

-

-    @Override

-    public Dimension getDimension() {

-        return DimensionImpl.getModel().getDimension(this);

-    }

-

-    @Override

-    public UnitConverter getDimensionalTransform() {

-        return DimensionImpl.getModel().getTransform(this);

-    }

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/ByteQuantity.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/ByteQuantity.java
deleted file mode 100644
index 1e2b834..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/ByteQuantity.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/**

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package tec.units.indriya.quantity;

-

-import java.math.BigDecimal;

-import java.math.MathContext;

-import java.util.Objects;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-

-import tec.units.indriya.AbstractQuantity;

-import tec.units.indriya.ComparableQuantity;

-

-/**

- * An amount of quantity, consisting of a short and a Unit. ByteQuantity objects are immutable.

- * 

- * @see AbstractQuantity

- * @see Quantity

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @param <Q>

- *          The type of the quantity.

- * @version 0.1, $Date: 2017-05-28 $

- * @since 1.0.7

- */

-final class ByteQuantity<Q extends Quantity<Q>> extends AbstractQuantity<Q> {

-

-  /**
-     * 
-     */

-  private static final long serialVersionUID = 6325849816534488248L;

-

-  final byte value;

-

-  ByteQuantity(byte value, Unit<Q> unit) {

-    super(unit);

-    this.value = value;

-  }

-

-  @Override

-  public Byte getValue() {

-    return value;

-  }

-

-  public double doubleValue(Unit<Q> unit) {

-    return (super.getUnit().equals(unit)) ? value : super.getUnit().getConverterTo(unit).convert(value);

-  }

-

-  @Override

-  public long longValue(Unit<Q> unit) {

-    double result = doubleValue(unit);

-    if ((result < Long.MIN_VALUE) || (result > Long.MAX_VALUE)) {

-      throw new ArithmeticException("Overflow (" + result + ")");

-    }

-    return (long) result;

-  }

-

-  @Override

-  public boolean isBig() {

-    return false;

-  }

-

-  @Override

-  public BigDecimal decimalValue(Unit<Q> unit, MathContext ctx) {

-    return BigDecimal.valueOf(doubleValue(unit));

-  }

-

-  @Override

-  public ComparableQuantity<Q> add(Quantity<Q> that) {

-    final Quantity<Q> converted = that.to(getUnit());

-    return NumberQuantity.of(value + converted.getValue().byteValue(), getUnit());

-  }

-

-  @Override

-  public ComparableQuantity<Q> subtract(Quantity<Q> that) {

-    final Quantity<Q> converted = that.to(getUnit());

-    return NumberQuantity.of(value - converted.getValue().byteValue(), getUnit());

-  }

-

-  @Override

-  public ComparableQuantity<?> divide(Quantity<?> that) {

-    return NumberQuantity.of((short) value / that.getValue().byteValue(), getUnit().divide(that.getUnit()));

-  }

-

-  @Override

-  public ComparableQuantity<Q> divide(Number that) {

-    return NumberQuantity.of(value / that.byteValue(), getUnit());

-  }

-

-  @Override

-  public ComparableQuantity<?> multiply(Quantity<?> multiplier) {

-    return NumberQuantity.of(value * multiplier.getValue().byteValue(), getUnit().multiply(multiplier.getUnit()));

-  }

-

-  @Override

-  public ComparableQuantity<Q> multiply(Number multiplier) {

-    return NumberQuantity.of(value * multiplier.byteValue(), getUnit());

-  }

-

-  @Override

-  public ComparableQuantity<?> inverse() {

-    return NumberQuantity.of(1 / value, getUnit().inverse());

-  }

-

-  @Override

-  public boolean equals(Object obj) {

-    if (this == obj) {

-      return true;

-    }

-    if (obj instanceof Quantity<?>) {

-      Quantity<?> that = (Quantity<?>) obj;

-      return Objects.equals(getUnit(), that.getUnit()) && Equalizer.hasEquality(value, that.getValue());

-    }

-    return false;

-  }

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DecimalQuantity.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DecimalQuantity.java
deleted file mode 100644
index 74eac21..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DecimalQuantity.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*

- * Next Generation Units of Measurement Implementation

- * Copyright (c) 2005-2017, Jean-Marie Dautelle, Werner Keil, V2COM.

- *

- * All rights reserved.

- *

- * Redistribution and use in source and binary forms, with or without modification,

- * are permitted provided that the following conditions are met:

- *

- * 1. Redistributions of source code must retain the above copyright notice,

- *    this list of conditions and the following disclaimer.

- *

- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions

- *    and the following disclaimer in the documentation and/or other materials provided with the distribution.

- *

- * 3. Neither the name of JSR-363, Indriya nor the names of their contributors may be used to endorse or promote products

- *    derived from this software without specific prior written permission.

- *

- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"

- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,

- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE

- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES

- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;

- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED

- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT

- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,

- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

- */

-package tec.units.indriya.quantity;

-

-import java.io.Serializable;

-import java.math.BigDecimal;

-import java.math.MathContext;

-import java.util.Objects;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-

-import tec.units.indriya.AbstractConverter;

-import tec.units.indriya.AbstractQuantity;

-import tec.units.indriya.ComparableQuantity;

-

-/**

- * An amount of quantity, implementation of {@link ComparableQuantity} that uses {@link BigDecimal} as implementation of {@link Number}, this object

- * is immutable. Note: all operations which involves {@link Number}, this implementation will convert to {@link BigDecimal}, and all operation of

- * BigDecimal will use {@link MathContext#DECIMAL128}.

- *

- * @param <Q>

- *          The type of the quantity.

- * @author otaviojava

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @see AbstractQuantity

- * @see Quantity

- * @see ComparableQuantity

- * @version 1.0.1

- * @since 1.0

- */

-@SuppressWarnings({ "rawtypes", "unchecked" })

-final class DecimalQuantity<Q extends Quantity<Q>> extends AbstractQuantity<Q> implements Serializable {

-

-  private static final long serialVersionUID = 6504081836032983882L;

-

-  private final BigDecimal value;

-

-  public DecimalQuantity(BigDecimal value, Unit<Q> unit) {

-    super(unit);

-    this.value = value;

-  }

-

-  @Override

-  public BigDecimal getValue() {

-    return value;

-  }

-

-  @Override

-  public double doubleValue(Unit<Q> unit) {

-    return (unit.equals(unit)) ? value.doubleValue() : unit.getConverterTo(unit).convert(value.doubleValue());

-  }

-

-  @Override

-  public BigDecimal decimalValue(Unit<Q> unit, MathContext ctx) throws ArithmeticException {

-    return (super.getUnit().equals(unit)) ? value : ((AbstractConverter) unit.getConverterTo(unit)).convert(value, ctx);

-  }

-

-  @Override

-  public ComparableQuantity<Q> add(Quantity<Q> that) {

-    if (getUnit().equals(that.getUnit())) {

-      return Quantities.getQuantity(value.add(Equalizer.toBigDecimal(that.getValue()), MathContext.DECIMAL128), getUnit());

-    }

-    Quantity<Q> converted = that.to(getUnit());

-    return Quantities.getQuantity(value.add(Equalizer.toBigDecimal(converted.getValue())), getUnit());

-  }

-

-  @Override

-  public ComparableQuantity<Q> subtract(Quantity<Q> that) {

-    if (getUnit().equals(that.getUnit())) {

-      return Quantities.getQuantity(value.subtract(Equalizer.toBigDecimal(that.getValue()), MathContext.DECIMAL128), getUnit());

-    }

-    Quantity<Q> converted = that.to(getUnit());

-    return Quantities.getQuantity(value.subtract(Equalizer.toBigDecimal(converted.getValue()), MathContext.DECIMAL128), getUnit());

-  }

-

-  @Override

-  public ComparableQuantity<?> multiply(Quantity<?> that) {

-    return new DecimalQuantity(value.multiply(Equalizer.toBigDecimal(that.getValue()), MathContext.DECIMAL128), getUnit().multiply(that.getUnit()));

-  }

-

-  @Override

-  public ComparableQuantity<Q> multiply(Number that) {

-    return Quantities.getQuantity(value.multiply(Equalizer.toBigDecimal(that), MathContext.DECIMAL128), getUnit());

-  }

-

-  @Override

-  public ComparableQuantity<Q> divide(Number that) {

-    return Quantities.getQuantity(value.divide(Equalizer.toBigDecimal(that), MathContext.DECIMAL128), getUnit());

-  }

-

-  @Override

-  public ComparableQuantity<Q> inverse() {

-    return (ComparableQuantity<Q>) Quantities.getQuantity(BigDecimal.ONE.divide(value), getUnit().inverse());

-  }

-

-  @Override

-  protected long longValue(Unit<Q> unit) {

-    double result = doubleValue(unit);

-    if ((result < Long.MIN_VALUE) || (result > Long.MAX_VALUE)) {

-      throw new ArithmeticException("Overflow (" + result + ")");

-    }

-    return (long) result;

-  }

-

-  @Override

-  public boolean isBig() {

-    return true;

-  }

-

-  @Override

-  public ComparableQuantity<?> divide(Quantity<?> that) {

-    return new DecimalQuantity(value.divide(Equalizer.toBigDecimal(that.getValue()), MathContext.DECIMAL128), getUnit().divide(that.getUnit()));

-  }

-

-  /*

-   * (non-Javadoc)

-   * 

-   * @see AbstractQuantity#equals(java.lang.Object)

-   */

-  @Override

-  public boolean equals(Object obj) {

-    if (obj == null)

-      return false;

-    if (obj == this)

-      return true;

-    if (obj instanceof Quantity<?>) {

-      Quantity<?> that = (Quantity<?>) obj;

-      return Objects.equals(getUnit(), that.getUnit()) && Equalizer.hasEquality(value, that.getValue());

-    }

-    return false;

-  }

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DimensionImpl.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DimensionImpl.java
deleted file mode 100644
index 17156f0..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DimensionImpl.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/**

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil and others - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import java.io.Serializable;

-import java.util.HashMap;

-import java.util.Map;

-import java.util.Map.Entry;

-

-import org.eclipse.uomo.units.AbstractConverter;

-import org.eclipse.uomo.units.AbstractUnit;

-import org.eclipse.uomo.units.SI;

-import javax.measure.quantity.Dimensionless;

-import javax.measure.Dimension;

-import javax.measure.Unit;

-import javax.measure.UnitConverter;

-

-/**

- * <p>

- * This class represents the dimension of an unit. Two units <code>u1</code> and

- * <code>u2</code> are {@linkplain Unit#isCompatible compatible} if and only if

- * <code>(u1.getDimension().equals(u2.getDimension())))</code>

- * </p>

- * 

- * <p>

- * Instances of this class are immutable.

- * </p>

- * 

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * 

- * @version 1.0.6, $Date: 2017-12-20 $

- * @see <a href="http://www.bipm.org/en/si/si_brochure/chapter1/1-3.html"> BIPM:

- *      SI Brochure Chapter 1.3</a>

- */

-public final class DimensionImpl implements Dimension, Serializable {

-

-	/**

-	 * For cross-version compatibility.

-	 */

-	private static final long serialVersionUID = 2377803885472362640L;

-

-	/**

-	 * Holds the current physical model.

-	 */

-	private static Model model = Model.STANDARD;

-

-	/**

-	 * Holds dimensionless.

-	 */

-	public static final Dimension NONE = new DimensionImpl(AbstractUnit.ONE);

-

-	/**

-	 * Holds length dimension (L).

-	 */

-	public static final Dimension LENGTH = new DimensionImpl('L');

-

-	/**

-	 * Holds mass dimension (M).

-	 */

-	public static final Dimension MASS = new DimensionImpl('M');

-

-	/**

-	 * Holds time dimension (T).

-	 */

-	public static final Dimension TIME = new DimensionImpl('T');

-

-	/**

-	 * Holds electric current dimension (I).

-	 */

-	public static final Dimension ELECTRIC_CURRENT = new DimensionImpl('I');

-

-	/**

-	 * Holds temperature dimension (Θ). TODO use Theta again, currently not

-	 * working (Bug 351656)

-	 */

-	public static final Dimension TEMPERATURE = new DimensionImpl('Q');

-

-	/**

-	 * Holds amount of substance dimension (N).

-	 */

-	public static final Dimension AMOUNT_OF_SUBSTANCE = new DimensionImpl('N');

-

-	/**

-	 * Holds luminous intensity dimension (J).

-	 */

-	public static final Dimension LUMINOUS_INTENSITY = new DimensionImpl('J');

-

-	/**

-	 * Holds the pseudo unit associated to this dimension.

-	 */

-	private final Unit<?> pseudoUnit;

-

-	/**

-	 * Creates a new dimension associated to the specified symbol.

-	 * 

-	 * @param symbol

-	 *            the associated symbol.

-	 */

-	private DimensionImpl(char symbol) {

-		pseudoUnit = new BaseUnit<Dimensionless>("[" + symbol + "]"); //$NON-NLS-1$ //$NON-NLS-2$

-	}

-

-	/**

-	 * Creates a dimension having the specified pseudo-unit (base unit or

-	 * product of base unit).

-	 * 

-	 * @param pseudoUnit

-	 *            the pseudo-unit identifying this dimension.

-	 */

-	private DimensionImpl(Unit<?> pseudoUnit) {

-		this.pseudoUnit = pseudoUnit;

-	}

-

-	/**

-	 * Returns the product of this dimension with the one specified.

-	 * 

-	 * @param that

-	 *            the dimension multiplicand.

-	 * @return <code>this * that</code>

-	 */

-	@Override

-	public final Dimension multiply(Dimension that) {

-		return new DimensionImpl(

-				this.pseudoUnit.multiply(((DimensionImpl) that).pseudoUnit));

-	}

-

-	/**

-	 * Returns the quotient of this dimension with the one specified.

-	 * 

-	 * @param that

-	 *            the dimension divisor.

-	 * @return <code>this / that</code>

-	 */

-	public final Dimension divide(Dimension that) {

-		return new DimensionImpl(

-				this.pseudoUnit.divide(((DimensionImpl) that).pseudoUnit));

-	}

-

-	/**

-	 * Returns this dimension raised to an exponent.

-	 * 

-	 * @param n

-	 *            the exponent.

-	 * @return the result of raising this dimension to the exponent.

-	 */

-	public final Dimension pow(int n) {

-		return new DimensionImpl(this.pseudoUnit.pow(n));

-	}

-

-	/**

-	 * Returns the given root of this dimension.

-	 * 

-	 * @param n

-	 *            the root's order.

-	 * @return the result of taking the given root of this dimension.

-	 * @throws ArithmeticException

-	 *             if <code>n == 0</code>.

-	 */

-	public final Dimension root(int n) {

-		return new DimensionImpl(this.pseudoUnit.root(n));

-	}

-

-	/**

-	 * Returns the fundamental dimensions and their exponent whose product is

-	 * this dimension or <code>null</code> if this dimension is a fundamental

-	 * dimension.

-	 * 

-	 * @return the mapping between the fundamental dimensions and their

-	 *         exponent.

-	 */

-	public Map<Dimension, Integer> getProductDimensions() {

-		if (pseudoUnit == null)

-			return null;

-		@SuppressWarnings("unchecked")

-		Map<? extends Unit<?>, Integer> pseudoUnits = (Map<? extends Unit<?>, Integer>) pseudoUnit

-				.getBaseUnits();

-		Map<Dimension, Integer> fundamentalDimensions = new HashMap<Dimension, Integer>();

-		for (Entry<? extends Unit<?>, Integer> entry : pseudoUnits.entrySet()) {

-			fundamentalDimensions.put(new DimensionImpl(entry.getKey()),

-					entry.getValue());

-		}

-		return fundamentalDimensions;

-	}

-

-	/**

-	 * Returns the representation of this dimension.

-	 * 

-	 * @return the representation of this dimension.

-	 */

-	@Override

-	public String toString() {

-		return String.valueOf(pseudoUnit);

-	}

-

-	/**

-	 * Indicates if the specified dimension is equals to the one specified.

-	 * 

-	 * @param that

-	 *            the object to compare to.

-	 * @return <code>true</code> if this dimension is equals to that dimension;

-	 *         <code>false</code> otherwise.

-	 */

-	@Override

-	public boolean equals(Object that) {

-		if (this == that)

-			return true;

-		return (that instanceof DimensionImpl)

-				&& pseudoUnit.equals(((DimensionImpl) that).pseudoUnit);

-	}

-

-	/**

-	 * Returns the hash code for this dimension.

-	 * 

-	 * @return this dimension hashcode value.

-	 */

-	@Override

-	public int hashCode() {

-		return pseudoUnit.hashCode();

-	}

-

-	/**

-	 * Sets the model used to determinate the units dimensions.

-	 * 

-	 * @param model

-	 *            the new model to be used when calculating unit dimensions.

-	 */

-	public static void setModel(Model model) {

-		DimensionImpl.model = model;

-	}

-

-	/**

-	 * Returns the model used to determinate the units dimensions (default

-	 * {@link Model#STANDARD STANDARD}).

-	 * 

-	 * @return the model used when calculating unit dimensions.

-	 */

-	public static Model getModel() {

-		return DimensionImpl.model;

-	}

-	

-	/**

-	 * Creates a new dimension associated to the specified symbol.

-	 * 

-	 * @param symbol

-	 *            the associated symbol.

-	 */

-	public static Dimension valueOf(char symbol) {

-		return new DimensionImpl(symbol);

-	}

-

-	/**

-	 * This interface represents the mapping between {@linkplain BaseUnit base

-	 * units} and {@linkplain DimensionImpl dimensions}. Custom models may allow

-	 * conversions not possible using the {@linkplain #STANDARD standard} model.

-	 * For example:[code] public static void main(String[] args) {

-	 * Dimension.Model relativistic = new Dimension.Model() { RationalConverter

-	 * metreToSecond = new RationalConverter(BigInteger.ONE,

-	 * BigInteger.valueOf(299792458)); // 1/c

-	 * 

-	 * public Dimension getDimension(BaseUnit unit) { if (unit.equals(METRE))

-	 * return Dimension.TIME; return

-	 * Dimension.Model.STANDARD.getDimension(unit); }

-	 * 

-	 * public UnitConverter getTransform(BaseUnit unit) { if

-	 * (unit.equals(METRE)) return metreToSecond; return

-	 * Dimension.Model.STANDARD.getTransform(unit); }};

-	 * Dimension.setModel(relativistic);

-	 * 

-	 * // Converts 1.0 GeV (energy) to kg (mass).

-	 * System.out.println(Unit.valueOf

-	 * ("GeV").getConverterTo(KILOGRAM).convert(1.0)); }

-	 * 

-	 * > 1.7826617302520883E-27[/code]

-	 */

-	public interface Model {

-

-		/**

-		 * Holds the standard model (default).

-		 */

-		public Model STANDARD = new Model() {

-

-			public Dimension getDimension(Unit<?> unit) {

-				if (unit.equals(SI.METRE))

-					return DimensionImpl.LENGTH;

-				if (unit.equals(SI.KILOGRAM))

-					return DimensionImpl.MASS;

-				if (unit.equals(SI.KELVIN))

-					return DimensionImpl.TEMPERATURE;

-				if (unit.equals(SI.SECOND))

-					return DimensionImpl.TIME;

-				if (unit.equals(SI.AMPERE))

-					return DimensionImpl.ELECTRIC_CURRENT;

-				if (unit.equals(SI.MOLE))

-					return DimensionImpl.AMOUNT_OF_SUBSTANCE;

-				if (unit.equals(SI.CANDELA))

-					return DimensionImpl.LUMINOUS_INTENSITY;

-				return new DimensionImpl(new BaseUnit<Dimensionless>(

-						"[" + unit.getSymbol() + "]")); //$NON-NLS-1$ //$NON-NLS-2$

-			}

-

-			public UnitConverter getTransform(Unit<?> unit) {

-				return AbstractConverter.IDENTITY;

-			}

-		};

-

-		/**

-		 * Returns the dimension of the specified base unit (a dimension

-		 * particular to the base unit if the base unit is not recognized).

-		 * 

-		 * @param unit

-		 *            the base unit for which the dimension is returned.

-		 * @return the dimension of the specified unit.

-		 */

-		Dimension getDimension(Unit<?> unit);

-

-		/**

-		 * Returns the normalization transform of the specified base unit (

-		 * {@link UnitConverter#IDENTITY IDENTITY} if the base unit is not

-		 * recognized).

-		 * 

-		 * @param unit

-		 *            the base unit for which the transform is returned.

-		 * @return the normalization transform.

-		 */

-		UnitConverter getTransform(Unit<?> unit);

-	}

-

-	@Override

-	public Map<? extends Dimension, Integer> getBaseDimensions() {

-		// TODO Auto-generated method stub

-		return null;

-	}

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DimensionalModel.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DimensionalModel.java
deleted file mode 100644
index 8a8939d..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DimensionalModel.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import javax.measure.Dimension;

-import javax.measure.UnitConverter;

-

-import org.eclipse.uomo.units.AbstractConverter;

-

-import java.util.Map;

-

-/**

- * <p>

- * This class represents the physical model used for dimensional analysis.

- * </p>

- *

- * <p>

- * In principle, dimensions of physical quantities could be defined as "fundamental" (such as momentum or energy or electric current) making such

- * quantities uncommensurate (not comparable). Modern physics has cast doubt on the very existence of incompatible fundamental dimensions of physical

- * quantities. For example, most physicists do not recognize temperature, {@link QuantityDimension#TEMPERATURE Θ}, as a fundamental dimension since it

- * essentially expresses the energy per particle per degree of freedom, which can be expressed in terms of energy (or mass, length, and time). To

- * support, such model the method {@link #getConverter} may returns a non-null value for distinct dimensions.

- * </p>

- * 

- * <p>

- * The default model is {@link StandardModel Standard}. Applications may use one of the predefined model or create their own. <code>

- *     DimensionalModel relativistic = new DimensionalModel() {

- *         public Dimension getFundamentalDimension(Dimension dimension) {

- *             if (dimension.equals(QuantityDimension.LENGTH)) return QuantityDimension.TIME; // Consider length derived from time.

- *                 return super.getDimension(dimension); // Returns product of fundamental dimension.

- *             }

- *             public UnitConverter getDimensionalTransform(Dimension dimension) {

- *                 if (dimension.equals(QuantityDimension.LENGTH)) return new RationalConverter(1, 299792458); // Converter (1/C) from LENGTH SI unit (m) to TIME SI unit (s).

- *                 return super.getDimensionalTransform(dimension);

- *             }

- *     };

- *     try {

- *         DimensionalModel.setCurrent(relativistic); // Current thread use the relativistic model.

- *         Units.KILOGRAM.getConverterToAny(Units.JOULE); // Allowed.

- *         ...

- *     } finally {

- *        cleanup();

- *     }

- *     </code>

- * </p>

- * 

- * @see <a href="http://en.wikipedia.org/wiki/Dimensional_analysis">Wikipedia: Dimensional Analysis</a>

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @version 0.5.5, $Date: 2015-07-25 $

- */

-public abstract class DimensionalModel {

-

-  /**

-   * Holds the current model.

-   */

-  private static DimensionalModel currentModel = new StandardModel();

-

-  /**

-   * Returns the current model (by default an instance of {@link StandardModel}).

-   *

-   * @return the current dimensional model.

-   */

-  public static DimensionalModel current() {

-    return currentModel;

-  }

-

-  /**

-   * Sets the current dimensional model

-   *

-   * @param model

-   *          the new current model.

-   * @see #current

-   */

-  protected static void setCurrent(DimensionalModel model) {

-    currentModel = model;

-  }

-

-  /**

-   * DefaultQuantityFactory constructor (allows for derivation).

-   */

-  protected DimensionalModel() {

-  }

-

-  /**

-   * Returns the fundamental dimension for the one specified. If the specified dimension is a dimensional product, the dimensional product of its

-   * fundamental dimensions is returned. Physical quantities are considered commensurate only if their fundamental dimensions are equals using the

-   * current physics model.

-   *

-   * @param dimension

-   *          the dimension for which the fundamental dimension is returned.

-   * @return <code>this</code> or a rational product of fundamental dimension.

-   */

-  public Dimension getFundamentalDimension(Dimension dimension) {

-    Map<? extends Dimension, Integer> dimensions = dimension.getBaseDimensions();

-    if (dimensions == null)

-      return dimension; // Fundamental dimension.

-    // Dimensional Product.

-    Dimension fundamentalProduct = DimensionImpl.NONE;

-    for (Map.Entry<? extends Dimension, Integer> e : dimensions.entrySet()) {

-      fundamentalProduct = fundamentalProduct.multiply(this.getFundamentalDimension(e.getKey())).pow(e.getValue());

-    }

-    return fundamentalProduct;

-  }

-

-  /**

-   * Returns the dimensional transform of the specified dimension. If the specified dimension is a fundamental dimension or a product of fundamental

-   * dimensions the identity converter is returned; otherwise the converter from the system unit (SI) of the specified dimension to the system unit

-   * (SI) of its fundamental dimension is returned.

-   *

-   * @param dimension

-   *          the dimension for which the dimensional transform is returned.

-   * @return the dimensional transform (identity for fundamental dimensions).

-   */

-  public UnitConverter getDimensionalTransform(Dimension dimension) {

-    Map<? extends Dimension, Integer> dimensions = dimension.getBaseDimensions();

-    if (dimensions == null)

-      return AbstractConverter.IDENTITY; // Fundamental dimension.

-    // Dimensional Product.

-    UnitConverter toFundamental = AbstractConverter.IDENTITY;

-    for (Map.Entry<? extends Dimension, Integer> e : dimensions.entrySet()) {

-    	UnitConverter cvtr = this.getDimensionalTransform(e.getKey());

-      if (!(cvtr.isLinear()))

-        throw new UnsupportedOperationException("Non-linear dimensional transform");

-      int pow = e.getValue();

-      if (pow < 0) { // Negative power.

-        pow = -pow;

-        cvtr = cvtr.inverse();

-      }

-      for (int j = 0; j < pow; j++) {

-        toFundamental = toFundamental.concatenate(cvtr);

-      }

-    }

-    return toFundamental;

-  }

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DoubleQuantity.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DoubleQuantity.java
deleted file mode 100644
index d3a5a6f..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/DoubleQuantity.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import java.io.Serializable;

-import java.math.BigDecimal;

-import java.math.MathContext;

-import java.util.Objects;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-

-import org.eclipse.uomo.units.AbstractConverter;

-import org.eclipse.uomo.units.AbstractQuantity;

-import org.eclipse.uomo.units.ComparableQuantity;

-

-/**

- * An amount of quantity, implementation of {@link ComparableQuantity} that uses {@link Double} as implementation of {@link Number}, this object is

- * immutable. Note: all operations which involves {@link Number}, this implementation will convert to {@link Double}.

- *

- * @param <Q>

- *          The type of the quantity.

- * @param <Q>

- *          The type of the quantity.

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @author Otavio de Santana

- * @version 0.4, $Date: 2017-05-28 $

- * @see AbstractQuantity

- * @see Quantity

- * @see ComparableQuantity

- * @since 1.0

- */

-@SuppressWarnings({ "rawtypes", "unchecked" })

-final class DoubleQuantity<Q extends Quantity<Q>> extends AbstractQuantity<Q> implements Serializable {

-

-  private static final long serialVersionUID = 8660843078156312278L;

-

-  final double value;

-

-  public DoubleQuantity(double value, Unit<Q> unit) {

-    super(unit);

-    this.value = value;

-  }

-

-  @Override

-  public Double getValue() {

-    return value;

-  }

-

-  @Override

-  public double doubleValue(Unit<Q> unit) {

-    return (super.getUnit().equals(unit)) ? value : super.getUnit().getConverterTo(unit).convert(value);

-  }

-

-  @Override

-  public BigDecimal decimalValue(Unit<Q> unit, MathContext ctx) throws ArithmeticException {

-    BigDecimal decimal = BigDecimal.valueOf(value); // TODO check value if

-    // it is a BD, otherwise

-    // use different

-    // converter

-    return (super.getUnit().equals(unit)) ? decimal : ((AbstractConverter) super.getUnit().getConverterTo(unit)).convert(decimal, ctx);

-  }

-

-  @Override

-  public long longValue(Unit<Q> unit) {

-    double result = doubleValue(unit);

-    if ((result < Long.MIN_VALUE) || (result > Long.MAX_VALUE)) {

-      throw new ArithmeticException("Overflow (" + result + ")");

-    }

-    return (long) result;

-  }

-

-  @Override

-  public ComparableQuantity<Q> add(Quantity<Q> that) {

-    if (getUnit().equals(that.getUnit())) {

-      return Quantities.getQuantity(value + that.getValue().doubleValue(), getUnit());

-    }

-    Quantity<Q> converted = that.to(getUnit());

-    return Quantities.getQuantity(value + converted.getValue().doubleValue(), getUnit());

-  }

-

-  @Override

-  public ComparableQuantity<Q> subtract(Quantity<Q> that) {

-    if (getUnit().equals(that.getUnit())) {

-      return Quantities.getQuantity(value - that.getValue().doubleValue(), getUnit());

-    }

-    Quantity<Q> converted = that.to(getUnit());

-    return Quantities.getQuantity(value - converted.getValue().doubleValue(), getUnit());

-  }

-

-  @Override

-  public ComparableQuantity<?> multiply(Quantity<?> that) {

-    return new DoubleQuantity(value * that.getValue().doubleValue(), getUnit().multiply(that.getUnit()));

-  }

-

-  @Override

-  public ComparableQuantity<Q> multiply(Number that) {

-    return Quantities.getQuantity(value * that.doubleValue(), getUnit());

-  }

-

-  @Override

-  public ComparableQuantity<?> divide(Quantity<?> that) {

-    return new DoubleQuantity(value / that.getValue().doubleValue(), getUnit().divide(that.getUnit()));

-  }

-

-  @Override

-  public ComparableQuantity<Q> divide(Number that) {

-    return Quantities.getQuantity(value / that.doubleValue(), getUnit());

-  }

-

-  @Override

-  public AbstractQuantity<Q> inverse() {

-    return (AbstractQuantity<Q>) Quantities.getQuantity(1d / value, getUnit().inverse());

-  }

-

-  @Override

-  public boolean isBig() {

-    return false;

-  }

-

-  @Override

-  public boolean equals(Object obj) {

-    if (this == obj) {

-      return true;

-    }

-    if (obj instanceof Quantity<?>) {

-      Quantity<?> that = (Quantity<?>) obj;

-      return Objects.equals(getUnit(), that.getUnit()) && Equalizer.hasEquality(value, that.getValue());

-    }

-    return false;

-  }

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/FloatQuantity.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/FloatQuantity.java
deleted file mode 100644
index 572101d..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/FloatQuantity.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*

- * Next Generation Units of Measurement Implementation

- * Copyright (c) 2005-2017, Jean-Marie Dautelle, Werner Keil, V2COM.

- *

- * All rights reserved.

- *

- * Redistribution and use in source and binary forms, with or without modification,

- * are permitted provided that the following conditions are met:

- *

- * 1. Redistributions of source code must retain the above copyright notice,

- *    this list of conditions and the following disclaimer.

- *

- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions

- *    and the following disclaimer in the documentation and/or other materials provided with the distribution.

- *

- * 3. Neither the name of JSR-363, Indriya nor the names of their contributors may be used to endorse or promote products

- *    derived from this software without specific prior written permission.

- *

- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"

- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,

- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE

- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES

- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;

- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED

- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT

- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,

- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

- */

-package tec.units.indriya.quantity;

-

-import java.math.BigDecimal;

-import java.math.MathContext;

-import java.util.Objects;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-

-import tec.units.indriya.AbstractQuantity;

-import tec.units.indriya.ComparableQuantity;

-

-/**

- * An amount of quantity, consisting of a float and a Unit. FloatQuantity objects are immutable.

- * 

- * @see AbstractQuantity

- * @see Quantity

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @author Otavio de Santana

- * @param <Q>

- *          The type of the quantity.

- * @version 0.4, $Date: 2017-05-28 $

- * @since 1.0.7

- */

-final class FloatQuantity<Q extends Quantity<Q>> extends AbstractQuantity<Q> {

-

-  /**

-     * 

-     */

-  private static final long serialVersionUID = 5992028803791009345L;

-

-  final float value;

-

-  public FloatQuantity(float value, Unit<Q> unit) {

-    super(unit);

-    this.value = value;

-  }

-

-  @Override

-  public Float getValue() {

-    return value;

-  }

-

-  // Implements AbstractQuantity

-  public double doubleValue(Unit<Q> unit) {

-    return (super.getUnit().equals(unit)) ? value : super.getUnit().getConverterTo(unit).convert(value);

-  }

-

-  public long longValue(Unit<Q> unit) {

-    double result = doubleValue(unit);

-    if ((result < Long.MIN_VALUE) || (result > Long.MAX_VALUE)) {

-      throw new ArithmeticException("Overflow (" + result + ")");

-    }

-    return (long) result;

-  }

-

-  public Quantity<Q> add(ComparableQuantity<Q> that) {

-    final Quantity<Q> converted = that.to(getUnit());

-    return NumberQuantity.of(value + converted.getValue().floatValue(), getUnit());

-  }

-

-  public ComparableQuantity<Q> subtract(ComparableQuantity<Q> that) {

-    final Quantity<Q> converted = that.to(getUnit());

-    return NumberQuantity.of(value - converted.getValue().floatValue(), getUnit());

-  }

-

-  @SuppressWarnings({ "rawtypes", "unchecked" })

-  public ComparableQuantity<?> multiply(ComparableQuantity<?> that) {

-    return new FloatQuantity(value * that.getValue().floatValue(), getUnit().multiply(that.getUnit()));

-  }

-

-  public ComparableQuantity<Q> multiply(Number that) {

-    return NumberQuantity.of(value * that.floatValue(), getUnit().multiply(that.doubleValue()));

-  }

-

-  @SuppressWarnings({ "rawtypes", "unchecked" })

-  public ComparableQuantity<?> divide(ComparableQuantity<?> that) {

-    return new FloatQuantity(value / that.getValue().floatValue(), getUnit().divide(that.getUnit()));

-  }

-

-  @SuppressWarnings("unchecked")

-  public ComparableQuantity<Q> inverse() {

-    return (AbstractQuantity<Q>) NumberQuantity.of(1f / value, getUnit().inverse());

-  }

-

-  public ComparableQuantity<Q> divide(Number that) {

-    return NumberQuantity.of(value / that.floatValue(), getUnit());

-  }

-

-  /*

-   * (non-Javadoc)

-   * 

-   * @see AbstractQuantity#equals(java.lang.Object)

-   */

-  @Override

-  public boolean equals(Object obj) {

-    if (obj == null)

-      return false;

-    if (obj == this)

-      return true;

-    if (obj instanceof Quantity<?>) {

-      Quantity<?> that = (Quantity<?>) obj;

-      return Objects.equals(getUnit(), that.getUnit()) && Equalizer.hasEquality(value, that.getValue());

-    }

-    return false;

-  }

-

-  @Override

-  public ComparableQuantity<Q> add(Quantity<Q> that) {

-    // TODO Auto-generated method stub

-    return null;

-  }

-

-  @Override

-  public ComparableQuantity<Q> subtract(Quantity<Q> that) {

-    // TODO Auto-generated method stub

-    return null;

-  }

-

-  @Override

-  public ComparableQuantity<?> divide(Quantity<?> that) {

-    // TODO Auto-generated method stub

-    return null;

-  }

-

-  @Override

-  public ComparableQuantity<?> multiply(Quantity<?> multiplier) {

-    // TODO Auto-generated method stub

-    return null;

-  }

-

-  @Override

-  public boolean isBig() {

-    return false;

-  }

-

-  @Override

-  public BigDecimal decimalValue(Unit<Q> unit, MathContext ctx) throws ArithmeticException {

-    return BigDecimal.valueOf(value);

-  }

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/IntegerQuantity.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/IntegerQuantity.java
deleted file mode 100644
index fddf457..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/IntegerQuantity.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*

- * Next Generation Units of Measurement Implementation

- * Copyright (c) 2005-2017, Jean-Marie Dautelle, Werner Keil, V2COM.

- *

- * All rights reserved.

- *

- * Redistribution and use in source and binary forms, with or without modification,

- * are permitted provided that the following conditions are met:

- *

- * 1. Redistributions of source code must retain the above copyright notice,

- *    this list of conditions and the following disclaimer.

- *

- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions

- *    and the following disclaimer in the documentation and/or other materials provided with the distribution.

- *

- * 3. Neither the name of JSR-363, Indriya nor the names of their contributors may be used to endorse or promote products

- *    derived from this software without specific prior written permission.

- *

- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"

- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,

- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE

- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES

- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;

- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED

- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT

- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,

- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

- */

-package tec.units.indriya.quantity;

-

-import java.math.BigDecimal;

-import java.math.MathContext;

-import java.util.Objects;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-

-import tec.units.indriya.AbstractQuantity;

-import tec.units.indriya.ComparableQuantity;

-

-/**

- * An amount of quantity, consisting of an integer and a Unit. IntegerQuantity objects are immutable.

- * 

- * @see AbstractQuantity

- * @see Quantity

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @author Otavio de Santana

- * @param <Q>

- *          The type of the quantity.

- * @version 0.4, $Date: 2017-05-28 $

- * @since 1.0.7

- */

-final class IntegerQuantity<Q extends Quantity<Q>> extends AbstractQuantity<Q> {

-

-  /**

-     * 

-     */

-  private static final long serialVersionUID = 1405915111744728289L;

-

-  final int value;

-

-  public IntegerQuantity(int value, Unit<Q> unit) {

-    super(unit);

-    this.value = value;

-  }

-

-  @Override

-  public Integer getValue() {

-    return value;

-  }

-

-  public double doubleValue(Unit<Q> unit) {

-    return (super.getUnit().equals(unit)) ? value : super.getUnit().getConverterTo(unit).convert(value);

-  }

-

-  @Override

-  public long longValue(Unit<Q> unit) {

-    double result = doubleValue(unit);

-    if ((result < Long.MIN_VALUE) || (result > Long.MAX_VALUE)) {

-      throw new ArithmeticException("Overflow (" + result + ")");

-    }

-    return (long) result;

-  }

-

-  public ComparableQuantity<Q> add(Quantity<Q> that) {

-    final Quantity<Q> converted = that.to(getUnit());

-    return NumberQuantity.of(value + converted.getValue().intValue(), getUnit());

-  }

-

-  public ComparableQuantity<Q> subtract(Quantity<Q> that) {

-    final Quantity<Q> converted = that.to(getUnit());

-    return NumberQuantity.of(value - converted.getValue().intValue(), getUnit());

-  }

-

-  @SuppressWarnings({ "rawtypes", "unchecked" })

-  public ComparableQuantity<?> multiply(Quantity<?> that) {

-    return new IntegerQuantity(value * that.getValue().intValue(), getUnit().multiply(that.getUnit()));

-  }

-

-  public ComparableQuantity<Q> multiply(Number that) {

-    return NumberQuantity.of(value * that.intValue(), getUnit());

-  }

-

-  public ComparableQuantity<?> divide(Quantity<?> that) {

-    return NumberQuantity.of((double) value / that.getValue().doubleValue(), getUnit().divide(that.getUnit()));

-  }

-

-  @SuppressWarnings("unchecked")

-  public AbstractQuantity<Q> inverse() {

-    return (AbstractQuantity<Q>) NumberQuantity.of(1 / value, getUnit().inverse());

-  }

-

-  public ComparableQuantity<Q> divide(Number that) {

-    return NumberQuantity.of(value / that.doubleValue(), getUnit());

-  }

-

-  /*

-   * (non-Javadoc)

-   * 

-   * @see AbstractQuantity#equals(java.lang.Object)

-   */

-  @Override

-  public boolean equals(Object obj) {

-    if (obj == null)

-      return false;

-    if (obj == this)

-      return true;

-    if (obj instanceof Quantity<?>) {

-      Quantity<?> that = (Quantity<?>) obj;

-      return Objects.equals(getUnit(), that.getUnit()) && Equalizer.hasEquality(value, that.getValue());

-    }

-    return false;

-  }

-

-  @Override

-  public boolean isBig() {

-    return false;

-  }

-

-  @Override

-  public BigDecimal decimalValue(Unit<Q> unit, MathContext ctx) throws ArithmeticException {

-    // TODO Auto-generated method stub

-    return null;

-  }

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/LongQuantity.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/LongQuantity.java
deleted file mode 100644
index 6615ae7..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/LongQuantity.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*

- * Next Generation Units of Measurement Implementation

- * Copyright (c) 2005-2017, Jean-Marie Dautelle, Werner Keil, V2COM.

- *

- * All rights reserved.

- *

- * Redistribution and use in source and binary forms, with or without modification,

- * are permitted provided that the following conditions are met:

- *

- * 1. Redistributions of source code must retain the above copyright notice,

- *    this list of conditions and the following disclaimer.

- *

- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions

- *    and the following disclaimer in the documentation and/or other materials provided with the distribution.

- *

- * 3. Neither the name of JSR-363, Indriya nor the names of their contributors may be used to endorse or promote products

- *    derived from this software without specific prior written permission.

- *

- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"

- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,

- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE

- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES

- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;

- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED

- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT

- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,

- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

- */

-package tec.units.indriya.quantity;

-

-import java.math.BigDecimal;

-import java.math.MathContext;

-import java.util.Objects;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-

-import tec.units.indriya.AbstractQuantity;

-import tec.units.indriya.ComparableQuantity;

-

-/**

- * An amount of quantity, consisting of a long and a Unit. LongQuantity objects are immutable.

- * 

- * @see AbstractQuantity

- * @see Quantity

- * @author <a href="mailto:werner@uom.technology">Werner Keil</a>

- * @param <Q>

- *          The type of the quantity.

- * @version 0.3, $Date: 2017-05-28 $

- * @since 1.0.7

- */

-final class LongQuantity<Q extends Quantity<Q>> extends AbstractQuantity<Q> {

-

-  /**

-     * 

-     */

-  private static final long serialVersionUID = 3092808554937634365L;

-

-  final long value;

-

-  public LongQuantity(long value, Unit<Q> unit) {

-    super(unit);

-    this.value = value;

-  }

-

-  @Override

-  public Long getValue() {

-    return value;

-  }

-

-  public double doubleValue(Unit<Q> unit) {

-    return (super.getUnit().equals(unit)) ? value : super.getUnit().getConverterTo(unit).convert(value);

-  }

-

-  @Override

-  public long longValue(Unit<Q> unit) {

-    double result = doubleValue(unit);

-    if ((result < Long.MIN_VALUE) || (result > Long.MAX_VALUE)) {

-      throw new ArithmeticException("Overflow (" + result + ")");

-    }

-    return (long) result;

-  }

-

-  public ComparableQuantity<Q> add(Quantity<Q> that) {

-    final Quantity<Q> converted = that.to(getUnit());

-    return NumberQuantity.of(value + converted.getValue().longValue(), getUnit());

-  }

-

-  public ComparableQuantity<Q> subtract(Quantity<Q> that) {

-    final Quantity<Q> converted = that.to(getUnit());

-    return NumberQuantity.of(value - converted.getValue().longValue(), getUnit());

-  }

-

-  @SuppressWarnings({ "rawtypes", "unchecked" })

-  public ComparableQuantity<?> multiply(Quantity<?> that) {

-    return new LongQuantity(value * that.getValue().longValue(), getUnit());

-  }

-

-  public ComparableQuantity<Q> multiply(Number that) {

-    return NumberQuantity.of(value * that.longValue(), getUnit());

-  }

-

-  public ComparableQuantity<?> divide(Quantity<?> that) {

-    return NumberQuantity.of((double) value / that.getValue().doubleValue(), getUnit().divide(that.getUnit()));

-  }

-

-  @SuppressWarnings("unchecked")

-  public AbstractQuantity<Q> inverse() {

-    return (AbstractQuantity<Q>) NumberQuantity.of(1 / value, getUnit().inverse());

-  }

-

-  public ComparableQuantity<Q> divide(Number that) {

-    return NumberQuantity.of(value / that.doubleValue(), getUnit());

-  }

-

-  /*

-   * (non-Javadoc)

-   * 

-   * @see AbstractQuantity#equals(java.lang.Object)

-   */

-  @Override

-  public boolean equals(Object obj) {

-    if (obj == null)

-      return false;

-    if (obj == this)

-      return true;

-    if (obj instanceof Quantity<?>) {

-      Quantity<?> that = (Quantity<?>) obj;

-      return Objects.equals(getUnit(), that.getUnit()) && Equalizer.hasEquality(value, that.getValue());

-    }

-    return false;

-  }

-

-  @Override

-  public boolean isBig() {

-    return false;

-  }

-

-  @Override

-  public BigDecimal decimalValue(Unit<Q> unit, MathContext ctx) {

-    return BigDecimal.valueOf(doubleValue(unit));

-  }

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/NaturalOrder.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/NaturalOrder.java
deleted file mode 100644
index ba31676..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/NaturalOrder.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import java.util.Comparator;

-

-import javax.measure.Quantity;

-

-/**

- * Comparator to sort by natural order, looking both the unit and the value.

- * 

- * @author <a href="mailto:werner@uom.technology">Werner Keil</a>

- * @author <a href="mailto:otaviopolianasantana@gmail.com">Otavio Santana</a>

- * @version 1.0.1

- * 

- * @return <b>Given:</b>

- *         <p>

- *         Quantity&lt;Time&gt; day = Quantities.getQuantity(1, Units.DAY);

- *         </p>

- *         <p>

- *         Quantity&lt;Time&gt; hours = Quantities.getQuantity(18, Units.HOUR);

- *         </p>

- *         <p>

- *         Quantity&lt;Time&gt; minutes = Quantities.getQuantity(15, Units.HOUR);

- *         </p>

- *         <p>

- *         Quantity&lt;Time&gt; seconds = Quantities.getQuantity(100, Units.HOUR);

- *         </p>

- *         will return: seconds, minutes, hours, day

- * @since 0.7

- */

-public class NaturalOrder<T extends Quantity<T>> implements Comparator<Quantity<T>> {

-

-  @Override

-  public int compare(Quantity<T> q1, Quantity<T> q2) {

-    if (q1.getUnit().equals(q2.getUnit())) {

-      return Double.compare(q1.getValue().doubleValue(), q2.getValue().doubleValue());

-    }

-    return Double.compare(q1.getValue().doubleValue(), q2.to(q1.getUnit()).getValue().doubleValue());

-  }

-}
\ No newline at end of file
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
deleted file mode 100644
index 411a6c2..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/NumberQuantity.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import java.util.Objects;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-import javax.measure.UnconvertibleException;

-import javax.measure.UnitConverter;

-

-import org.eclipse.uomo.units.AbstractQuantity;

-import org.eclipse.uomo.units.impl.format.QuantityFormat;

-

-/**

- * An amount of quantity, consisting of a Number and a Unit. NumberQuantity objects are immutable.

- * 

- * @see AbstractQuantity

- * @see Quantity

- * @author <a href="mailto:werner@uom.technology">Werner Keil</a>

- * @param <Q>

- *          The type of the quantity.

- * @version 1.0.2, $Date: 2017-05-28 $

- * @since 0.7

- */

-public class NumberQuantity<Q extends Quantity<Q>> extends AbstractQuantity<Q> {

-

-  /**

-     * 

-     */

-  // private static final long serialVersionUID = 7312161895652321241L;

-

-  private final Number value;

-

-  /**

-   * Indicates if this quantity is exact.

-   */

-  private final boolean isExact;

-

-  /**

-   * Holds the exact value (when exact) stated in this quantity's unit.

-   */

-  // private long exactValue;

-

-  /**

-   * Holds the minimum value stated in this quantity's unit. For inexact measures: minimum < maximum

-   */

-  // private double minimum;

-

-  /**

-   * Holds the maximum value stated in this quantity's unit. For inexact measures: maximum > minimum

-   */

-  // private double maximum;

-

-  protected NumberQuantity(Number number, Unit<Q> unit) {

-    super(unit);

-    value = number;

-    isExact = false;

-  }

-

-  /*

-   * (non-Javadoc)

-   * 

-   * @see AbstractQuantity#equals(java.lang.Object)

-   */

-  @Override

-  public boolean equals(Object obj) {

-    if (obj == null)

-      return false;

-    if (obj == this)

-      return true;

-    if (obj instanceof Quantity<?>) {

-      Quantity<?> that = (Quantity<?>) obj;

-      return Objects.equals(getUnit(), that.getUnit()) && Equalizer.hasEquality(value, that.getValue());

-    }

-    return false;

-  }

-

-  /*

-   * (non-Javadoc)

-   * 

-   * @see AbstractQuantity#doubleValue(javax.measure.Unit)

-   */

-  @Override

-  public double doubleValue(Unit<Q> unit) {

-    Unit<Q> myUnit = getUnit();

-    try {

-      UnitConverter converter = myUnit.getConverterTo(unit);

-      return converter.convert(getValue().doubleValue());

-    } catch (UnconvertibleException e) {

-      throw e;

-    }

-  }

-

-  protected final int intValue(Unit<Q> unit) throws ArithmeticException {

-    long longValue = longValue(unit);

-    if ((longValue < Integer.MIN_VALUE) || (longValue > Integer.MAX_VALUE)) {

-      throw new ArithmeticException("Cannot convert " + longValue + " to int (overflow)");

-    }

-    return (int) longValue;

-  }

-

-  /*

-   * (non-Javadoc)

-   * 

-   * @see javax.measure.Quantity#getValue()

-   */

-  public Number getValue() {

-    return value;

-  }

-

-  /**

-   * Indicates if this measured quantity is exact. An exact quantity is guaranteed exact only when stated in this quantity's unit (e.g.

-   * <code>this.longValue()</code>); stating the quantity in any other unit may introduce conversion errors.

-   * 

-   * @return <code>true</code> if this quantity is exact; <code>false</code> otherwise.

-   */

-  public boolean isExact() {

-    return isExact;

-  }

-

-  @SuppressWarnings({ "rawtypes", "unchecked" })

-  protected Quantity<Q> add(AbstractQuantity<Q> that) {

-    final Quantity<Q> thatToUnit = that.to(getUnit());

-    return new NumberQuantity(this.getValue().doubleValue() + thatToUnit.getValue().doubleValue(), getUnit());

-  }

-

-  public String toString() {

-    return String.valueOf(getValue()) + " " + String.valueOf(getUnit());

-  }

-

-  @SuppressWarnings({ "rawtypes", "unchecked" })

-  public Quantity<?> multiply(Quantity<?> that) {

-    final Unit<?> unit = getUnit().multiply(that.getUnit());

-    return new NumberQuantity((getValue().doubleValue() * that.getValue().doubleValue()), unit);

-  }

-

-  public Quantity<Q> multiply(Number that) {

-    return (AbstractQuantity<Q>) NumberQuantity.of((getValue().doubleValue() * that.doubleValue()), getUnit());

-  }

-

-  @SuppressWarnings({ "rawtypes", "unchecked" })

-  public Quantity<Q> divide(Quantity<?> that) {

-    final Unit<?> unit = getUnit().divide(that.getUnit());

-    return new NumberQuantity((getValue().doubleValue() / that.getValue().doubleValue()), unit);

-  }

-

-  public Quantity<Q> divide(Number that) {

-    return NumberQuantity.of(getValue().doubleValue() / that.doubleValue(), getUnit());

-  }

-

-  @SuppressWarnings("unchecked")

-  public Quantity<Q> inverse() {

-    return (AbstractQuantity<Q>) NumberQuantity.of(1d / value.doubleValue(), getUnit().inverse());

-  }

-

-  // public Quantity<Q> inverse() {

-  // @SuppressWarnings({ "rawtypes", "unchecked" })

-  // final Quantity<Q> m = new NumberQuantity(1d / getValue().doubleValue(),

-  // getUnit().inverse());

-  // return m;

-  // }

-

-  @SuppressWarnings({ "rawtypes", "unchecked" })

-  public Quantity<Q> subtract(Quantity<Q> that) {

-    final Quantity<Q> thatToUnit = (Quantity<Q>) that.to(getUnit());

-    return new NumberQuantity(this.getValue().doubleValue() - thatToUnit.getValue().doubleValue(), getUnit());

-  }

-

-  @SuppressWarnings({ "rawtypes", "unchecked" })

-  public Quantity<Q> add(Quantity<Q> that) {

-    final Quantity<Q> thatToUnit = (Quantity<Q>) that.to(getUnit());

-    return new NumberQuantity(this.getValue().doubleValue() + thatToUnit.getValue().doubleValue(), getUnit());

-  }

-

-  /**

-   * Returns the scalar quantity for the specified <code>long</code> stated in the specified unit.

-   *

-   * @param longValue

-   *          the quantity value.

-   * @param unit

-   *          the measurement unit.

-   * @return the corresponding <code>int</code> quantity.

-   */

-  public static <Q extends Quantity<Q>> AbstractQuantity<Q> of(long longValue, Unit<Q> unit) {

-    return new LongQuantity<Q>(longValue, unit);

-  }

-

-  /**

-   * Returns the scalar quantity for the specified <code>int</code> stated in the specified unit.

-   *

-   * @param intValue

-   *          the quantity value.

-   * @param unit

-   *          the measurement unit.

-   * @return the corresponding <code>int</code> quantity.

-   */

-  public static <Q extends Quantity<Q>> AbstractQuantity<Q> of(int intValue, Unit<Q> unit) {

-    return new IntegerQuantity<Q>(intValue, unit);

-  }

-

-  /**

-   * Returns the scalar quantity for the specified <code>short</code> stated in the specified unit.

-   *

-   * @param value

-   *          the quantity value.

-   * @param unit

-   *          the measurement unit.

-   * @return the corresponding <code>short</code> quantity.

-   */

-  public static <Q extends Quantity<Q>> AbstractQuantity<Q> of(short value, Unit<Q> unit) {

-    return new ShortQuantity<Q>(value, unit);

-  }

-

-  /**

-   * Returns the scalar quantity for the specified <code>float</code> stated in the specified unit.

-   *

-   * @param floatValue

-   *          the measurement value.

-   * @param unit

-   *          the measurement unit.

-   * @return the corresponding <code>float</code> quantity.

-   */

-  public static <Q extends Quantity<Q>> AbstractQuantity<Q> of(float floatValue, Unit<Q> unit) {

-    return new FloatQuantity<Q>(floatValue, unit);

-  }

-

-  /**

-   * Returns the scalar quantity for the specified <code>double</code> stated in the specified unit.

-   *

-   * @param doubleValue

-   *          the measurement value.

-   * @param unit

-   *          the measurement unit.

-   * @return the corresponding <code>double</code> quantity.

-   */

-  public static <Q extends Quantity<Q>> AbstractQuantity<Q> of(double doubleValue, Unit<Q> unit) {

-    return new DoubleQuantity<Q>(doubleValue, unit);

-  }

-

-  /**

-   * Returns the decimal quantity of unknown type corresponding to the specified representation. This method can be used to parse dimensionless

-   * quantities.<br>

-   * <code>

-   *     Quantity&lt;Dimensionless&gt; proportion = NumberQuantity.parse("0.234").asType(Dimensionless.class);

-   * </code>

-   *

-   * <p>

-   * Note: This method handles only {@link org.eclipse.uomo.units.SimpleUnitFormat.UnitFormat#getStandard standard} unit format.

-   * </p>

-   *

-   * @param csq

-   *          the decimal value and its unit (if any) separated by space(s).

-   * @return <code>QuantityFormat.getInstance().parse(csq)</code>

-   */

-  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/ProductUnit.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/ProductUnit.java
deleted file mode 100644
index f19d812..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/ProductUnit.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import java.io.Serializable;

-import java.util.HashMap;

-import java.util.Map;

-

-import org.eclipse.uomo.units.AbstractConverter;

-import org.eclipse.uomo.units.AbstractUnit;

-import javax.measure.Quantity;

-import javax.measure.Dimension;

-import javax.measure.IncommensurableException;

-import javax.measure.UnconvertibleException;

-import javax.measure.Unit;

-import javax.measure.UnitConverter;

-

-/**

- * <p>  This class represents units formed by the product of rational powers of

- *      existing units.</p>

- *

- * <p> This class maintains the canonical form of this product (simplest form

- *     after factorization). For example: <code>METRE.pow(2).divide(METRE)</code>

- *     returns <code>METRE</code>.</p>

- *

- * @param <Q> The type of the quantity measured by this unit.

- *

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author  <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @version 1.3 ($Revision: 212 $), $Date: 2010-09-13 23:50:44 +0200 (Mo, 13 Sep 2010) $

- * @see AbstractUnit#multiply(AbstractUnit)

- * @see AbstractUnit#divide(AbstractUnit)

- * @see AbstractUnit#pow(int)

- * @see AbstractUnit#root(int)

- */

-public final class ProductUnit<Q extends Quantity<Q>> extends AbstractUnit<Q> implements Unit<Q> {

-

-    /**

-	 * For cross-version compatibility.

-	 */

-	private static final long serialVersionUID = -736056598162783537L;

-

-	/**

-     * Holds the units composing this product unit.

-     */

-    private final Element[] elements;

-

-    /**

-     * Holds the hashcode (optimization).

-     */

-    private int hashCode;

-

-    /**

-     * Default constructor (used solely to create <code>ONE</code> instance).

-     */

-    public ProductUnit() {

-        elements = new Element[0];

-    }

-

-    /**

-     * Copy constructor (allows for parameterization of product units).

-     *

-     * @param productUnit the product unit source.

-     * @throws ClassCastException if the specified unit is not a product unit.

-     */

-    public ProductUnit(Unit<?> productUnit) {

-        this.elements = ((ProductUnit<?>) productUnit).elements;

-    }

-

-    /**

-     * Product unit constructor.

-     *

-     * @param elements the product elements.

-     */

-    private ProductUnit(Element[] elements) {

-        this.elements = elements;

-    }

-

-    /**

-     * Returns the unit defined from the product of the specified elements.

-     *

-     * @param leftElems left multiplicand elements.

-     * @param rightElems right multiplicand elements.

-     * @return the corresponding unit.

-     */

-    @SuppressWarnings({ "unchecked", "rawtypes" })

-    private static Unit<?> getInstance(Element[] leftElems,

-            Element[] rightElems) {

-

-        // Merges left elements with right elements.

-        Element[] result = new Element[leftElems.length + rightElems.length];

-        int resultIndex = 0;

-        for (int i = 0; i < leftElems.length; i++) {

-            Unit<?> unit = leftElems[i].unit;

-            int p1 = leftElems[i].pow;

-            int r1 = leftElems[i].root;

-            int p2 = 0;

-            int r2 = 1;

-            for (int j = 0; j < rightElems.length; j++) {

-                if (unit.equals(rightElems[j].unit)) {

-                    p2 = rightElems[j].pow;

-                    r2 = rightElems[j].root;

-                    break; // No duplicate.

-                }

-            }

-            int pow = (p1 * r2) + (p2 * r1);

-            int root = r1 * r2;

-            if (pow != 0) {

-                int gcd = gcd(Math.abs(pow), root);

-                result[resultIndex++] = new Element(unit, pow / gcd, root / gcd);

-            }

-        }

-

-        // Appends remaining right elements not merged.

-        for (int i = 0; i < rightElems.length; i++) {

-            AbstractUnit<?> unit = (AbstractUnit<?>) rightElems[i].unit;

-            boolean hasBeenMerged = false;

-            for (int j = 0; j < leftElems.length; j++) {

-                if (unit.equals(leftElems[j].unit)) {

-                    hasBeenMerged = true;

-                    break;

-                }

-            }

-            if (!hasBeenMerged)

-                result[resultIndex++] = rightElems[i];

-        }

-

-        // Returns or creates instance.

-        if (resultIndex == 0)

-            return (Unit<?>) AbstractUnit.ONE;

-        else if ((resultIndex == 1) && (result[0].pow == result[0].root))

-            return (Unit<? extends Measure>) result[0].unit;

-        else {

-            Element[] elems = new Element[resultIndex];

-            for (int i = 0; i < resultIndex; i++) {

-                elems[i] = result[i];

-            }

-            return new ProductUnit(elems);

-        }

-    }

-

-    /**

-     * Returns the product of the specified units.

-     *

-     * @param left the left unit operand.

-     * @param right the right unit operand.

-     * @return <code>left * right</code>

-     */

-    public static Unit<?> getProductInstance(Unit<?> left,

-            Unit<?> right) {

-        Element[] leftElems;

-        if (left instanceof ProductUnit<?>)

-            leftElems = ((ProductUnit<?>) left).elements;

-        else

-            leftElems = new Element[]{new Element(left, 1, 1)};

-        Element[] rightElems;

-        if (right instanceof ProductUnit<?>)

-            rightElems = ((ProductUnit<?>) right).elements;

-        else

-            rightElems = new Element[]{new Element(right, 1, 1)};

-        return getInstance(leftElems, rightElems);

-    }

-

-    /**

-     * Returns the quotient of the specified units.

-     *

-     * @param left the dividend unit operand.

-     * @param right the divisor unit operand.

-     * @return <code>dividend / divisor</code>

-     */

-    public static Unit<?> getQuotientInstance(Unit<?> left,

-            Unit<?> right) {

-        Element[] leftElems;

-        if (left instanceof ProductUnit<?>)

-            leftElems = ((ProductUnit<?>) left).elements;

-        else

-            leftElems = new Element[]{new Element(left, 1, 1)};

-        Element[] rightElems;

-        if (right instanceof ProductUnit<?>) {

-            Element[] elems = ((ProductUnit<?>) right).elements;

-            rightElems = new Element[elems.length];

-            for (int i = 0; i < elems.length; i++) {

-                rightElems[i] = new Element(elems[i].unit, -elems[i].pow,

-                        elems[i].root);

-            }

-        } else

-            rightElems = new Element[]{new Element(right, -1, 1)};

-        return (AbstractUnit<?>) getInstance(leftElems, rightElems);

-    }

-

-    /**

-     * Returns the product unit corresponding to the specified root of the

-     * specified unit.

-     *

-     * @param unit the unit.

-     * @param n the root's order (n &gt; 0).

-     * @return <code>unit^(1/nn)</code>

-     * @throws ArithmeticException if <code>n == 0</code>.

-     */

-    public static Unit<?> getRootInstance(Unit<?> unit, int n) {

-        Element[] unitElems;

-        if (unit instanceof ProductUnit<?>) {

-            Element[] elems = ((ProductUnit<?>) unit).elements;

-            unitElems = new Element[elems.length];

-            for (int i = 0; i < elems.length; i++) {

-                int gcd = gcd(Math.abs(elems[i].pow), elems[i].root * n);

-                unitElems[i] = new Element(elems[i].unit, elems[i].pow / gcd,

-                        elems[i].root * n / gcd);

-            }

-        } else

-            unitElems = new Element[]{new Element(unit, 1, n)};

-        return getInstance(unitElems, new Element[0]);

-    }

-

-    /**

-     * Returns the product unit corresponding to this unit raised to the

-     * specified exponent.

-     *

-     * @param unit the unit.

-     * @param nn the exponent (nn &gt; 0).

-     * @return <code>unit^n</code>

-     */

-    static Unit<?> getPowInstance(AbstractUnit<?> unit, int n) {

-        Element[] unitElems;

-        if (unit instanceof ProductUnit<?>) {

-            Element[] elems = ((ProductUnit<?>) unit).elements;

-            unitElems = new Element[elems.length];

-            for (int i = 0; i < elems.length; i++) {

-                int gcd = gcd(Math.abs(elems[i].pow * n), elems[i].root);

-                unitElems[i] = new Element(elems[i].unit, elems[i].pow * n / gcd, elems[i].root / gcd);

-            }

-        } else

-            unitElems = new Element[]{new Element(unit, n, 1)};

-        return getInstance(unitElems, new Element[0]);

-    }

-

-    /**

-     * Returns the number of unit elements in this product.

-     *

-     * @return the number of unit elements.

-     */

-    public int getUnitCount() {

-        return elements.length;

-    }

-

-    /**

-     * Returns the unit element at the specified position.

-     *

-     * @param index the index of the unit element to return.

-     * @return the unit element at the specified position.

-     * @throws IndexOutOfBoundsException if index is out of range

-     *         <code>(index &lt; 0 || index &gt;= getUnitCount())</code>.

-     */

-    @SuppressWarnings("unchecked")

-	public Unit<? extends Measure> getUnit(int index) {

-        return (Unit<? extends Measure>) elements[index].getUnit();

-    }

-

-    /**

-     * Returns the power exponent of the unit element at the specified position.

-     *

-     * @param index the index of the unit element.

-     * @return the unit power exponent at the specified position.

-     * @throws IndexOutOfBoundsException if index is out of range

-     *         <code>(index &lt; 0 || index &gt;= getUnitCount())</code>.

-     */

-    public int getUnitPow(int index) {

-        return elements[index].getPow();

-    }

-

-    /**

-     * Returns the root exponent of the unit element at the specified position.

-     *

-     * @param index the index of the unit element.

-     * @return the unit root exponent at the specified position.

-     * @throws IndexOutOfBoundsException if index is out of range

-     *         <code>(index &lt; 0 || index &gt;= getUnitCount())</code>.

-     */

-    public int getUnitRoot(int index) {

-        return elements[index].getRoot();

-    }

-

-    @Override

-    public Map<Unit<?>, Integer> getProductUnits() {

-        Map<Unit<?>, Integer> units = new HashMap<Unit<?>, Integer>();

-        for (int i = 0; i < getUnitCount(); i++) {

-            units.put(getUnit(i), getUnitPow(i));

-        }

-        return units;

-    }

-

-    @Override

-    public boolean equals(Object that) {

-        if (this == that)

-            return true;

-        if (!(that instanceof ProductUnit<?>))

-            return false;

-        // Two products are equals if they have the same elements

-        // regardless of the elements' order.

-        Element[] elems = ((ProductUnit<?>) that).elements;

-        if (elements.length != elems.length)

-            return false;

-        for (int i = 0; i < elements.length; i++) {

-            boolean unitFound = false;

-            Element e = elements[i];

-            for (int j = 0; j < elems.length; j++) {

-                if (e.unit.equals(elems[j].unit))

-                    if ((e.pow != elems[j].pow) || (e.root != elems[j].root))

-                        return false;

-                    else {

-                        unitFound = true;

-                        break;

-                    }

-            }

-            if (!unitFound)

-                return false;

-        }

-        return true;

-    }

-

-    @Override

-    public int hashCode() {

-        if (this.hashCode != 0)

-            return this.hashCode;

-        int code = 0;

-        for (int i = 0; i < elements.length; i++) {

-            code += elements[i].unit.hashCode() * (elements[i].pow * 3 - elements[i].root * 2);

-        }

-        this.hashCode = code;

-        return code;

-    }

-

-    @Override

-    public final UnitConverter getConverterToMetric() {

-        if (hasOnlyUnscaledMetricUnits()) // Product of standard units is a standard unit itself.

-            return AbstractConverter.IDENTITY;

-        UnitConverter converter = AbstractConverter.IDENTITY;

-        for (int i = 0; i < elements.length; i++) {

-            Element e = elements[i];

-            @SuppressWarnings("rawtypes")

-			UnitConverter cvtr = ((AbstractUnit) e.unit).getConverterToMetric();

-            if (!(cvtr.isLinear()))

-                throw new UnsupportedOperationException(e.unit + " is non-linear, cannot convert");

-            if (e.root != 1)

-                throw new UnsupportedOperationException(e.unit + " holds a base unit with fractional exponent");

-            int pow = e.pow;

-            if (pow < 0) { // Negative power.

-                pow = -pow;

-                cvtr = cvtr.inverse();

-            }

-            for (int j = 0; j < pow; j++) {

-                converter = converter.concatenate(cvtr);

-            }

-        }

-        return converter;

-    }

-

-    /**

-     * Indicates if this product unit is a standard unit.

-     *

-     * @return <code>true</code> if all elements are standard units;

-     *         <code>false</code> otherwise.

-     */

-    private boolean hasOnlyUnscaledMetricUnits() {

-        for (int i = 0; i < elements.length; i++) {

-            AbstractUnit<?> u = (AbstractUnit<?>) elements[i].unit;

-            if (!u.isUnscaledMetric())

-                return false;

-        }

-        return true;

-    }

-

-    @Override

-    public Dimension getDimension() {

-        Dimension dimension = DimensionImpl.NONE;

-        for (int i = 0; i < this.getUnitCount(); i++) {

-            Unit<?> unit = this.getUnit(i);

-            Dimension d = unit.getDimension().pow(this.getUnitPow(i)).root(this.getUnitRoot(i));

-            dimension = dimension.multiply(d);

-        }

-        return dimension;

-    }

-

-    @Override

-    public UnitConverter getDimensionalTransform() {

-        UnitConverter converter = AbstractConverter.IDENTITY;

-        for (int i = 0; i < this.getUnitCount(); i++) {

-            AbstractUnit<?> unit = (AbstractUnit<?>) this.getUnit(i);

-            UnitConverter cvtr = unit.getDimensionalTransform();

-            if (!(cvtr.isLinear()))

-                throw new UnsupportedOperationException(cvtr.getClass() + " is non-linear, cannot convert product unit");

-            if (this.getUnitRoot(i) != 1)

-                throw new UnsupportedOperationException(this + " holds a unit with fractional exponent");

-            int pow = this.getUnitPow(i);

-            if (pow < 0) { // Negative power.

-                pow = -pow;

-                cvtr = cvtr.inverse();

-            }

-            for (int j = 0; j < pow; j++) {

-                converter = converter.concatenate(cvtr);

-            }

-        }

-        return converter;

-    }

-

-    /**

-     * Returns the greatest common divisor (Euclid's algorithm).

-     *

-     * @param m the first number.

-     * @param nn the second number.

-     * @return the greatest common divisor.

-     */

-    private static int gcd(int m, int n) {

-        if (n == 0)

-            return m;

-        else

-            return gcd(n, m % n);

-    }

-

-    /**

-     * Inner product element represents a rational power of a single unit.

-     */

-    private final static class Element implements Serializable {

-

-        /**

-         *

-         */

-        private static final long serialVersionUID = 1649532173171667701L;

-

-        /**

-         * Holds the single unit.

-         */

-        private final Unit<?> unit;

-

-        /**

-         * Holds the power exponent.

-         */

-        private final int pow;

-

-        /**

-         * Holds the root exponent.

-         */

-        private final int root;

-

-        /**

-         * Structural constructor.

-         *

-         * @param unit the unit.

-         * @param pow the power exponent.

-         * @param root the root exponent.

-         */

-        private Element(Unit<?> unit, int pow, int root) {

-            this.unit = unit;

-            this.pow = pow;

-            this.root = root;

-        }

-

-        /**

-         * Returns this element's unit.

-         *

-         * @return the single unit.

-         */

-        public Unit<?> getUnit() {

-            return unit;

-        }

-

-        /**

-         * Returns the power exponent. The power exponent can be negative but is

-         * always different from zero.

-         *

-         * @return the power exponent of the single unit.

-         */

-        public int getPow() {

-            return pow;

-        }

-

-        /**

-         * Returns the root exponent. The root exponent is always greater than

-         * zero.

-         *

-         * @return the root exponent of the single unit.

-         */

-        public int getRoot() {

-            return root;

-        }

-    }

-

-	@Override

-	public UnitConverter getConverterToAny(Unit<?> arg0) {

-        if (hasOnlyUnscaledMetricUnits()) // Product of standard units is a standard unit itself.

-            return AbstractConverter.IDENTITY;

-        UnitConverter converter = AbstractConverter.IDENTITY;

-        for (int i = 0; i < elements.length; i++) {

-            Element e = elements[i];

-            UnitConverter cvtr;

-			try {

-				cvtr = e.unit.getConverterToAny(this);

-			} catch (UnconvertibleException e1) {

-				throw e1;

-			} catch (IncommensurableException e1) {

-				throw new UnsupportedOperationException(e1);

-			}

-            if (!(cvtr.isLinear()))

-                throw new UnsupportedOperationException(e.unit + " is non-linear, cannot convert");

-            if (e.root != 1)

-                throw new UnsupportedOperationException(e.unit + " holds a base unit with fractional exponent");

-            int pow = e.pow;

-            if (pow < 0) { // Negative power.

-                pow = -pow;

-                cvtr = cvtr.inverse();

-            }

-            for (int j = 0; j < pow; j++) {

-                converter = converter.concatenate(cvtr);

-            }

-        }

-        return converter;

-	}

-

-    @SuppressWarnings("unchecked")

-	@Override

-    protected Unit<Q> toMetric() {

-        if (hasOnlyUnscaledMetricUnits())

-            return this;

-        Unit<?> systemUnit = AbstractUnit.ONE;

-        for (int i = 0; i < elements.length; i++) {

-            Unit<?> unit = elements[i].unit.getSystemUnit();

-            unit = unit.pow(elements[i].pow);

-            unit = unit.root(elements[i].root);

-            systemUnit = systemUnit.multiply(unit);

-        }

-        return (Unit<Q>) systemUnit;

-    }

-

-	@Override

-	public Unit<Q> getSystemUnit() {

-		return toMetric();

-	}

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/Quantities.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/Quantities.java
deleted file mode 100644
index 9ef8dfd..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/Quantities.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import static org.eclipse.uomo.units.impl.format.FormatBehavior.LOCALE_NEUTRAL;

-

-import java.math.BigDecimal;

-import java.math.BigInteger;

-import java.text.ParsePosition;

-import java.util.Objects;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-import javax.measure.format.ParserException;

-

-import org.eclipse.uomo.units.ComparableQuantity;

-import org.eclipse.uomo.units.impl.format.QuantityFormat;

-

-/**

- * Singleton class for accessing {@link Quantity} instances.

- * 

- * @author werner

- * @author otaviojava

- * @version 1.2, December 24, 2017

- * @since 0.7

- */

-public final class Quantities {

-	  /**

-	   * Private singleton constructor.

-	   */

-	  private Quantities() {

-	  }

-

-	  /**

-	   * Returns the {@link #valueOf(java.math.BigDecimal, javax.measure.unit.Unit) decimal} quantity of unknown type corresponding to the specified

-	   * representation. This method can be used to parse dimensionless quantities.<br/>

-	   * <code>

-	   *     Quantity<Dimensionless> proportion = Quantities.getQuantity("0.234").asType(Dimensionless.class);

-	   * </code>

-	   *

-	   * <p>

-	   * Note: This method handles only Locale-neutral quantity formatting and parsing are handled by the {@link QuantityFormat} class and its subclasses.

-	   * </p>

-	   *

-	   * @param csq

-	   *          the decimal value and its unit (if any) separated by space(s).

-	   * @return <code>QuantityFormat.getInstance(LOCALE_NEUTRAL).parse(csq, new ParsePosition(0))</code>

-	   */

-	  public static ComparableQuantity<?> getQuantity(CharSequence csq) {

-	    try {

-	      return QuantityFormat.getInstance(LOCALE_NEUTRAL).parse(csq, new ParsePosition(0));

-	    } catch (ParserException e) {

-	      throw new IllegalArgumentException(e.getParsedString());

-	    }

-	  }

-

-	  /**

-	   * Returns the scalar measurement. When the {@link Number} was {@link BigDecimal} or {@link BigInteger} will uses {@link DecimalQuantity}, when the

-	   * {@link Number} was {@link Double} will {@link DoubleQuantity} otherwise will {@link NumberQuantity}. in the specified unit.

-	   * 

-	   * @param value

-	   *          the measurement value.

-	   * @param unit

-	   *          the measurement unit.

-	   * @return the corresponding <code>numeric</code> measurement.

-	   * @throws NullPointerException

-	   *           when value or unit were null

-	   */

-	  public static <Q extends Quantity<Q>> ComparableQuantity<Q> getQuantity(Number value, Unit<Q> unit) {

-	    Objects.requireNonNull(value);

-	    Objects.requireNonNull(unit);

-	    if (Double.class.isInstance(value)) {

-	      return new DoubleQuantity<>(Double.class.cast(value), unit);

-	    } else if (BigDecimal.class.isInstance(value)) {

-	      return new DecimalQuantity<>(BigDecimal.class.cast(value), unit);

-	    } else if (BigInteger.class.isInstance(value)) {

-	      return new DecimalQuantity<>(new BigDecimal(BigInteger.class.cast(value)), unit);

-	    }

-	    return new NumberQuantity<>(value, unit);

-	  }

-	}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/QuantityFactoryImpl.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/QuantityFactoryImpl.java
deleted file mode 100644
index 4a72ea6..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/QuantityFactoryImpl.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import static org.eclipse.uomo.units.impl.system.Units.*;

-

-import java.util.HashMap;

-import java.util.Map;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-import javax.measure.quantity.*;

-import javax.measure.spi.QuantityFactory;

-

-import org.eclipse.uomo.units.AbstractUnit;

-

-/**

- * The default factory implementation. This factory provides a default implementation for every {@link AbstractQuantity} sub-type.

- *

- * For example:<br>

- * <code>

- *      Quantity&lt;Mass&gt; m = DefaultQuantityFactory.getInstance(Mass.class).create(23.0, KILOGRAM); // 23.0 kg<br>

- *      Quantity&lt;Time&gt; m = DefaultQuantityFactory.getInstance(Time.class).create(124, MILLI(SECOND)); // 124 ms

- * </code>

- * 

- * @param <Q>

- *          The type of the quantity.

- *

- * @author <a href="mailto:martin.desruisseaux@geomatys.com">Martin Desruisseaux</a>

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @version 1.0, $Date: 2016-10-04 $

- * @since 1.0

- */

-public final class QuantityFactoryImpl<Q extends Quantity<Q>> extends AbstractQuantityFactory<Q> {

-  /**

-   * The type of the quantities created by this factory.

-   */

-  @SuppressWarnings("unused")

-  private final Class<Q> type;

-

-  /**

-   * The metric unit for quantities created by this factory.

-   */

-  private final Unit<Q> metricUnit;

-

-  /**

-   * Creates a new factory for quantities of the given type.

-   *

-   * @param type

-   *          The type of the quantities created by this factory.

-   */

-  @SuppressWarnings("unchecked")

-  QuantityFactoryImpl(final Class<Q> type) {

-    this.type = type;

-    metricUnit = CLASS_TO_METRIC_UNIT.get(type);

-  }

-

-  @SuppressWarnings("rawtypes")

-  static final Map<Class, Unit> CLASS_TO_METRIC_UNIT = new HashMap<Class, Unit>();

-  static {

-    CLASS_TO_METRIC_UNIT.put(Dimensionless.class, AbstractUnit.ONE);

-    CLASS_TO_METRIC_UNIT.put(ElectricCurrent.class, AMPERE);

-    CLASS_TO_METRIC_UNIT.put(LuminousIntensity.class, CANDELA);

-    CLASS_TO_METRIC_UNIT.put(Temperature.class, KELVIN);

-    CLASS_TO_METRIC_UNIT.put(Mass.class, KILOGRAM);

-    CLASS_TO_METRIC_UNIT.put(Length.class, METRE);

-    CLASS_TO_METRIC_UNIT.put(AmountOfSubstance.class, MOLE);

-    CLASS_TO_METRIC_UNIT.put(Time.class, SECOND);

-    CLASS_TO_METRIC_UNIT.put(Angle.class, RADIAN);

-    CLASS_TO_METRIC_UNIT.put(SolidAngle.class, STERADIAN);

-    CLASS_TO_METRIC_UNIT.put(Frequency.class, HERTZ);

-    CLASS_TO_METRIC_UNIT.put(Force.class, NEWTON);

-    CLASS_TO_METRIC_UNIT.put(Pressure.class, PASCAL);

-    CLASS_TO_METRIC_UNIT.put(Energy.class, JOULE);

-    CLASS_TO_METRIC_UNIT.put(Power.class, WATT);

-    CLASS_TO_METRIC_UNIT.put(ElectricCharge.class, COULOMB);

-    CLASS_TO_METRIC_UNIT.put(ElectricPotential.class, VOLT);

-    CLASS_TO_METRIC_UNIT.put(ElectricCapacitance.class, FARAD);

-    CLASS_TO_METRIC_UNIT.put(ElectricResistance.class, OHM);

-    CLASS_TO_METRIC_UNIT.put(ElectricConductance.class, SIEMENS);

-    CLASS_TO_METRIC_UNIT.put(MagneticFlux.class, WEBER);

-    CLASS_TO_METRIC_UNIT.put(MagneticFluxDensity.class, TESLA);

-    CLASS_TO_METRIC_UNIT.put(ElectricInductance.class, HENRY);

-    CLASS_TO_METRIC_UNIT.put(LuminousFlux.class, LUMEN);

-    CLASS_TO_METRIC_UNIT.put(Illuminance.class, LUX);

-    CLASS_TO_METRIC_UNIT.put(Radioactivity.class, BECQUEREL);

-    CLASS_TO_METRIC_UNIT.put(RadiationDoseAbsorbed.class, GRAY);

-    CLASS_TO_METRIC_UNIT.put(RadiationDoseEffective.class, SIEVERT);

-    CLASS_TO_METRIC_UNIT.put(CatalyticActivity.class, KATAL);

-    CLASS_TO_METRIC_UNIT.put(Speed.class, METRE_PER_SECOND);

-    CLASS_TO_METRIC_UNIT.put(Acceleration.class, METRE_PER_SQUARE_SECOND);

-    CLASS_TO_METRIC_UNIT.put(Area.class, SQUARE_METRE);

-    CLASS_TO_METRIC_UNIT.put(Volume.class, CUBIC_METRE);

-  }

-

-  public Quantity<Q> create(Number value, Unit<Q> unit) {

-    return Quantities.getQuantity(value, unit);

-  }

-

-  public Unit<Q> getSystemUnit() {

-    return metricUnit;

-  }

-

-  /**

-   * Returns the default instance for the specified quantity type.

-   *

-   * @param <Q>

-   *          The type of the quantity

-   * @param type

-   *          the quantity type

-   * @return the quantity factory for the specified type

-   */

-  @SuppressWarnings("unchecked")

-  public static <Q extends Quantity<Q>> QuantityFactory<Q> getInstance(final Class<Q> type) {

-    logger.log(LOG_LEVEL, "Type: " + type + ": " + type.isInterface());

-    QuantityFactory<Q> factory;

-    if (!type.isInterface()) {

-      factory = new QuantityFactoryImpl<Q>(type);

-      // TODO use instances?

-    } else {

-      factory = INSTANCES.get(type);

-      if (factory != null)

-        return factory;

-      if (!Quantity.class.isAssignableFrom(type))

-        // This exception is not documented because it should never

-        // happen if the

-        // user don't try to trick the Java generic types system with

-        // unsafe cast.

-        throw new ClassCastException();

-      factory = new QuantityFactoryImpl<Q>(type);

-      setInstance(type, factory);

-    }

-    return factory;

-  }

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/StandardModel.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/StandardModel.java
deleted file mode 100644
index 1de229a..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/StandardModel.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-/**

- * Provides support for <a href="http://en.wikipedia.org/wiki/Dimensional_analysis">Dimensional Analysis</a>.

- * 

- * <p>

- * The difference between dimensional models lies in the assumptions each makes and, in consequence,the operations each permits. For example, the

- * summation of a {@link javax.measure.quantity.Length length} and a {@link org.unitsofmeasurement.quantity.Duration duration} is not allowed

- * by the standard model, but is quite valid in a relativistic context.

- * </p>

- * 

- * <p>

- * Models are {@link javolution.context.LocalContext context-local}, allowing multiple models to be used concurrently. For example:[code]

- * LocalContext.enter(); try { RelativisticModel.select(); // Affects the current thread only. ... } finally { LocalContext.exit(); }[/code]

- * </p>

- * 

- * <p>

- * The names and characteristics of the models are presented in the following table:

- * </p>

- * 

- * <table border="1" cellspacing="1">

- * <tr align="center" valign="bottom">

- * <th>Model</th>

- * <th>Class</th>

- * <th>Defining Characteristics</th>

- * <th>DefaultQuantityFactory Output CommonUnits</th>

- * </tr>

- * 

- * <tr align="left" valign="middle">

- * <td align="left">Standard</td>

- * <td align="left"><samp>"StandardModel"</samp></td>

- * <td align="left">per Syst&egrave;me Internationale</td>

- * <td align="left"><samp>Length</samp>:&nbsp;<i>m</i>;&nbsp;

- * 

- * <samp>Mass</samp>:&nbsp;<i>kg</i>;&nbsp; <samp>Duration</samp>:&nbsp;<i>s</i>;&nbsp; <samp>ElectricCurrent</samp>:&nbsp;<i>A</i>;&nbsp;

- * 

- * <samp>Temperature</samp>:&nbsp;<i>K</i>;&nbsp; <samp>AmountOfSubstance</samp>:&nbsp;<i>mol</i>;&nbsp;

- * <samp>LuminousIntensity</samp>:&nbsp;<i>cd</i>

- * 

- * </td>

- * </tr>

- * 

- * <tr align="left" valign="middle">

- * <td align="left">Relativistic</td>

- * <td align="left"><samp>"RelativisticModel"</samp></td>

- * <td align="left">1 <i>= c</i></td>

- * <td align="left"><samp>Length</samp>, <samp>Duration</samp>:&nbsp;<i>s</i>;&nbsp; <samp>Mass</samp>:&nbsp;<i>eV</i>;&nbsp;

- * <samp>ElectricCurrent</samp>:&nbsp;<i>A</i>;&nbsp;

- * 

- * <samp>Temperature</samp>:&nbsp;<i>K</i>;&nbsp; <samp>AmountOfSubstance</samp>:&nbsp;<i>mol</i>;&nbsp;

- * <samp>LuminousIntensity</samp>:&nbsp;<i>cd</i>

- * 

- * </td>

- * </tr>

- * 

- * <tr align="left" valign="middle">

- * <td align="left">High-Energy</td>

- * <td align="left"><samp>"HighEnergyModel"</samp></td>

- * <td align="left">1<i> = c<br>

- * &nbsp;&nbsp; = k<br>

- * &nbsp;&nbsp; = ePlus</i></td>

- * <td align="left"><samp>Length</samp>, <samp>Duration</samp>:&nbsp;<i>ns</i>;&nbsp; <samp>Mass</samp>,

- * <samp>Temperature</samp>:&nbsp;<i>GeV</i>;&nbsp;

- * 

- * <samp>ElectricCurrent</samp>:&nbsp;<i>1/ns</i>;&nbsp; <samp>AmountOfSubstance</samp>:&nbsp;<i>mol</i>;&nbsp;

- * <samp>LuminousIntensity</samp>:&nbsp;<i>cd</i></td>

- * </tr>

- * 

- * <tr align="left" valign="middle">

- * <td align="left">Quantum</td>

- * <td align="left"><samp>"QuantumModel"</samp></td>

- * <td align="left">1<i> = c<br>

- * &nbsp;&nbsp; = k<br>

- * &nbsp;&nbsp; = µ0<br>

- * &nbsp;&nbsp; = hBar</i></td>

- * <td align="left"><samp>Length</samp>, <samp>Duration</samp>:&nbsp;<i>1/GeV</i>;&nbsp; <samp>Mass</samp>, <samp>Temperature</samp>,

- * <samp>ElectricCurrent</samp>:&nbsp;<i>GeV</i>;&nbsp;

- * 

- * <samp>AmountOfSubstance</samp>:&nbsp;<i>mol</i>;&nbsp; <samp>LuminousIntensity</samp>:&nbsp;<i>cd</i></td>

- * </tr>

- * 

- * <tr align="left" valign="middle">

- * <td align="left">Natural</td>

- * <td align="left"><samp>"NaturalModel"</samp></td>

- * <td align="left">1<i> = c<br>

- * &nbsp;&nbsp; = k<br>

- * &nbsp;&nbsp; = µ0<br>

- * &nbsp;&nbsp; = hBar<br>

- * &nbsp;&nbsp; = G</i></td>

- * <td align="left"><samp>Length</samp>, <samp>Mass</samp>, <samp>Duration</samp>, <samp>ElectricCurrent</samp>,

- * <samp>Temperature</samp>:&nbsp;1;&nbsp; <samp>AmountOfSubstance</samp>:&nbsp;<i>mol</i>;&nbsp; <samp>LuminousIntensity</samp>:&nbsp;<i>cd</i></td>

- * </tr>

- * </table>

- * This class represents the standard model.

- *

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @version 0.8, December 21, 2017

- */

-class StandardModel extends DimensionalModel {

-

-  /**

-   * StandardModel constructor.

-   */

-  public StandardModel() {

-  }

-

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/TransformedUnit.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/TransformedUnit.java
deleted file mode 100644
index c789f64..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/TransformedUnit.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/**

- * Copyright (c) 2005, 2013, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil and others - initial API and implementation

- */

-package org.eclipse.uomo.units.impl;

-

-import org.eclipse.uomo.units.AbstractConverter;

-import org.eclipse.uomo.units.AbstractUnit;

-import javax.measure.Quantity;

-import javax.measure.unit.IncommensurableException;

-import javax.measure.unit.UnconvertibleException;

-import javax.measure.Unit;

-import javax.measure.UnitConverter;

-

-/**

- * <p>

- * This class represents the units derived from other units using

- * {@linkplain AbstractConverter converters}.

- * </p>

- * 

- * <p>

- * Examples of transformed units:[code] CELSIUS = KELVIN.add(273.15); FOOT =

- * METRE.times(3048).divide(10000); MILLISECOND = MILLI(SECOND); [/code]

- * </p>

- * 

- * <p>

- * Transformed units have no label. But like any other units, they may have

- * labels attached to them (see

- * {@link org.eclipse.uomo.units.AbstractUnitFormat.SymbolMapImpl SymbolMap}

- * </p>

- * 

- * <p>

- * Instances of this class are created through the

- * {@link AbstractUnit#transform} method.

- * </p>

- * 

- * @param <Q>

- *            The type of the quantity measured by this unit.

- * 

- * @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 ($Revision: 212 $), $Date: 2013-03-10 $

- */

-public final class TransformedUnit<Q extends Quantity<Q>> extends

-		AbstractUnit<Q> {

-

-	@Override

-	public UnitConverter getConverterToAny(Unit<?> that)

-			throws IncommensurableException, UnconvertibleException {

-		if (toParentUnit != null) {

-			return toParentUnit.inverse();

-		}

-		return super.getConverterToAny(that);

-	}

-

-	/**

-	 * For cross-version compatibility.

-	 */

-	private static final long serialVersionUID = -442449068482939939L;

-

-	/**

-	 * Holds the parent unit (not a transformed unit).

-	 */

-	private final Unit<Q> parentUnit;

-

-	/**

-	 * Holds the converter to the parent unit.

-	 */

-	private final AbstractConverter toParentUnit;

-

-	/**

-	 * Creates a transformed unit from the specified parent unit.

-	 * 

-	 * @param parentUnit

-	 *            the untransformed unit from which this unit is derived.

-	 * @param toParentUnit

-	 *            the converter to the parent units.

-	 * @throws IllegalArgumentException

-	 *             if <code>toParentUnit ==

-	 *         {@link AbstractConverter#IDENTITY UnitConverter.IDENTITY}</code>

-	 */

-	public TransformedUnit(Unit<Q> parentUnit, AbstractConverter toParentUnit) {

-		if (toParentUnit == AbstractConverter.IDENTITY)

-			throw new IllegalArgumentException("Identity not allowed");

-		this.parentUnit = parentUnit;

-		this.toParentUnit = toParentUnit;

-	}

-

-	/**

-	 * Returns the parent unit for this unit. The parent unit is the

-	 * untransformed unit from which this unit is derived.

-	 * 

-	 * @return the untransformed unit from which this unit is derived.

-	 */

-	public Unit<Q> getParentUnit() {

-		return parentUnit;

-	}

-

-	/**

-	 * Returns the converter to the parent unit.

-	 * 

-	 * @return the converter to the parent unit.

-	 */

-	public UnitConverter toParentUnit() {

-		return toParentUnit;

-	}

-

-	@Override

-	public boolean equals(Object that) {

-		if (this == that)

-			return true;

-		if (!(that instanceof TransformedUnit<?>))

-			return false;

-		TransformedUnit<?> thatUnit = (TransformedUnit<?>) that;

-		return this.parentUnit.equals(thatUnit.parentUnit)

-				&& (this.toParentUnit != null && this.toParentUnit

-						.equals(thatUnit.toParentUnit));

-	}

-

-	@Override

-	public int hashCode() {

-		return parentUnit.hashCode()

-				+ (toParentUnit != null ? toParentUnit.hashCode() : 0);

-	}

-

-	@Override

-	protected Unit<Q> toMetric() {

-		return parentUnit.getSystemUnit();

-	}

-

-	@Override

-	public UnitConverter getConverterToMetric() {

-		return ((AbstractUnit<Q>) parentUnit).getConverterToMetric()

-				.concatenate(toParentUnit);

-	}

-

-	@Override

-	public Unit<Q> getSystemUnit() {

-		return toMetric();

-	}

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/AddConverter.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/AddConverter.java
deleted file mode 100644
index 79b5006..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/AddConverter.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/**

- * Copyright (c) 2005, 2010, Werner Keil, Ikayzo 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Ikayzo and others - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.converter;

-

-import java.math.BigDecimal;

-import java.math.MathContext;

-

-import org.eclipse.uomo.units.AbstractConverter;

-import javax.measure.UnitConverter;

-

-

-/**

- * <p> This class represents a converter adding a constant offset

- *     to numeric values (<code>double</code> based).</p>

- *

- * <p> Instances of this class are immutable.</p>

- *

- * @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 ($Revision: 212 $), $Date: 2010-09-13 23:50:44 +0200 (Mo, 13 Sep 2010) $

- */

-public final class AddConverter extends AbstractConverter {

-

-    /**

-     * For cross-version compatibility.

-     */

-    private static final long serialVersionUID = 8088797685241019815L;

-

-    /**

-     * Holds the offset.

-     */

-    private final double offset;

-

-    /**

-     * Creates an add converter with the specified offset.

-     *

-     * @param  offset the offset value.

-     * @throws IllegalArgumentException if offset is <code>0.0</code>

-     *         (would result in identity converter).

-     */

-    public AddConverter(double offset) {

-        if (offset == 0.0) {

-            throw new IllegalArgumentException("Would result in identity converter");

-        }

-        this.offset = offset;

-    }

-

-    /**

-     * Returns the offset value for this add converter.

-     *

-     * @return the offset value.

-     */

-    public double getOffset() {

-        return offset;

-    }

-

-    @Override

-    public UnitConverter concatenate(UnitConverter converter) {

-        if (converter instanceof AddConverter) {

-            double newOffset = offset + ((AddConverter) converter).offset;

-            return newOffset == 0.0 ? IDENTITY : new AddConverter(newOffset);

-        } else {

-            return super.concatenate((AbstractConverter)converter);

-        }

-    }

-

-    @Override

-    public AddConverter inverse() {

-        return new AddConverter(-offset);

-    }

-

-    @Override

-    public double convert(double value) {

-        return value + offset;

-    }

-

-    @Override

-    public BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException {

-         return value.add(BigDecimal.valueOf(offset), ctx);

-    }

-

-	@Override

-	public Number convert(Number value) {

-		return BigDecimal.valueOf(value.doubleValue()).add(BigDecimal.valueOf(offset));

-	}

-

-    @Override

-    public final String toString() {

-        return "AddConverter(" + offset + ")";

-    }

-

-    @Override

-    public boolean equals(Object obj) {

-        if (!(obj instanceof AddConverter)) {

-            return false;

-        }

-        AddConverter that = (AddConverter) obj;

-        return this.offset == that.offset;

-    }

-

-    @Override

-    public int hashCode() {

-        long bits = Double.doubleToLongBits(offset);

-        return (int) (bits ^ (bits >>> 32));

-    }

-

-    @Override

-    public boolean isLinear() {

-        return false;

-    }

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/ExpConverter.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/ExpConverter.java
deleted file mode 100644
index 2885c3b..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/ExpConverter.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/**

- * Copyright (c) 2005, 2010, Werner Keil, Ikayzo 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Ikayzo and others - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.converter;

-

-import java.math.BigDecimal;

-import java.math.MathContext;

-

-import org.eclipse.uomo.units.AbstractConverter;

-

-/**

- * <p>

- * This class represents a exponential converter of limited precision. Such

- * converter is typically used to create inverse of logarithmic unit.

- * 

- * <p>

- * Instances of this class are immutable.

- * </p>

- * 

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version 1.1 ($Revision: 132 $), $Date: 2010-08-10 07:04:41 +0100 (Di, 10 Aug 2010) $

- */

-public final class ExpConverter extends AbstractConverter {

-

-	/** The serialVersionUID */

-	private static final long serialVersionUID = -1862583888012861945L;

-

-	/**

-	 * Holds the logarithmic base.

-	 */

-	private final double base;

-

-	/**

-	 * Holds the natural logarithm of the base.

-	 */

-	private final double logOfBase;

-

-	/**

-	 * Creates a logarithmic converter having the specified base.

-	 * 

-	 * @param base

-	 *            the logarithmic base (e.g. <code>Math.E</code> for the Natural

-	 *            Logarithm).

-	 */

-	public ExpConverter(double base) {

-		this.base = base;

-		this.logOfBase = Math.log(base);

-	}

-

-	/**

-	 * Returns the exponential base of this converter.

-	 * 

-	 * @return the exponential base (e.g. <code>Math.E</code> for the Natural

-	 *         Exponential).

-	 */

-	public double getBase() {

-		return base;

-	}

-

-	@Override

-	public AbstractConverter inverse() {

-		return new LogConverter(base);

-	}

-

-	@Override

-	public final String toString() {

-		return "ExpConverter(" + base + ")";

-	}

-

-	@Override

-	public boolean equals(Object obj) {

-		if (!(obj instanceof ExpConverter))

-			return false;

-		ExpConverter that = (ExpConverter) obj;

-		return this.base == that.base;

-	}

-

-	@Override

-	public int hashCode() {

-		long bits = Double.doubleToLongBits(base);

-		return (int) (bits ^ (bits >>> 32));

-	}

-

-	@Override

-	public double convert(double value) {

-		return Math.exp(logOfBase * value);

-	}

-

-	@Override

-	public BigDecimal convert(BigDecimal value, MathContext ctx)

-			throws ArithmeticException {

-		return BigDecimal.valueOf(convert(value.doubleValue())); // Reverts to

-																	// double

-																	// conversion.

-	}

-

-	@Override

-	public Number convert(Number value) {

-		if (value instanceof BigDecimal) {

-			return convert((BigDecimal) value, MathContext.DECIMAL128);

-		} else {

-			return convert(value.doubleValue());

-		}

-	}

-

-	@Override

-	public boolean isLinear() {

-		return false;

-	}

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/LogConverter.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/LogConverter.java
deleted file mode 100644
index 8f98e62..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/LogConverter.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * Copyright (c) 2005, 2010, Werner Keil, Ikayzo 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Werner Keil, Ikayzo and others - initial API and implementation
- */
-package org.eclipse.uomo.units.impl.converter;
-
-import java.math.BigDecimal;
-import java.math.MathContext;
-
-import org.eclipse.uomo.units.AbstractConverter;
-
-/**
- * <p> This class represents a logarithmic converter of limited precision.
- *     Such converter  is typically used to create logarithmic unit.
- *     For example:[code]
- *     Unit<Dimensionless> BEL = Unit.ONE.transform(new LogConverter(10).inverse());
- *     [/code]</p>
- *
- * <p> Instances of this class are immutable.</p>
- *
- * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
- * @author  <a href="mailto:uomo@catmedia.us">Werner Keil</a>
- * @version 1.4 ($Revision: 132 $), $Date: 2010-08-10 07:04:41 +0100 (Di, 10 Aug 2010) $
- */
-public final class LogConverter extends AbstractConverter {
-
-    /** The serialVersionUID */
-    private static final long serialVersionUID = -5581266460675123322L;
-
-    /**
-     * Holds the logarithmic base.
-     */
-    private final double base;
-    /**
-     * Holds the natural logarithm of the base.
-     */
-    private final double logOfBase;
-
-    /**
-     * Creates a logarithmic converter having the specified base.
-     *
-     * @param  base the logarithmic base (e.g. <code>Math.E</code> for
-     *         the Natural Logarithm).
-     */
-    public LogConverter(double base) {
-        this.base = base;
-        logOfBase = Math.log(base);
-    }
-
-    /**
-     * Returns the logarithmic base of this converter.
-     *
-     * @return the logarithmic base (e.g. <code>Math.E</code> for
-     *         the Natural Logarithm).
-     */
-    public double getBase() {
-        return base;
-    }
-
-    @Override
-    public AbstractConverter inverse() {
-        return new ExpConverter(base);
-    }
-
-    @Override
-    public final String toString() {
-        return "LogConverter("+ base + ")";
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof LogConverter))
-            return false;
-        LogConverter that = (LogConverter) obj;
-        return this.base == that.base;
-    }
-
-    @Override
-    public int hashCode() {
-        long bits = Double.doubleToLongBits(base);
-        return (int) (bits ^ (bits >>> 32));
-    }
-
-    @Override
-    public double convert(double amount) {
-        return Math.log(amount) / logOfBase;
-    }
-
-    @Override
-    public BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException {
-        return BigDecimal.valueOf(convert(value.doubleValue())); // Reverts to double conversion.
-    }
-    
-	@Override
-	public Number convert(Number value) {
-		if (value instanceof BigDecimal) {
-			return convert((BigDecimal) value, MathContext.DECIMAL128);
-		} else {
-			return convert(value.doubleValue());
-		}
-	}
-
-    @Override
-    public boolean isLinear() {
-        return false;
-    }
-}
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/MultiplyConverter.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/MultiplyConverter.java
deleted file mode 100644
index 19f652e..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/MultiplyConverter.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/**

- * Copyright (c) 2005, 2010, Werner Keil, Ikayzo 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Ikayzo and others - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.converter;

-

-import java.math.BigDecimal;

-import java.math.MathContext;

-

-import org.eclipse.uomo.units.AbstractConverter;

-import javax.measure.UnitConverter;

-

-/**

- * <p> This class represents a converter multiplying numeric values by a

- *     constant scaling factor (<code>double</code> based).</p>

- *

- * <p> Instances of this class are immutable.</p>

- *

- * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author  <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version 1.5.1 ($Revision: 212 $), $Date: 2010-09-13 23:50:44 +0200 (Mo, 13 Sep 2010) $

- */

-public final class MultiplyConverter extends AbstractConverter {

-    /** The serialVersionUID */

-    private static final long serialVersionUID = 6497743504427978825L;

-

-    /**

-     * Holds the scale factor.

-     */

-    private final double factor;

-

-    /**

-     * Creates a multiply converter with the specified scale factor.

-     *

-     * @param  factor the scaling factor.

-     * @throws IllegalArgumentException if coefficient is <code>1.0</code>

-     *        (would result in identity converter)

-     */

-    public MultiplyConverter(double factor) {

-        if (factor == 1.0)

-            throw new IllegalArgumentException("Would result in identity converter");

-        this.factor = factor;

-    }

-

-    /**

-     * Returns the scale factor of this converter.

-     *

-     * @return the scale factor.

-     */

-    public double getFactor() {

-        return factor;

-    }

-

-    @Override

-    public UnitConverter inverse() {

-        return new MultiplyConverter(1.0 / factor);

-    }

-

-    @Override

-    public double convert(double value) {

-        return value * factor;

-    }

-

-    @Override

-    public BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException {

-          return value.multiply(BigDecimal.valueOf(factor), ctx);

-    }

-    

-	@Override

-	public Number convert(Number value) {

-		if (value instanceof BigDecimal) {

-			return convert((BigDecimal) value, MathContext.DECIMAL128);

-		} else {

-			return convert(value.doubleValue());

-		}

-	}

-

-    @Override

-    public final String toString() {

-        return "MultiplyConverter("+ factor + ")";

-    }

-

-    @Override

-    public boolean equals(Object obj) {

-        if (!(obj instanceof MultiplyConverter))

-            return false;

-        MultiplyConverter that = (MultiplyConverter) obj;

-        return this.factor == that.factor;

-    }

-

-    @Override

-    public int hashCode() {

-        long bits = Double.doubleToLongBits(factor);

-    return (int)(bits ^ (bits >>> 32));

-    }

-

-    @Override

-    public boolean isLinear() {

-        return true;

-    }

-

-	@Override

-	public UnitConverter concatenate(UnitConverter converter) {

-      if (converter instanceof MultiplyConverter) {

-	      double newfactor = factor * ((MultiplyConverter) converter).factor;

-	      return newfactor == 1.0 ? IDENTITY : new MultiplyConverter(newfactor);

-      } else

-    	  return super.concatenate(converter);

-	}

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/RationalConverter.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/RationalConverter.java
deleted file mode 100644
index 6ef9bce..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/converter/RationalConverter.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/**

- * Copyright (c) 2005, 2011, Werner Keil, Ikayzo 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Ikayzo and others - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.converter;

-

-import java.math.BigDecimal;

-import java.math.BigInteger;

-import java.math.MathContext;

-

-import org.eclipse.uomo.units.AbstractConverter;

-import javax.measure.UnitConverter;

-

-/**

- * <p> This class represents a converter multiplying numeric values by an

- *     exact scaling factor (represented as the quotient of two

- *     <code>BigInteger</code> numbers).</p>

- *

- * <p> Instances of this class are immutable.</p>

- *

- * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author  <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version 1.3 ($Revision: 212 $), $Date: 2010-09-13 23:50:44 +0200 (Mo, 13 Sep 2010) $

- */

-public final class RationalConverter extends AbstractConverter {

-

-    /** The serialVersionUID */

-    private static final long serialVersionUID = 5313011404391445406L;

-

-    /**

-     * Holds the converter dividend.

-     */

-    private final BigInteger dividend;

-    /**

-     * Holds the converter divisor (always positive).

-     */

-    private final BigInteger divisor;

-

-    /**

-     * Creates a rational converter with the specified dividend and

-     * divisor.

-     *

-     * @param dividend the dividend.

-     * @param divisor the positive divisor.

-     * @throws IllegalArgumentException if <code>divisor &lt;= 0</code>

-     * @throws IllegalArgumentException if <code>dividend == divisor</code>

-     */

-    public RationalConverter(BigInteger dividend, BigInteger divisor) {

-          if (divisor.compareTo(BigInteger.ZERO) <= 0)

-            throw new IllegalArgumentException("Negative or zero divisor");

-        if (dividend.equals(divisor))

-            throw new IllegalArgumentException("Would result in identity converter");

-        this.dividend = dividend; // Exact conversion.

-        this.divisor = divisor; // Exact conversion.

-    }

-    

-    /**

-     * Creates a rational converter with the specified dividend and

-     * divisor.

-     *

-     * @param dividend the dividend.

-     * @param divisor the positive divisor.

-     * @throws IllegalArgumentException if <code>divisor &lt;= 0</code>

-     * @throws IllegalArgumentException if <code>dividend == divisor</code>

-     */

-    public RationalConverter(long dividend, long divisor) {

-    	this(BigInteger.valueOf(dividend), BigInteger.valueOf(divisor));

-    }

-

-    /**

-     * Returns the integer dividend for this rational converter.

-     *

-     * @return this converter dividend.

-     */

-    public BigInteger getDividend() {

-        return dividend;

-    }

-

-    /**

-     * Returns the integer (positive) divisor for this rational converter.

-     *

-     * @return this converter divisor.

-     */

-    public BigInteger getDivisor() {

-        return divisor;

-    }

-

-    @Override

-    public double convert(double value) {

-        return value * toDouble(dividend) / toDouble(divisor);

-    }

-

-    // Optimization of BigInteger.doubleValue() (implementation too inneficient).

-    private static double toDouble(BigInteger integer) {

-        return (integer.bitLength() < 64) ? integer.longValue() : integer.doubleValue();

-    }

-

-    @Override

-    public BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException {

-        BigDecimal decimalDividend = new BigDecimal(dividend, 0);

-        BigDecimal decimalDivisor = new BigDecimal(divisor, 0);

-        return value.multiply(decimalDividend, ctx).divide(decimalDivisor, ctx);

-    }

-

-	@Override

-	public Number convert(Number value) {

-		if (value instanceof BigDecimal) {

-			return convert((BigDecimal) value, MathContext.DECIMAL128);

-		} else {

-			return convert(value.doubleValue());

-		}

-	}

-	

-    @Override

-    public UnitConverter concatenate(UnitConverter converter) {

-        if (converter instanceof RationalConverter) {

-            RationalConverter that = (RationalConverter) converter;

-            BigInteger newDividend = this.getDividend().multiply(that.getDividend());

-            BigInteger newDivisor = this.getDivisor().multiply(that.getDivisor());

-            BigInteger gcd = newDividend.gcd(newDivisor);

-            newDividend = newDividend.divide(gcd);

-            newDivisor = newDivisor.divide(gcd);

-            return (newDividend.equals(BigInteger.ONE) && newDivisor.equals(BigInteger.ONE))

-                    ? IDENTITY : new RationalConverter(newDividend, newDivisor);

-        } else

-            return super.concatenate(converter);

-    }

-

-    @Override

-    public RationalConverter inverse() {

-        return dividend.signum() == -1 ? new RationalConverter(getDivisor().negate(), getDividend().negate())

-                : new RationalConverter(getDivisor(), getDividend());

-    }

-

-    @Override

-    public final String toString() {

-        return "RationalConverter("+ dividend +  "," + divisor + ")";

-    }

-

-    @Override

-    public boolean equals(Object obj) {

-        if (!(obj instanceof RationalConverter))

-            return false;

-        RationalConverter that = (RationalConverter) obj;

-        return this.dividend.equals(that.dividend) &&

-                this.divisor.equals(that.divisor);

-    }

-

-    @Override

-    public int hashCode() {

-        return dividend.hashCode() + divisor.hashCode();

-    }

-

-    @Override

-    public boolean isLinear() {

-        return true;

-    }

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/ext/ProxyQuantityFactory.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/ext/ProxyQuantityFactory.java
deleted file mode 100644
index 3df66c2..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/ext/ProxyQuantityFactory.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.ext;

-

-import static org.eclipse.uomo.units.impl.system.Units.*;

-

-import java.lang.reflect.InvocationHandler;

-import java.lang.reflect.Method;

-import java.lang.reflect.Proxy;

-import java.util.HashMap;

-import java.util.Map;

-import java.util.concurrent.ConcurrentHashMap;

-import java.util.logging.Level;

-import java.util.logging.Logger;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-import javax.measure.quantity.*;

-import javax.measure.spi.QuantityFactory;

-

-import org.eclipse.uomo.units.AbstractQuantity;

-import org.eclipse.uomo.units.AbstractUnit;

-

-/**

- * A factory producing simple quantities instances (tuples {@link Number}/{@link Unit}).

- *

- * For example:<br/>

- * <code>
- *      Quantity<Mass> m = ProxyQuantityFactory.getInstance(Mass.class).create(23.0, KILOGRAM); // 23.0 kg<br/>
- *      Quantity<Time> t = ProxyQuantityFactory.getInstance(Time.class).create(124, MILLI(SECOND)); // 124 ms
- * </code>

- * 

- * @param <Q>

- *          The type of the quantity.

- *

- * @author <a href="mailto:martin.desruisseaux@geomatys.com">Martin Desruisseaux</a>

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @version 1.0.1, $Date: 2017-02-12 $

- */

-public abstract class ProxyQuantityFactory<Q extends Quantity<Q>> implements QuantityFactory<Q> {

-

-  /**

-   * Holds the current instances.

-   */

-  @SuppressWarnings("rawtypes")

-  private static final Map<Class, ProxyQuantityFactory> INSTANCES = new ConcurrentHashMap<>();

-

-  private static final Logger logger = Logger.getLogger(ProxyQuantityFactory.class.getName());

-

-  private static final Level LOG_LEVEL = Level.FINE;

-

-  /**

-   * Returns the default instance for the specified quantity type.

-   *

-   * @param <Q>

-   *          The type of the quantity

-   * @param type

-   *          the quantity type

-   * @return the quantity factory for the specified type

-   */

-  @SuppressWarnings("unchecked")

-  public static <Q extends Quantity<Q>> ProxyQuantityFactory<Q> getInstance(final Class<Q> type) {

-

-    logger.log(LOG_LEVEL, "Type: " + type + ": " + type.isInterface());

-    ProxyQuantityFactory<Q> factory;

-    if (!type.isInterface()) {

-      if (type != null && type.getInterfaces() != null & type.getInterfaces().length > 0) {

-        logger.log(LOG_LEVEL, "Type0: " + type.getInterfaces()[0]);

-        Class<?> type2 = type.getInterfaces()[0];

-

-        factory = INSTANCES.get(type2);

-        if (factory != null)

-          return factory;

-        if (!AbstractQuantity.class.isAssignableFrom(type2))

-          // This exception is not documented because it should never happen if the

-          // user don't try to trick the Java generic types system with unsafe cast.

-          throw new ClassCastException();

-        factory = new Default<>((Class<Q>) type2);

-        INSTANCES.put(type2, factory);

-      } else {

-        factory = INSTANCES.get(type);

-        if (factory != null)

-          return factory;

-        if (!AbstractQuantity.class.isAssignableFrom(type))

-          // This exception is not documented because it should never happen if the

-          // user don't try to trick the Java generic types system with unsafe cast.

-          throw new ClassCastException();

-        factory = new Default<>(type);

-        INSTANCES.put(type, factory);

-      }

-    } else {

-      factory = INSTANCES.get(type);

-      if (factory != null)

-        return factory;

-      if (!Quantity.class.isAssignableFrom(type))

-        // This exception is not documented because it should never happen if the

-        // user don't try to trick the Java generic types system with unsafe cast.

-        throw new ClassCastException();

-      factory = new Default<>(type);

-      INSTANCES.put(type, factory);

-    }

-    return factory;

-  }

-

-  /**

-   * Overrides the default implementation of the factory for the specified quantity type.

-   *

-   * @param <Q>

-   *          The type of the quantity

-   * @param type

-   *          the quantity type

-   * @param factory

-   *          the quantity factory

-   */

-  protected static <Q extends Quantity<Q>> void setInstance(final Class<Q> type, ProxyQuantityFactory<Q> factory) {

-    if (!AbstractQuantity.class.isAssignableFrom(type))

-      // This exception is not documented because it should never happen if the

-      // user don't try to trick the Java generic types system with unsafe cast.

-      throw new ClassCastException();

-    INSTANCES.put(type, factory);

-  }

-

-  /**

-   * Returns the metric unit for quantities produced by this factory or <code>null</code> if unknown.

-   *

-   * @return the metric units for this factory quantities.

-   */

-  public abstract Unit<Q> getSystemUnit();

-

-  /**

-   * The default factory implementation. This factory uses reflection for providing a default implementation for every {@link AbstractMeasurement}

-   * sub-types.

-   *

-   * @param <Q>

-   *          The type of the quantity

-   */

-  private static final class Default<Q extends Quantity<Q>> extends ProxyQuantityFactory<Q> {

-

-    /**

-     * The type of the quantities created by this factory.

-     */

-    private final Class<Q> type;

-

-    /**

-     * The metric unit for quantities created by this factory.

-     */

-    private final Unit<Q> metricUnit;

-

-    /**

-     * Creates a new factory for quantities of the given type.

-     *

-     * @param type

-     *          The type of the quantities created by this factory.

-     */

-    @SuppressWarnings("unchecked")

-    Default(final Class<Q> type) {

-      this.type = type;

-      metricUnit = CLASS_TO_METRIC_UNIT.get(type);

-    }

-

-    @SuppressWarnings("rawtypes")

-    static final HashMap<Class, Unit> CLASS_TO_METRIC_UNIT = new HashMap<>();

-    static {

-      CLASS_TO_METRIC_UNIT.put(Dimensionless.class, AbstractUnit.ONE);

-      CLASS_TO_METRIC_UNIT.put(ElectricCurrent.class, AMPERE);

-      CLASS_TO_METRIC_UNIT.put(LuminousIntensity.class, CANDELA);

-      CLASS_TO_METRIC_UNIT.put(Temperature.class, KELVIN);

-      CLASS_TO_METRIC_UNIT.put(Mass.class, KILOGRAM);

-      CLASS_TO_METRIC_UNIT.put(Length.class, METRE);

-      CLASS_TO_METRIC_UNIT.put(AmountOfSubstance.class, MOLE);

-      CLASS_TO_METRIC_UNIT.put(Time.class, SECOND);

-      // CLASS_TO_METRIC_UNIT.put(MagnetomotiveForce.class, AMPERE_TURN);

-      CLASS_TO_METRIC_UNIT.put(Angle.class, RADIAN);

-      CLASS_TO_METRIC_UNIT.put(SolidAngle.class, STERADIAN);

-      // CLASS_TO_METRIC_UNIT.put(Information.class, BIT);

-      CLASS_TO_METRIC_UNIT.put(Frequency.class, HERTZ);

-      CLASS_TO_METRIC_UNIT.put(Force.class, NEWTON);

-      CLASS_TO_METRIC_UNIT.put(Pressure.class, PASCAL);

-      CLASS_TO_METRIC_UNIT.put(Energy.class, JOULE);

-      CLASS_TO_METRIC_UNIT.put(Power.class, WATT);

-      CLASS_TO_METRIC_UNIT.put(ElectricCharge.class, COULOMB);

-      CLASS_TO_METRIC_UNIT.put(ElectricPotential.class, VOLT);

-      CLASS_TO_METRIC_UNIT.put(ElectricCapacitance.class, FARAD);

-      CLASS_TO_METRIC_UNIT.put(ElectricResistance.class, OHM);

-      CLASS_TO_METRIC_UNIT.put(ElectricConductance.class, SIEMENS);

-      CLASS_TO_METRIC_UNIT.put(MagneticFlux.class, WEBER);

-      CLASS_TO_METRIC_UNIT.put(MagneticFluxDensity.class, TESLA);

-      CLASS_TO_METRIC_UNIT.put(ElectricInductance.class, HENRY);

-      CLASS_TO_METRIC_UNIT.put(LuminousFlux.class, LUMEN);

-      CLASS_TO_METRIC_UNIT.put(Illuminance.class, LUX);

-      CLASS_TO_METRIC_UNIT.put(Radioactivity.class, BECQUEREL);

-      CLASS_TO_METRIC_UNIT.put(RadiationDoseAbsorbed.class, GRAY);

-      CLASS_TO_METRIC_UNIT.put(RadiationDoseEffective.class, SIEVERT);

-      CLASS_TO_METRIC_UNIT.put(CatalyticActivity.class, KATAL);

-      CLASS_TO_METRIC_UNIT.put(Speed.class, METRE_PER_SECOND);

-      CLASS_TO_METRIC_UNIT.put(Acceleration.class, METRE_PER_SQUARE_SECOND);

-      CLASS_TO_METRIC_UNIT.put(Area.class, SQUARE_METRE);

-      CLASS_TO_METRIC_UNIT.put(Volume.class, CUBIC_METRE);

-    }

-

-    @Override

-    public Unit<Q> getSystemUnit() {

-      return metricUnit;

-    }

-

-    @SuppressWarnings("unchecked")

-    @Override

-    public Quantity<Q> create(Number value, Unit<Q> unit) {

-      // System.out.println("Type: " + type);

-      return (Q) Proxy.newProxyInstance(type.getClassLoader(), new Class<?>[] { type }, new GenericHandler<>(value, unit));

-    }

-  }

-

-  /**

-   * The method invocation handler for implementation backed by any kind of {@link Number}. This is a fall back used when no specialized handler is

-   * available for the number type.

-   */

-  private static final class GenericHandler<Q extends Quantity<Q>> implements InvocationHandler {

-    final Unit<Q> unit;

-    final Number value;

-

-    GenericHandler(final Number value, final Unit<Q> unit) {

-      this.unit = unit;

-      this.value = value;

-    }

-

-    @SuppressWarnings("unchecked")

-    @Override

-    public Object invoke(final Object proxy, final Method method, final Object[] args) {

-      final String name = method.getName();

-      switch (name) {

-        case "doubleValue": { // Most frequent.

-          final Unit<Q> toUnit = (Unit<Q>) args[0];

-          if ((toUnit == unit) || (toUnit.equals(unit)))

-            return value.doubleValue(); // Returns value directly.

-          return unit.getConverterTo(toUnit).convert(value.doubleValue());

-        }

-        case "longValue": {

-          final Unit<Q> toUnit = (Unit<Q>) args[0];

-          if ((toUnit == unit) || (toUnit.equals(unit)))

-            return value.longValue(); // Returns value directly.

-          double doubleValue = unit.getConverterTo(toUnit).convert(value.doubleValue());

-          if ((doubleValue < Long.MIN_VALUE) || (doubleValue > Long.MAX_VALUE))

-            throw new ArithmeticException("Overflow: " + doubleValue + " cannot be represented as a long");

-          return (long) doubleValue;

-        }

-        case "getValue":

-          return value;

-        case "getUnit":

-          return unit;

-        case "toString":

-          return String.valueOf(value) + ' ' + unit;

-        case "hashCode":

-          return value.hashCode() * 31 + unit.hashCode();

-        case "equals": {

-          final Object obj = args[0];

-          if (!(obj instanceof AbstractQuantity))

-            return false;

-          final AbstractQuantity<Q> that = (AbstractQuantity<Q>) obj;

-          return unit.isCompatible((AbstractUnit<?>) that.getUnit()) && value.doubleValue() == (that).doubleValue(unit);

-        }

-        case "compareTo": {

-          final AbstractQuantity<Q> that = (AbstractQuantity<Q>) args[0];

-          return Double.compare(value.doubleValue(), that.doubleValue(unit));

-        }

-        default:

-          throw new UnsupportedOperationException(name);

-      }

-    }

-  }

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/DefaultCharStream.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/DefaultCharStream.java
deleted file mode 100644
index f8a10a3..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/DefaultCharStream.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.format;

-

-/**

- * An implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (without unicode processing).

- *

- * @version 5.1, December 25, 2013

- */

-

-final class DefaultCharStream {

-  /** Whether parser is static. */

-  public static final boolean staticFlag = false;

-  int bufsize;

-  int available;

-  int tokenBegin;

-  /** Position in buffer. */

-  public int bufpos = -1;

-  protected int bufline[];

-  protected int bufcolumn[];

-

-  protected int column = 0;

-  protected int line = 1;

-

-  protected boolean prevCharIsCR = false;

-  protected boolean prevCharIsLF = false;

-

-  protected java.io.Reader inputStream;

-

-  protected char[] buffer;

-  protected int maxNextCharInd = 0;

-  protected int inBuf = 0;

-  protected int tabSize = 8;

-

-  protected void setTabSize(int i) {

-    tabSize = i;

-  }

-

-  protected int getTabSize() {

-    return tabSize;

-  }

-

-  protected void ExpandBuff(boolean wrapAround) {

-    char[] newbuffer = new char[bufsize + 2048];

-    int newbufline[] = new int[bufsize + 2048];

-    int newbufcolumn[] = new int[bufsize + 2048];

-

-    try {

-      if (wrapAround) {

-        System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);

-        System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);

-        buffer = newbuffer;

-

-        System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);

-        System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);

-        bufline = newbufline;

-

-        System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);

-        System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);

-        bufcolumn = newbufcolumn;

-

-        maxNextCharInd = (bufpos += (bufsize - tokenBegin));

-      } else {

-        System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);

-        buffer = newbuffer;

-

-        System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);

-        bufline = newbufline;

-

-        System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);

-        bufcolumn = newbufcolumn;

-

-        maxNextCharInd = (bufpos -= tokenBegin);

-      }

-    } catch (Throwable t) {

-      throw new Error(t.getMessage());

-    }

-

-    bufsize += 2048;

-    available = bufsize;

-    tokenBegin = 0;

-  }

-

-  protected void FillBuff() throws java.io.IOException {

-    if (maxNextCharInd == available) {

-      if (available == bufsize) {

-        if (tokenBegin > 2048) {

-          bufpos = maxNextCharInd = 0;

-          available = tokenBegin;

-        } else if (tokenBegin < 0)

-          bufpos = maxNextCharInd = 0;

-        else

-          ExpandBuff(false);

-      } else if (available > tokenBegin)

-        available = bufsize;

-      else if ((tokenBegin - available) < 2048)

-        ExpandBuff(true);

-      else

-        available = tokenBegin;

-    }

-

-    int i;

-    try {

-      if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1) {

-        inputStream.close();

-        throw new java.io.IOException();

-      } else

-        maxNextCharInd += i;

-    } catch (java.io.IOException e) {

-      --bufpos;

-      backup(0);

-      if (tokenBegin == -1)

-        tokenBegin = bufpos;

-      throw e;

-    }

-  }

-

-  /** Start. */

-  public char BeginToken() throws java.io.IOException {

-    tokenBegin = -1;

-    char c = readChar();

-    tokenBegin = bufpos;

-

-    return c;

-  }

-

-  protected void UpdateLineColumn(char c) {

-    column++;

-

-    if (prevCharIsLF) {

-      prevCharIsLF = false;

-      line += (column = 1);

-    } else if (prevCharIsCR) {

-      prevCharIsCR = false;

-      if (c == '\n') {

-        prevCharIsLF = true;

-      } else

-        line += (column = 1);

-    }

-

-    switch (c) {

-      case '\r':

-        prevCharIsCR = true;

-        break;

-      case '\n':

-        prevCharIsLF = true;

-        break;

-      case '\t':

-        column--;

-        column += (tabSize - (column % tabSize));

-        break;

-      default:

-        break;

-    }

-

-    bufline[bufpos] = line;

-    bufcolumn[bufpos] = column;

-  }

-

-  /** Read a character. */

-  public char readChar() throws java.io.IOException {

-    if (inBuf > 0) {

-      --inBuf;

-

-      if (++bufpos == bufsize)

-        bufpos = 0;

-

-      return buffer[bufpos];

-    }

-

-    if (++bufpos >= maxNextCharInd)

-      FillBuff();

-

-    char c = buffer[bufpos];

-

-    UpdateLineColumn(c);

-    return c;

-  }

-

-  @Deprecated

-  /**

-   * @deprecated

-   * @see #getEndColumn

-   */

-  public int getColumn() {

-    return bufcolumn[bufpos];

-  }

-

-  @Deprecated

-  /**

-   * @deprecated

-   * @see #getEndLine

-   */

-  public int getLine() {

-    return bufline[bufpos];

-  }

-

-  /** Get token end column number. */

-  public int getEndColumn() {

-    return bufcolumn[bufpos];

-  }

-

-  /** Get token end line number. */

-  public int getEndLine() {

-    return bufline[bufpos];

-  }

-

-  /** Get token beginning column number. */

-  public int getBeginColumn() {

-    return bufcolumn[tokenBegin];

-  }

-

-  /** Get token beginning line number. */

-  public int getBeginLine() {

-    return bufline[tokenBegin];

-  }

-

-  /** Backup a number of characters. */

-  public void backup(int amount) {

-

-    inBuf += amount;

-    if ((bufpos -= amount) < 0)

-      bufpos += bufsize;

-  }

-

-  /** Constructor. */

-  public DefaultCharStream(java.io.Reader dstream, int startline, int startcolumn, int buffersize) {

-    inputStream = dstream;

-    line = startline;

-    column = startcolumn - 1;

-

-    available = bufsize = buffersize;

-    buffer = new char[buffersize];

-    bufline = new int[buffersize];

-    bufcolumn = new int[buffersize];

-  }

-

-  /** Constructor. */

-  public DefaultCharStream(java.io.Reader dstream, int startline, int startcolumn) {

-    this(dstream, startline, startcolumn, 4096);

-  }

-

-  /** Constructor. */

-  public DefaultCharStream(java.io.Reader dstream) {

-    this(dstream, 1, 1, 4096);

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.Reader dstream, int startline, int startcolumn, int buffersize) {

-    inputStream = dstream;

-    line = startline;

-    column = startcolumn - 1;

-

-    if (buffer == null || buffersize != buffer.length) {

-      available = bufsize = buffersize;

-      buffer = new char[buffersize];

-      bufline = new int[buffersize];

-      bufcolumn = new int[buffersize];

-    }

-    prevCharIsLF = prevCharIsCR = false;

-    tokenBegin = inBuf = maxNextCharInd = 0;

-    bufpos = -1;

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.Reader dstream, int startline, int startcolumn) {

-    ReInit(dstream, startline, startcolumn, 4096);

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.Reader dstream) {

-    ReInit(dstream, 1, 1, 4096);

-  }

-

-  /** Constructor. */

-  public DefaultCharStream(java.io.InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)

-      throws java.io.UnsupportedEncodingException {

-    this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn,

-        buffersize);

-  }

-

-  /** Constructor. */

-  public DefaultCharStream(java.io.InputStream dstream, int startline, int startcolumn, int buffersize) {

-    this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);

-  }

-

-  /** Constructor. */

-  public DefaultCharStream(java.io.InputStream dstream, String encoding, int startline, int startcolumn) throws java.io.UnsupportedEncodingException {

-    this(dstream, encoding, startline, startcolumn, 4096);

-  }

-

-  /** Constructor. */

-  public DefaultCharStream(java.io.InputStream dstream, int startline, int startcolumn) {

-    this(dstream, startline, startcolumn, 4096);

-  }

-

-  /** Constructor. */

-  public DefaultCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException {

-    this(dstream, encoding, 1, 1, 4096);

-  }

-

-  /** Constructor. */

-  public DefaultCharStream(java.io.InputStream dstream) {

-    this(dstream, 1, 1, 4096);

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)

-      throws java.io.UnsupportedEncodingException {

-    ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn,

-        buffersize);

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.InputStream dstream, int startline, int startcolumn, int buffersize) {

-    ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException {

-    ReInit(dstream, encoding, 1, 1, 4096);

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.InputStream dstream) {

-    ReInit(dstream, 1, 1, 4096);

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.InputStream dstream, String encoding, int startline, int startcolumn) throws java.io.UnsupportedEncodingException {

-    ReInit(dstream, encoding, startline, startcolumn, 4096);

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.InputStream dstream, int startline, int startcolumn) {

-    ReInit(dstream, startline, startcolumn, 4096);

-  }

-

-  /** Get token literal value. */

-  public String GetImage() {

-    if (bufpos >= tokenBegin)

-      return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);

-    else

-      return new String(buffer, tokenBegin, bufsize - tokenBegin) + new String(buffer, 0, bufpos + 1);

-  }

-

-  /** Get the suffix. */

-  public char[] GetSuffix(int len) {

-    char[] ret = new char[len];

-

-    if ((bufpos + 1) >= len)

-      System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);

-    else {

-      System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, len - bufpos - 1);

-      System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);

-    }

-

-    return ret;

-  }

-

-  /** Reset buffer when finished. */

-  public void Done() {

-    buffer = null;

-    bufline = null;

-    bufcolumn = null;

-  }

-

-  /**

-   * Method to adjust line and column numbers for the start of a token.

-   */

-  public void adjustBeginLineColumn(int newLine, int newCol) {

-    int start = tokenBegin;

-    int len;

-

-    if (bufpos >= tokenBegin) {

-      len = bufpos - tokenBegin + inBuf + 1;

-    } else {

-      len = bufsize - tokenBegin + bufpos + 1 + inBuf;

-    }

-

-    int i = 0, j = 0, k = 0;

-    int nextColDiff = 0, columnDiff = 0;

-

-    while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) {

-      bufline[j] = newLine;

-      nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];

-      bufcolumn[j] = newCol + columnDiff;

-      columnDiff = nextColDiff;

-      i++;

-    }

-

-    if (i < len) {

-      bufline[j] = newLine++;

-      bufcolumn[j] = newCol + columnDiff;

-

-      while (i++ < len) {

-        if (bufline[j = start % bufsize] != bufline[++start % bufsize])

-          bufline[j] = newLine++;

-        else

-          bufline[j] = newLine;

-      }

-    }

-

-    line = bufline[j];

-    column = bufcolumn[j];

-  }

-

-}

-/*

- * JavaCC - OriginalChecksum=ec4e178f3ccf05ea2ca32d15e09312ca (do not edit this

- * line)

- */

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/FormatBehavior.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/FormatBehavior.java
deleted file mode 100644
index a5c1852..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/FormatBehavior.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.format;

-

-/**

- * Defines different ways of formatting.

- * 

- * @author Werner Keil

- * @version 1.0

- * @since 0.7

- */

-public enum FormatBehavior {

-

-  /**

-   * Formatting occurs in a locale-neutral way.

-   * 

-   */

-  LOCALE_NEUTRAL,

-

-  /**

-   * Formatting occurs in a locale-sensitive way.

-   * 

-   * @see java.util.Locale

-   */

-  LOCALE_SENSITIVE

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/LocalUnitFormat.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/LocalUnitFormat.java
deleted file mode 100644
index c029bb3..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/LocalUnitFormat.java
+++ /dev/null
@@ -1,599 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Eric Russell - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.format;

-

-import static org.eclipse.uomo.units.SI.CUBIC_METRE;

-import static org.eclipse.uomo.units.SI.GRAM;

-import static org.eclipse.uomo.units.SI.KILOGRAM;

-import static org.eclipse.uomo.units.impl.system.USCustomary.LITER;

-

-import java.io.IOException;

-import java.io.StringReader;

-import java.math.BigInteger;

-import java.text.FieldPosition;

-import java.text.ParsePosition;

-import java.util.Formattable;

-import java.util.Formatter;

-import java.util.Locale;

-import java.util.Map;

-import java.util.ResourceBundle;

-

-import org.eclipse.uomo.units.AbstractConverter;

-import org.eclipse.uomo.units.AbstractConverter.Compound;

-import org.eclipse.uomo.units.AbstractUnitFormat;

-import org.eclipse.uomo.units.AbstractUnit;

-import org.eclipse.uomo.units.SymbolMap;

-import org.eclipse.uomo.units.impl.AnnotatedUnit;

-import org.eclipse.uomo.units.impl.BaseUnit;

-import org.eclipse.uomo.units.impl.TransformedUnit;

-import org.eclipse.uomo.units.impl.converter.AddConverter;

-import org.eclipse.uomo.units.impl.converter.ExpConverter;

-import org.eclipse.uomo.units.impl.converter.LogConverter;

-import org.eclipse.uomo.units.impl.converter.MultiplyConverter;

-import org.eclipse.uomo.units.impl.converter.RationalConverter;

-import org.eclipse.uomo.units.Messages;

-import javax.measure.Unit;

-import javax.measure.UnitConverter;

-

-/**

- * <p>

- * This class represents the local sensitive format.

- * </p>

- *

- * <h3>Here is the grammar for CommonUnits in Extended Backus-Naur Form (EBNF)</h3>

- * <p>

- * Note that the grammar has been left-factored to be suitable for use by a top-down parser generator such as <a

- * href="https://javacc.dev.java.net/">JavaCC</a>

- * </p>

- * <table width="90%" * align="center">

- * <tr>

- * <th colspan="3" align="left">Lexical Entities:</th>

- * </tr>

- * <tr valign="top">

- * <td>&lt;sign&gt;</td>

- * <td>:=</td>

- * <td>"+" | "-"</td>

- * </tr>

- * <tr valign="top">

- * <td>&lt;digit&gt;</td>

- * <td>:=</td>

- * <td>"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"</td>

- * </tr>

- * <tr valign="top">

- * <td>&lt;superscript_digit&gt;</td>

- * <td>:=</td>

- * <td>"⁰" | "¹" | "²" | "³" | "⁴" | "⁵" | "⁶" | "⁷" | "⁸" | "⁹"</td>

- * </tr>

- * <tr valign="top">

- * <td>&lt;integer&gt;</td>

- * <td>:=</td>

- * <td>(&lt;digit&gt;)+</td>

- * </tr>

- * <tr * valign="top">

- * <td>&lt;number&gt;</td>

- * <td>:=</td>

- * <td>(&lt;sign&gt;)? (&lt;digit&gt;)* (".")? (&lt;digit&gt;)+ (("e" | "E") (&lt;sign&gt;)? (&lt;digit&gt;)+)?</td>

- * </tr>

- * <tr valign="top">

- * <td>&lt;exponent&gt;</td>

- * <td>:=</td>

- * <td>( "^" ( &lt;sign&gt; )? &lt;integer&gt; ) <br>

- * | ( "^(" (&lt;sign&gt;)? &lt;integer&gt; ( "/" (&lt;sign&gt;)? &lt;integer&gt; )? ")" ) <br>

- * | ( &lt;superscript_digit&gt; )+</td>

- * </tr>

- * <tr valign="top">

- * <td>&lt;initial_char&gt;</td>

- * <td>:=</td>

- * <td>? Any Unicode character excluding the following: ASCII control & whitespace (&#92;u0000 - &#92;u0020), decimal digits '0'-'9', '('

- * (&#92;u0028), ')' (&#92;u0029), '*' (&#92;u002A), '+' (&#92;u002B), '-' (&#92;u002D), '.' (&#92;u002E), '/' (&#92;u005C), ':' (&#92;u003A), '^'

- * (&#92;u005E), '²' (&#92;u00B2), '³' (&#92;u00B3), '·' (&#92;u00B7), '¹' (&#92;u00B9), '⁰' (&#92;u2070), '⁴' (&#92;u2074), '⁵' (&#92;u2075), '⁶'

- * (&#92;u2076), '⁷' (&#92;u2077), '⁸' (&#92;u2078), '⁹' (&#92;u2079) ?</td>

- * </tr>

- * <tr valign="top">

- * <td>&lt;unit_identifier&gt;</td>

- * <td>:=</td>

- * <td>&lt;initial_char&gt; ( &lt;initial_char&gt; | &lt;digit&gt; )*</td>

- * </tr>

- * <tr>

- * <th colspan="3" align="left">Non-Terminals:</th>

- * </tr>

- * <tr * valign="top">

- * <td>&lt;unit_expr&gt;</td>

- * <td>:=</td>

- * <td>&lt;compound_expr&gt;</td>

- * </tr>

- * <tr valign="top">

- * <td>&lt;compound_expr&gt;</td>

- * <td>:=</td>

- * <td>&lt;add_expr&gt; ( ":" &lt;add_expr&gt; )*</td>

- * </tr>

- * <tr valign="top">

- * <td>&lt;add_expr&gt;</td>

- * <td>:=</td>

- * <td>( &lt;number&gt; &lt;sign&gt; )? &lt;mul_expr&gt; ( &lt;sign&gt; &lt;number&gt; )?</td>

- * </tr>

- * <tr valign="top">

- * <td>&lt;mul_expr&gt;</td>

- * <td>:=</td>

- * <td>&lt;exponent_expr&gt; ( ( ( "*" | "·" ) &lt;exponent_expr&gt; ) | ( "/" &lt;exponent_expr&gt; ) )*</td>

- * </tr>

- * <tr valign="top">

- * <td>&lt;exponent_expr&gt;</td>

- * <td>:=</td>

- * <td>( &lt;atomic_expr&gt; ( &lt;exponent&gt; )? ) <br>

- * | (&lt;integer&gt; "^" &lt;atomic_expr&gt;) <br>

- * | ( ( "log" ( &lt;integer&gt; )? ) | "ln" ) "(" &lt;add_expr&gt; ")" )</td>

- * </tr>

- * <tr valign="top">

- * <td>&lt;atomic_expr&gt;</td>

- * <td>:=</td>

- * <td>&lt;number&gt; <br>

- * | &lt;unit_identifier&gt; <br>

- * | ( "(" &lt;add_expr&gt; ")" )</td>

- * </tr>

- * </table>

- *

- * @author <a href="mailto:eric-r@northwestern.edu">Eric Russell</a>

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @version 1.0.2, April 30, 2017

- * @since 1.0

- */

-public class LocalUnitFormat extends AbstractUnitFormat {

-

-  // ////////////////////////////////////////////////////

-  // Class variables //

-  // ////////////////////////////////////////////////////

-  /**

-   * DefaultQuantityFactory locale instance. If the default locale is changed after the class is initialized, this instance will no longer be used.

-   */

-  private static final LocalUnitFormat DEFAULT_INSTANCE = new LocalUnitFormat(SymbolMap.of(ResourceBundle.getBundle(LocalUnitFormat.class

-      .getPackage().getName() + ".messages")));

-  /**

-   * Multiplicand character

-   */

-  private static final char MIDDLE_DOT = '\u00b7';

-  /**

-   * Operator precedence for the addition and subtraction operations

-   */

-  private static final int ADDITION_PRECEDENCE = 0;

-  /**

-   * Operator precedence for the multiplication and division operations

-   */

-  private static final int PRODUCT_PRECEDENCE = ADDITION_PRECEDENCE + 2;

-  /**

-   * Operator precedence for the exponentiation and logarithm operations

-   */

-  private static final int EXPONENT_PRECEDENCE = PRODUCT_PRECEDENCE + 2;

-  /**

-   * Operator precedence for a unit identifier containing no mathematical operations (i.e., consisting exclusively of an identifier and possibly a

-   * prefix). Defined to be <code>Integer.MAX_VALUE</code> so that no operator can have a higher precedence.

-   */

-  private static final int NOOP_PRECEDENCE = Integer.MAX_VALUE;

-

-  // /////////////////

-  // Class methods //

-  // /////////////////

-  /**

-   * Returns the instance for the current default locale (non-ascii characters are allowed)

-   */

-  public static LocalUnitFormat getInstance() {

-    return DEFAULT_INSTANCE;

-  }

-

-  /**

-   * Returns an instance for the given locale.

-   * 

-   * @param locale

-   */

-  public static LocalUnitFormat getInstance(Locale locale) {

-    return new LocalUnitFormat(SymbolMap.of(ResourceBundle.getBundle(LocalUnitFormat.class.getPackage().getName() + ".messages", locale)));

-  }

-

-  /** Returns an instance for the given symbol map. */

-  public static LocalUnitFormat getInstance(SymbolMap symbols) {

-    return new LocalUnitFormat(symbols);

-  }

-

-  // //////////////////////

-  // Instance variables //

-  // //////////////////////

-  /**

-   * The symbol map used by this instance to map between {@link Unit Unit}s and <code>String</code>s, etc...

-   */

-  private final transient SymbolMap symbolMap;

-

-  // ////////////////

-  // Constructors //

-  // ////////////////

-  /**

-   * Base constructor.

-   *

-   * @param symbols

-   *          the symbol mapping.

-   */

-  private LocalUnitFormat(SymbolMap symbols) {

-    symbolMap = symbols;

-  }

-

-  // //////////////////////

-  // Instance methods //

-  // //////////////////////

-  /**

-   * 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;

-  }

-

-  // //////////////

-  // Formatting //

-  // //////////////

-  @Override

-  public Appendable format(Unit<?> unit, Appendable appendable) throws IOException {

-    if (!(unit instanceof AbstractUnit)) {

-      return appendable.append(unit.toString()); // Unknown unit (use

-      // intrinsic toString()

-      // method)

-    }

-    formatInternal(unit, appendable);

-    return appendable;

-  }

-

-  public boolean isLocaleSensitive() {

-    return true;

-  }

-

-  protected Unit<?> parse(CharSequence csq, int index) throws ParserException {

-    return parse(csq, new ParsePosition(index));

-  }

-

-  public Unit<?> parse(CharSequence csq, ParsePosition cursor) throws ParserException {

-    // Parsing reads the whole character sequence from the parse position.

-    int start = cursor.getIndex();

-    int end = csq.length();

-    if (end <= start) {

-      return AbstractUnit.ONE;

-    }

-    String source = csq.subSequence(start, end).toString().trim();

-    if (source.length() == 0) {

-      return AbstractUnit.ONE;

-    }

-    try {

-      LocalUnitFormatParser parser = new LocalUnitFormatParser(symbolMap, new StringReader(source));

-      Unit<?> result = parser.parseUnit();

-      cursor.setIndex(end);

-      return result;

-    } catch (TokenException e) {

-      if (e.currentToken != null) {

-        cursor.setErrorIndex(start + e.currentToken.endColumn);

-      } else {

-        cursor.setErrorIndex(start);

-      }

-      throw new IllegalArgumentException(e); // TODO should we throw

-      // ParserException here,

-      // too?

-    } catch (TokenMgrError e) {

-      cursor.setErrorIndex(start);

-      throw new ParserException(e);

-    }

-  }

-

-  @Override

-  public Unit<? extends Quantity<?>> parse(CharSequence csq) throws ParserException {

-    return parse(csq, new ParsePosition(0));

-  }

-

-  /**

-   * Format the given unit to the given StringBuilder, then return the operator precedence of the outermost operator in the unit expression that was

-   * formatted. See {@link ConverterFormat} for the constants that define the various precedence values.

-   * 

-   * @param unit

-   *          the unit to be formatted

-   * @param buffer

-   *          the <code>StringBuilder</code> to be written to

-   * @return the operator precedence of the outermost operator in the unit expression that was output

-   */

-  /*

-   * private int formatInternal(Unit<?> unit, Appendable buffer) throws

-   * IOException { if (unit instanceof AnnotatedUnit) { unit =

-   * ((AnnotatedUnit) unit).getActualUnit(); } String symbol =

-   * symbolMap.getSymbol((AbstractUnit<?>) unit); if (symbol != null) {

-   * buffer.append(symbol); return NOOP_PRECEDENCE; } else if

-   * (unit.getBaseUnits() != null) { Map<? extends Unit, Integer> productUnits

-   * = unit.getBaseUnits(); int negativeExponentCount = 0; // Write positive

-   * exponents first... boolean start = true; for (Unit u :

-   * productUnits.keySet()) { int pow = productUnits.get(u); if (pow >= 0) {

-   * formatExponent(u, pow, 1, !start, buffer); start = false; } else {

-   * negativeExponentCount += 1; } } // ..then write negative exponents. if

-   * (negativeExponentCount > 0) { if (start) { buffer.append('1'); }

-   * buffer.append('/'); if (negativeExponentCount > 1) { buffer.append('(');

-   * } start = true; for (Unit u : productUnits.keySet()) { int pow =

-   * productUnits.get(u); if (pow < 0) { formatExponent(u, -pow, 1, !start,

-   * buffer); start = false; } } if (negativeExponentCount > 1) {

-   * buffer.append(')'); } } return PRODUCT_PRECEDENCE; } else if

-   * ((!((AbstractUnit)unit).isSystemUnit()) || unit.equals(Units.KILOGRAM)) {

-   * UnitConverter converter = null; boolean printSeparator = false;

-   * StringBuffer temp = new StringBuffer(); int unitPrecedence =

-   * NOOP_PRECEDENCE; if (unit.equals(Units.KILOGRAM)) { // A special case

-   * because KILOGRAM is a BaseUnit instead of // a transformed unit, even

-   * though it has a prefix. converter = MetricPrefix.KILO.getConverter();

-   * unitPrecedence = formatInternal(Units.GRAM, temp); printSeparator = true;

-   * } else { Unit parentUnit = unit.getSystemUnit(); converter =

-   * unit.getConverterTo(parentUnit); if (parentUnit.equals(Units.KILOGRAM)) {

-   * // More special-case hackery to work around gram/kilogram // incosistency

-   * parentUnit = Units.GRAM; converter =

-   * converter.concatenate(MetricPrefix.KILO.getConverter()); } unitPrecedence

-   * = formatInternal(parentUnit, temp); printSeparator =

-   * !parentUnit.equals(Units.ONE); } int result = formatConverter(converter,

-   * printSeparator, unitPrecedence, temp); buffer.append(temp); return

-   * result; } else if (unit.getSymbol() != null) {

-   * buffer.append(unit.getSymbol()); return NOOP_PRECEDENCE; } else { throw

-   * new IllegalArgumentException(

-   * "Cannot format the given Object as a Unit (unsupported unit type " +

-   * unit.getClass().getName() + ")"); } }

-   */

-  @SuppressWarnings({ "rawtypes", "unchecked" })

-  private int formatInternal(Unit<?> unit, Appendable buffer) throws IOException {

-    if (unit instanceof AnnotatedUnit<?>) {

-      unit = ((AnnotatedUnit<?>) unit).getActualUnit();

-      // } else if (unit instanceof ProductUnit<?>) {

-      // ProductUnit<?> p = (ProductUnit<?>)unit;

-    }

-    String symbol = symbolMap.getSymbol((AbstractUnit<?>) unit);

-    if (symbol != null) {

-      buffer.append(symbol);

-      return NOOP_PRECEDENCE;

-    } else if (unit.getBaseUnits() != null) {

-      Map<Unit<?>, Integer> productUnits = (Map<Unit<?>, Integer>) unit.getBaseUnits();

-      int negativeExponentCount = 0;

-      // Write positive exponents first...

-      boolean start = true;

-      for (Map.Entry<Unit<?>, Integer> e : productUnits.entrySet()) {

-        int pow = e.getValue();

-        if (pow >= 0) {

-          formatExponent(e.getKey(), pow, 1, !start, buffer);

-          start = false;

-        } else {

-          negativeExponentCount += 1;

-        }

-      }

-      // ..then write negative exponents.

-      if (negativeExponentCount > 0) {

-        if (start) {

-          buffer.append('1');

-        }

-        buffer.append('/');

-        if (negativeExponentCount > 1) {

-          buffer.append('(');

-        }

-        start = true;

-        for (Map.Entry<Unit<?>, Integer> e : productUnits.entrySet()) {

-          int pow = e.getValue();

-          if (pow < 0) {

-            formatExponent(e.getKey(), -pow, 1, !start, buffer);

-            start = false;

-          }

-        }

-        if (negativeExponentCount > 1) {

-          buffer.append(')');

-        }

-      }

-      return PRODUCT_PRECEDENCE;

-    } else if (unit instanceof BaseUnit<?>) {

-      buffer.append(((BaseUnit<?>) unit).getSymbol());

-      return NOOP_PRECEDENCE;

-    } else if (unit instanceof AlternateUnit<?>) { // unit.getSymbol() !=

-      // null) { // Alternate

-      // unit.

-      buffer.append(unit.getSymbol());

-      return NOOP_PRECEDENCE;

-    } else { // A transformed unit or new unit type!

-      UnitConverter converter = null;

-      boolean printSeparator = false;

-      StringBuilder temp = new StringBuilder();

-      int unitPrecedence = NOOP_PRECEDENCE;

-      Unit<?> parentUnit = unit.getSystemUnit();

-      converter = ((AbstractUnit<?>) unit).getSystemConverter();

-      if (KILOGRAM.equals(parentUnit)) {

-        // More special-case hackery to work around gram/kilogram

-        // incosistency

-        if (unit.equals(GRAM)) {

-          buffer.append(symbolMap.getSymbol(GRAM));

-          return NOOP_PRECEDENCE;

-        }

-        parentUnit = GRAM;

-        if (unit instanceof TransformedUnit<?>) {

-          converter = ((TransformedUnit<?>) unit).getConverter();

-        } else {

-          converter = unit.getConverterTo((Unit) GRAM);

-        }

-      } else if (CUBIC_METRE.equals(parentUnit)) {

-        if (converter != null) {

-          parentUnit = LITRE;

-        }

-      }

-

-      if (unit instanceof TransformedUnit) {

-        TransformedUnit<?> transUnit = (TransformedUnit<?>) unit;

-        if (parentUnit == null)

-          parentUnit = transUnit.getParentUnit();

-        // String x = parentUnit.toString();

-        converter = transUnit.getConverter();

-      }

-

-      unitPrecedence = formatInternal(parentUnit, temp);

-      printSeparator = !parentUnit.equals(AbstractUnit.ONE);

-      int result = formatConverter(converter, printSeparator, unitPrecedence, temp);

-      buffer.append(temp);

-      return result;

-    }

-  }

-

-  /**

-   * Format the given unit raised to the given fractional power to the given <code>StringBuffer</code>.

-   * 

-   * @param unit

-   *          Unit the unit to be formatted

-   * @param pow

-   *          int the numerator of the fractional power

-   * @param root

-   *          int the denominator of the fractional power

-   * @param continued

-   *          boolean <code>true</code> if the converter expression should begin with an operator, otherwise <code>false</code>. This will always be

-   *          true unless the unit being modified is equal to Unit.ONE.

-   * @param buffer

-   *          StringBuffer the buffer to append to. No assumptions should be made about its content.

-   */

-  private void formatExponent(Unit<?> unit, int pow, int root, boolean continued, Appendable buffer) throws IOException {

-    if (continued) {

-      buffer.append(MIDDLE_DOT);

-    }

-    StringBuffer temp = new StringBuffer();

-    int unitPrecedence = formatInternal(unit, temp);

-    if (unitPrecedence < PRODUCT_PRECEDENCE) {

-      temp.insert(0, '(');

-      temp.append(')');

-    }

-    buffer.append(temp);

-    if ((root == 1) && (pow == 1)) {

-      // do nothing

-    } else if ((root == 1) && (pow > 1)) {

-      String powStr = Integer.toString(pow);

-      for (int i = 0; i < powStr.length(); i += 1) {

-        char c = powStr.charAt(i);

-        switch (c) {

-          case '0':

-            buffer.append('\u2070');

-            break;

-          case '1':

-            buffer.append('\u00b9');

-            break;

-          case '2':

-            buffer.append('\u00b2');

-            break;

-          case '3':

-            buffer.append('\u00b3');

-            break;

-          case '4':

-            buffer.append('\u2074');

-            break;

-          case '5':

-            buffer.append('\u2075');

-            break;

-          case '6':

-            buffer.append('\u2076');

-            break;

-          case '7':

-            buffer.append('\u2077');

-            break;

-          case '8':

-            buffer.append('\u2078');

-            break;

-          case '9':

-            buffer.append('\u2079');

-            break;

-        }

-      }

-    } else if (root == 1) {

-      buffer.append("^");

-      buffer.append(String.valueOf(pow));

-    } else {

-      buffer.append("^(");

-      buffer.append(String.valueOf(pow));

-      buffer.append('/');

-      buffer.append(String.valueOf(root));

-      buffer.append(')');

-    }

-  }

-

-  /**

-   * Formats the given converter to the given StringBuffer and returns the operator precedence of the converter's mathematical operation. This is the

-   * default implementation, which supports all built-in UnitConverter implementations. Note that it recursively calls itself in the case of a

-   * {@link javax.measure.converter.UnitConverter.Compound Compound} converter.

-   * 

-   * @param converter

-   *          the converter to be formatted

-   * @param continued

-   *          <code>true</code> if the converter expression should begin with an operator, otherwise <code>false</code>.

-   * @param unitPrecedence

-   *          the operator precedence of the operation expressed by the unit being modified by the given converter.

-   * @param buffer

-   *          the <code>StringBuffer</code> to append to.

-   * @return the operator precedence of the given UnitConverter

-   */

-  private int formatConverter(UnitConverter converter, boolean continued, int unitPrecedence, StringBuilder buffer) {

-    MetricPrefix prefix = symbolMap.getPrefix(converter);

-    if ((prefix != null) && (unitPrecedence == NOOP_PRECEDENCE)) {

-      buffer.insert(0, symbolMap.getSymbol(prefix));

-      return NOOP_PRECEDENCE;

-    } else if (converter instanceof AddConverter) {

-      if (unitPrecedence < ADDITION_PRECEDENCE) {

-        buffer.insert(0, '(');

-        buffer.append(')');

-      }

-      double offset = ((AddConverter) converter).getOffset();

-      if (offset < 0) {

-        buffer.append("-");

-        offset = -offset;

-      } else if (continued) {

-        buffer.append("+");

-      }

-      long lOffset = (long) offset;

-      if (lOffset == offset) {

-        buffer.append(lOffset);

-      } else {

-        buffer.append(offset);

-      }

-      return ADDITION_PRECEDENCE;

-    } else if (converter instanceof MultiplyConverter) {

-      if (unitPrecedence < PRODUCT_PRECEDENCE) {

-        buffer.insert(0, '(');

-        buffer.append(')');

-      }

-      if (continued) {

-        buffer.append(MIDDLE_DOT);

-      }

-      double factor = ((MultiplyConverter) converter).getFactor();

-      long lFactor = (long) factor;

-      if (lFactor == factor) {

-        buffer.append(lFactor);

-      } else {

-        buffer.append(factor);

-      }

-      return PRODUCT_PRECEDENCE;

-    } else if (converter instanceof RationalConverter) {

-      if (unitPrecedence < PRODUCT_PRECEDENCE) {

-        buffer.insert(0, '(');

-        buffer.append(')');

-      }

-      RationalConverter rationalConverter = (RationalConverter) converter;

-      if (!rationalConverter.getDividend().equals(BigInteger.ONE)) {

-        if (continued) {

-          buffer.append(MIDDLE_DOT);

-        }

-        buffer.append(rationalConverter.getDividend());

-      }

-      if (!rationalConverter.getDivisor().equals(BigInteger.ONE)) {

-        buffer.append('/');

-        buffer.append(rationalConverter.getDivisor());

-      }

-      return PRODUCT_PRECEDENCE;

-    } else { // All other converter type (e.g. exponential) we use the

-      // string representation.

-      buffer.insert(0, converter.toString() + "(");

-      buffer.append(")");

-      return EXPONENT_PRECEDENCE;

-    }

-  }

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/LocalUnitFormatParser.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/LocalUnitFormatParser.java
deleted file mode 100644
index 789733f..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/LocalUnitFormatParser.java
+++ /dev/null
@@ -1,883 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.format;

-

-import static org.eclipse.uomo.units.impl.format.UnitTokenConstants.*;

-

-import javax.measure.Unit;

-

-import org.eclipse.uomo.units.AbstractUnit;

-import org.eclipse.uomo.units.impl.converter.LogConverter;

-import org.eclipse.uomo.units.impl.system.MetricPrefix;

-

-/**

- * @deprecated use {@link UnitFormatParser} FIXME there are some details e.g. Exception handling that are different, try to resolve or keep LUFP

- */

-@SuppressWarnings({ "rawtypes", "unchecked" })

-public final class LocalUnitFormatParser {

-

-  private static class Exponent {

-

-    public final int pow;

-

-    public final int root;

-

-    public Exponent(int pow, int root) {

-      this.pow = pow;

-      this.root = root;

-    }

-  }

-

-  private SymbolMapImpl symbols;

-

-  public LocalUnitFormatParser(SymbolMapImpl symbols, java.io.Reader in) {

-    this(in);

-    this.symbols = symbols;

-  }

-

-  final public Unit parseUnit() throws TokenException {

-    Unit result = CompoundExpr();

-    consumeToken(0);

-    {

-      return result;

-    }

-  }

-

-  final public Unit CompoundExpr() throws TokenException {

-    throw new UnsupportedOperationException("Compound units not supported");

-  }

-

-  final public Unit AddExpr() throws TokenException {

-    Unit result = AbstractUnit.ONE;

-    Number n1 = null;

-    Token sign1 = null;

-    Number n2 = null;

-    Token sign2 = null;

-    if (jj_2_1(2147483647)) {

-      n1 = NumberExpr();

-      sign1 = Sign();

-    } else {

-    }

-    result = MulExpr();

-    switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-      case PLUS:

-      case MINUS:

-        sign2 = Sign();

-        n2 = NumberExpr();

-        break;

-      default:

-        laA[1] = genInt;

-    }

-    if (n1 != null) {

-      if (sign1.image.equals("-")) {

-        result = result.multiply(-1);

-      }

-      result = result.shift(n1.doubleValue());

-    }

-    if (n2 != null) {

-      double offset = n2.doubleValue();

-      if (sign2.image.equals("-")) {

-        offset = -offset;

-      }

-      result = result.shift(offset);

-    }

-    {

-      return result;

-    }

-  }

-

-  final public Unit MulExpr() throws TokenException {

-    Unit result = AbstractUnit.ONE;

-    Unit temp = AbstractUnit.ONE;

-    result = ExponentExpr();

-    label_2: while (true) {

-      switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-        case ASTERISK:

-        case MIDDLE_DOT:

-        case SOLIDUS:

-          break;

-        default:

-          laA[2] = genInt;

-          break label_2;

-      }

-      switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-        case ASTERISK:

-        case MIDDLE_DOT:

-          switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-            case ASTERISK:

-              consumeToken(ASTERISK);

-              break;

-            case MIDDLE_DOT:

-              consumeToken(MIDDLE_DOT);

-              break;

-            default:

-              laA[3] = genInt;

-              consumeToken(-1);

-              throw new TokenException();

-          }

-          temp = ExponentExpr();

-          result = result.multiply(temp);

-          break;

-        case SOLIDUS:

-          consumeToken(SOLIDUS);

-          temp = ExponentExpr();

-          result = result.divide(temp);

-          break;

-        default:

-          laA[4] = genInt;

-          consumeToken(-1);

-          throw new TokenException();

-      }

-    }

-    {

-      return result;

-    }

-  }

-

-  final public Unit ExponentExpr() throws TokenException {

-    Unit result = AbstractUnit.ONE;

-    Exponent exponent = null;

-    Token token = null;

-    if (jj_2_2(2147483647)) {

-      switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-        case INTEGER:

-          token = consumeToken(INTEGER);

-          break;

-        case E:

-          token = consumeToken(E);

-          break;

-        default:

-          laA[5] = genInt;

-          consumeToken(-1);

-          throw new TokenException();

-      }

-      consumeToken(CARET);

-      result = AtomicExpr();

-      double base;

-      if (token.kind == INTEGER) {

-        base = Integer.parseInt(token.image);

-      } else {

-        base = StrictMath.E;

-      }

-      {

-        return result.transform(new LogConverter(base).inverse());

-      }

-    } else {

-      switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-        case OPEN_PAREN:

-        case INTEGER:

-        case FLOATING_POINT:

-        case UNIT_IDENTIFIER:

-          result = AtomicExpr();

-          switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-            case CARET:

-            case SUPERSCRIPT_INTEGER:

-              exponent = Exp();

-              break;

-            default:

-              laA[6] = genInt;

-          }

-          if (exponent != null) {

-            if (exponent.pow != 1) {

-              result = result.pow(exponent.pow);

-            }

-            if (exponent.root != 1) {

-              result = result.root(exponent.root);

-            }

-          }

-          {

-            return result;

-          }

-        case LOG:

-        case NAT_LOG:

-          switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-            case LOG:

-              consumeToken(LOG);

-              switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-                case INTEGER:

-                  token = consumeToken(INTEGER);

-                  break;

-                default:

-                  laA[7] = genInt;

-              }

-              break;

-            case NAT_LOG:

-              token = consumeToken(NAT_LOG);

-              break;

-            default:

-              laA[8] = genInt;

-              consumeToken(-1);

-              throw new TokenException();

-          }

-          consumeToken(OPEN_PAREN);

-          result = AddExpr();

-          consumeToken(CLOSE_PAREN);

-          double base = 10;

-          if (token != null) {

-            if (token.kind == INTEGER) {

-              base = Integer.parseInt(token.image);

-            } else if (token.kind == NAT_LOG) {

-              base = StrictMath.E;

-            }

-          }

-          {

-            return result.transform(new LogConverter(base));

-          }

-        default:

-          laA[9] = genInt;

-          consumeToken(-1);

-          throw new TokenException();

-      }

-    }

-  }

-

-  final public Unit AtomicExpr() throws TokenException {

-    Unit result = AbstractUnit.ONE;

-    Number n = null;

-    Token token = null;

-    switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-      case INTEGER:

-      case FLOATING_POINT:

-        n = NumberExpr();

-        if (n instanceof Integer) {

-          {

-            return result.multiply(n.intValue());

-          }

-        } else {

-          {

-            return result.multiply(n.doubleValue());

-          }

-        }

-      case UNIT_IDENTIFIER:

-        token = consumeToken(UNIT_IDENTIFIER);

-        Unit unit = symbols.getUnit(token.image);

-        if (unit == null) {

-          MetricPrefix prefix = symbols.getPrefix(token.image);

-          if (prefix != null) {

-            String prefixSymbol = symbols.getSymbol(prefix);

-            unit = symbols.getUnit(token.image.substring(prefixSymbol.length()));

-            if (unit != null) {

-              {

-                return unit.transform(prefix.getConverter());

-              }

-            }

-          }

-          {

-            throw new TokenException();

-          }

-        } else {

-          {

-            return unit;

-          }

-        }

-      case OPEN_PAREN:

-        consumeToken(OPEN_PAREN);

-        result = AddExpr();

-        consumeToken(CLOSE_PAREN);

-        {

-          return result;

-        }

-      default:

-        laA[10] = genInt;

-        consumeToken(-1);

-        throw new TokenException();

-    }

-  }

-

-  final public Token Sign() throws TokenException {

-    Token result = null;

-    switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-      case PLUS:

-        result = consumeToken(PLUS);

-        break;

-      case MINUS:

-        result = consumeToken(MINUS);

-        break;

-      default:

-        laA[11] = genInt;

-        consumeToken(-1);

-        throw new TokenException();

-    }

-    {

-      return result;

-    }

-  }

-

-  final public Number NumberExpr() throws TokenException {

-    Token token = null;

-    switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-      case INTEGER:

-        token = consumeToken(INTEGER);

-        {

-          return Long.valueOf(token.image);

-        }

-      case FLOATING_POINT:

-        token = consumeToken(FLOATING_POINT);

-        {

-          return Double.valueOf(token.image);

-        }

-      default:

-        laA[12] = genInt;

-        consumeToken(-1);

-        throw new TokenException();

-    }

-  }

-

-  final public Exponent Exp() throws TokenException {

-    Token powSign = null;

-    Token powToken = null;

-    Token rootSign = null;

-    Token rootToken = null;

-    switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-      case CARET:

-        consumeToken(CARET);

-        switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-          case PLUS:

-          case MINUS:

-          case INTEGER:

-            switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-              case PLUS:

-              case MINUS:

-                powSign = Sign();

-                break;

-              default:

-                laA[13] = genInt;

-            }

-            powToken = consumeToken(INTEGER);

-            int pow = Integer.parseInt(powToken.image);

-            if ((powSign != null) && powSign.image.equals("-")) {

-              pow = -pow;

-            }

-            {

-              return new Exponent(pow, 1);

-            }

-          case OPEN_PAREN:

-            consumeToken(OPEN_PAREN);

-            switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-              case PLUS:

-              case MINUS:

-                powSign = Sign();

-                break;

-              default:

-                laA[14] = genInt;

-            }

-            powToken = consumeToken(INTEGER);

-            switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-              case SOLIDUS:

-                consumeToken(SOLIDUS);

-                switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {

-                  case PLUS:

-                  case MINUS:

-                    rootSign = Sign();

-                    break;

-                  default:

-                    laA[15] = genInt;

-                }

-                rootToken = consumeToken(INTEGER);

-                break;

-              default:

-                laA[16] = genInt;

-            }

-            consumeToken(CLOSE_PAREN);

-            pow = Integer.parseInt(powToken.image);

-            if ((powSign != null) && powSign.image.equals("-")) {

-              pow = -pow;

-            }

-            int root = 1;

-            if (rootToken != null) {

-              root = Integer.parseInt(rootToken.image);

-              if ((rootSign != null) && rootSign.image.equals("-")) {

-                root = -root;

-              }

-            }

-            {

-              return new Exponent(pow, root);

-            }

-          default:

-            laA[17] = genInt;

-            consumeToken(-1);

-            throw new TokenException();

-        }

-      case SUPERSCRIPT_INTEGER:

-        powToken = consumeToken(SUPERSCRIPT_INTEGER);

-        int pow = 0;

-        for (int i = 0; i < powToken.image.length(); i += 1) {

-          pow *= 10;

-          switch (powToken.image.charAt(i)) {

-            case '\u00b9':

-              pow += 1;

-              break;

-            case '\u00b2':

-              pow += 2;

-              break;

-            case '\u00b3':

-              pow += 3;

-              break;

-            case '\u2074':

-              pow += 4;

-              break;

-            case '\u2075':

-              pow += 5;

-              break;

-            case '\u2076':

-              pow += 6;

-              break;

-            case '\u2077':

-              pow += 7;

-              break;

-            case '\u2078':

-              pow += 8;

-              break;

-            case '\u2079':

-              pow += 9;

-              break;

-          }

-        }

-        {

-          return new Exponent(pow, 1);

-        }

-      default:

-        laA[18] = genInt;

-        consumeToken(-1);

-        throw new TokenException();

-    }

-  }

-

-  private boolean jj_2_1(int xla) {

-    laInt = xla;

-    lastpos = scanpos = token;

-    try {

-      return !jj_3_1();

-    } catch (LookaheadSuccess ls) {

-      return true;

-    } finally {

-      jj_save(0, xla);

-    }

-  }

-

-  private boolean jj_2_2(int xla) {

-    laInt = xla;

-    lastpos = scanpos = token;

-    try {

-      return !jj_3_2();

-    } catch (LookaheadSuccess ls) {

-      return true;

-    } finally {

-      jj_save(1, xla);

-    }

-  }

-

-  private boolean jj_3R_3() {

-    Token xsp;

-    xsp = scanpos;

-    if (jj_3R_5()) {

-      scanpos = xsp;

-      if (jj_3R_6())

-        return true;

-    }

-    return false;

-  }

-

-  private boolean jj_3R_6() {

-    return scanToken(FLOATING_POINT);

-  }

-

-  private boolean jj_3_2() {

-    Token xsp;

-    xsp = scanpos;

-    if (scanToken(14)) {

-      scanpos = xsp;

-      if (scanToken(19))

-        return true;

-    }

-    return scanToken(CARET);

-  }

-

-  private boolean jj_3_1() {

-    return jj_3R_3() || jj_3R_4();

-  }

-

-  private boolean jj_3R_4() {

-    Token xsp;

-    xsp = scanpos;

-    if (scanToken(5)) {

-      scanpos = xsp;

-      if (scanToken(6))

-        return true;

-    }

-    return false;

-  }

-

-  private boolean jj_3R_5() {

-    return scanToken(INTEGER);

-  }

-

-  /** Generated Token Manager. */

-  public UnitTokenManager tokenSource;

-

-  DefaultCharStream inputStream;

-

-  /** Current token. */

-  public Token token;

-

-  /** Next token. */

-  public Token nextToken;

-

-  private int nextTokenIndex;

-

-  private Token scanpos, lastpos;

-

-  private int laInt;

-

-  private int genInt;

-

-  final private int[] laA = new int[19];

-

-  static private int[] laB;

-

-  static {

-    init();

-  }

-

-  private static void init() {

-    laB = new int[] { 0x800, 0x60, 0x380, 0x180, 0x380, 0x84000, 0x8400, 0x4000, 0x60000, 0x175000, 0x115000, 0x60, 0x14000, 0x60, 0x60, 0x60, 0x200,

-        0x5060, 0x8400, };

-  }

-

-  final private JJCalls[] rtns = new JJCalls[2];

-

-  private boolean rescan = false;

-

-  private int gcInt = 0;

-

-  /** Constructor with InputStream. */

-  public LocalUnitFormatParser(java.io.InputStream stream) {

-    this(stream, null);

-  }

-

-  /** Constructor with InputStream and supplied encoding */

-  public LocalUnitFormatParser(java.io.InputStream stream, String encoding) {

-    try {

-      inputStream = new DefaultCharStream(stream, encoding, 1, 1);

-    } catch (java.io.UnsupportedEncodingException e) {

-      throw new RuntimeException(e);

-    }

-    tokenSource = new UnitTokenManager(inputStream);

-    token = new Token();

-    nextTokenIndex = -1;

-    genInt = 0;

-    for (int i = 0; i < 19; i++) {

-      laA[i] = -1;

-    }

-    for (int i = 0; i < rtns.length; i++) {

-      rtns[i] = new JJCalls();

-    }

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.InputStream stream) {

-    ReInit(stream, null);

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.InputStream stream, String encoding) {

-    try {

-      inputStream.ReInit(stream, encoding, 1, 1);

-    } catch (java.io.UnsupportedEncodingException e) {

-      throw new RuntimeException(e);

-    }

-    tokenSource.ReInit(inputStream);

-    token = new Token();

-    nextTokenIndex = -1;

-    genInt = 0;

-    for (int i = 0; i < 19; i++) {

-      laA[i] = -1;

-    }

-    for (int i = 0; i < rtns.length; i++) {

-      rtns[i] = new JJCalls();

-    }

-  }

-

-  /** Constructor. */

-  public LocalUnitFormatParser(java.io.Reader stream) {

-    inputStream = new DefaultCharStream(stream, 1, 1);

-    tokenSource = new UnitTokenManager(inputStream);

-    token = new Token();

-    nextTokenIndex = -1;

-    genInt = 0;

-    for (int i = 0; i < 19; i++) {

-      laA[i] = -1;

-    }

-    for (int i = 0; i < rtns.length; i++) {

-      rtns[i] = new JJCalls();

-    }

-  }

-

-  /** Reinitialise. */

-  public void ReInit(java.io.Reader stream) {

-    inputStream.ReInit(stream, 1, 1);

-    tokenSource.ReInit(inputStream);

-    token = new Token();

-    nextTokenIndex = -1;

-    genInt = 0;

-    for (int i = 0; i < 19; i++) {

-      laA[i] = -1;

-    }

-    for (int i = 0; i < rtns.length; i++) {

-      rtns[i] = new JJCalls();

-    }

-  }

-

-  /** Constructor with generated Token Manager. */

-  public LocalUnitFormatParser(UnitTokenManager tm) {

-    tokenSource = tm;

-    token = new Token();

-    nextTokenIndex = -1;

-    genInt = 0;

-    for (int i = 0; i < 19; i++) {

-      laA[i] = -1;

-    }

-    for (int i = 0; i < rtns.length; i++) {

-      rtns[i] = new JJCalls();

-    }

-  }

-

-  /** Reinitialise. */

-  public void ReInit(UnitTokenManager tm) {

-    tokenSource = tm;

-    token = new Token();

-    nextTokenIndex = -1;

-    genInt = 0;

-    for (int i = 0; i < 19; i++) {

-      laA[i] = -1;

-    }

-    for (int i = 0; i < rtns.length; i++) {

-      rtns[i] = new JJCalls();

-    }

-  }

-

-  private Token consumeToken(int kind) throws TokenException {

-    Token oldToken;

-    if ((oldToken = token).next != null)

-      token = token.next;

-    else

-      token = token.next = tokenSource.getNextToken();

-    nextTokenIndex = -1;

-    if (token.kind == kind) {

-      genInt++;

-      if (++gcInt > 100) {

-        gcInt = 0;

-        for (JJCalls jj_2_rtn : rtns) {

-          JJCalls c = jj_2_rtn;

-          while (c != null) {

-            if (c.gen < genInt)

-              c.first = null;

-            c = c.next;

-          }

-        }

-      }

-      return token;

-    }

-    token = oldToken;

-    this.kind = kind;

-    throw raiseTokenException();

-  }

-

-  static private final class LookaheadSuccess extends java.lang.RuntimeException {

-    private static final long serialVersionUID = 2205332054119123041L;

-  }

-

-  private boolean scanToken(int kind) {

-    if (scanpos == lastpos) {

-      laInt--;

-      if (scanpos.next == null) {

-        lastpos = scanpos = scanpos.next = tokenSource.getNextToken();

-      } else {

-        lastpos = scanpos = scanpos.next;

-      }

-    } else {

-      scanpos = scanpos.next;

-    }

-    if (rescan) {

-      int i = 0;

-      Token tok = token;

-      while (tok != null && tok != scanpos) {

-        i++;

-        tok = tok.next;

-      }

-      if (tok != null)

-        jj_add_error_token(kind, i);

-    }

-    if (scanpos.kind != kind)

-      return true;

-    if (laInt == 0 && scanpos == lastpos)

-      throw new LookaheadSuccess();

-    return false;

-  }

-

-  /** Get the next Token. */

-  final public Token getNextToken() {

-    if (token.next != null)

-      token = token.next;

-    else

-      token = token.next = tokenSource.getNextToken();

-    nextTokenIndex = -1;

-    genInt++;

-    return token;

-  }

-

-  /** Get the specific Token. */

-  final public Token getToken(int index) {

-    Token t = token;

-    for (int i = 0; i < index; i++) {

-      if (t.next != null)

-        t = t.next;

-      else

-        t = t.next = tokenSource.getNextToken();

-    }

-    return t;

-  }

-

-  private int jj_ntk() {

-    if ((nextToken = token.next) == null) {

-      return (nextTokenIndex = (token.next = tokenSource.getNextToken()).kind);

-    } else {

-      return (nextTokenIndex = nextToken.kind);

-    }

-  }

-

-  private final java.util.List<int[]> expentries = new java.util.ArrayList<>();

-

-  private int[] expentry;

-

-  private int kind = -1;

-

-  private final int[] lastTokens = new int[100];

-

-  private int endpos;

-

-  private void jj_add_error_token(int kind, int pos) {

-    if (pos >= 100)

-      return;

-    if (pos == endpos + 1) {

-      lastTokens[endpos++] = kind;

-    } else if (endpos != 0) {

-      expentry = new int[endpos];

-      System.arraycopy(lastTokens, 0, expentry, 0, endpos);

-      entriesLoop: for (int[] jj_expentry1 : expentries) {

-        if (jj_expentry1.length == expentry.length) {

-          for (int i = 0; i < expentry.length; i++) {

-            if (jj_expentry1[i] != expentry[i]) {

-              continue entriesLoop;

-            }

-          }

-          expentries.add(expentry);

-          break;

-        }

-      }

-      if (pos != 0)

-        lastTokens[(endpos = pos) - 1] = kind;

-    }

-  }

-

-  /** Generate TokenException. */

-  TokenException raiseTokenException() {

-    expentries.clear();

-    boolean[] la1tokens = new boolean[21];

-    if (kind >= 0) {

-      la1tokens[kind] = true;

-      kind = -1;

-    }

-    for (int i = 0; i < 19; i++) {

-      if (laA[i] == genInt) {

-        for (int j = 0; j < 32; j++) {

-          if ((laB[i] & (1 << j)) != 0) {

-            la1tokens[j] = true;

-          }

-        }

-      }

-    }

-    for (int i = 0; i < 21; i++) {

-      if (la1tokens[i]) {

-        expentry = new int[1];

-        expentry[0] = i;

-        expentries.add(expentry);

-      }

-    }

-    endpos = 0;

-    jj_rescan_token();

-    jj_add_error_token(0, 0);

-    int[][] exptokseq = new int[expentries.size()][];

-    for (int i = 0; i < expentries.size(); i++) {

-      exptokseq[i] = expentries.get(i);

-    }

-    return new TokenException(token, exptokseq, tokenImage);

-  }

-

-  /** Enable tracing. */

-  final public void enable_tracing() {

-  }

-

-  /** Disable tracing. */

-  final public void disable_tracing() {

-  }

-

-  private void jj_rescan_token() {

-    rescan = true;

-    for (int i = 0; i < 2; i++) {

-      try {

-        JJCalls p = rtns[i];

-        do {

-          if (p.gen > genInt) {

-            laInt = p.arg;

-            lastpos = scanpos = p.first;

-            switch (i) {

-              case 0:

-                jj_3_1();

-                break;

-              case 1:

-                jj_3_2();

-                break;

-            }

-          }

-          p = p.next;

-        } while (p != null);

-      } catch (LookaheadSuccess ls) {

-      }

-    }

-    rescan = false;

-  }

-

-  private void jj_save(int index, int xla) {

-    JJCalls p = rtns[index];

-    while (p.gen > genInt) {

-      if (p.next == null) {

-        p = p.next = new JJCalls();

-        break;

-      }

-      p = p.next;

-    }

-    p.gen = genInt + xla - laInt;

-    p.first = token;

-    p.arg = xla;

-  }

-

-  static final class JJCalls {

-

-    int gen;

-

-    Token first;

-

-    int arg;

-

-    JJCalls next;

-  }

-}

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/NumberSpaceQuantityFormat.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/NumberSpaceQuantityFormat.java
deleted file mode 100644
index 6e81cd2..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/NumberSpaceQuantityFormat.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.format;

-

-import java.io.IOException;

-import java.text.NumberFormat;

-import java.text.ParsePosition;

-

-import javax.measure.Quantity;

-import javax.measure.Unit;

-import javax.measure.format.ParserException;

-import javax.measure.format.UnitFormat;

-

-import org.eclipse.uomo.units.AbstractUnit;

-import org.eclipse.uomo.units.ComparableQuantity;

-import org.eclipse.uomo.units.impl.Quantities;

-

-@SuppressWarnings({ "rawtypes", "unchecked" })

-class NumberSpaceQuantityFormat extends QuantityFormat {

-

-  private final NumberFormat numberFormat;

-

-  private final UnitFormat unitFormat;

-

-  NumberSpaceQuantityFormat(NumberFormat numberFormat, UnitFormat unitFormat) {

-    this.numberFormat = numberFormat;

-    this.unitFormat = unitFormat;

-  }

-

-  static int getFractionDigitsCount(double d) {

-    if (d >= 1) { // we only need the fraction digits

-      d = d - (long) d;

-    }

-    if (d == 0) { // nothing to count

-      return 0;

-    }

-    d *= 10; // shifts 1 digit to left

-    int count = 1;

-    while (d - (long) d != 0) { // keeps shifting until there are no more

-      // fractions

-      d *= 10;

-      count++;

-    }

-    return count;

-  }

-

-  @Override

-  public Appendable format(Quantity<?> quantity, Appendable dest) throws IOException {

-    // dest.append(numberFormat.format(quantity.getValue()));

-    // if (quantity.getUnit().equals(AbstractUnit.ONE))

-    // return dest;

-    // dest.append(' ');

-    // return unitFormat.format(quantity.getUnit(), dest);

-    int fract = 0;

-    if (quantity != null && quantity.getValue() != null) {

-      fract = getFractionDigitsCount(quantity.getValue().doubleValue());

-    }

-    if (fract > 1) {

-      numberFormat.setMaximumFractionDigits(fract + 1);

-    }

-    dest.append(numberFormat.format(quantity.getValue()));

-    if (quantity.getUnit().equals(AbstractUnit.ONE))

-      return dest;

-    dest.append(' ');

-    return unitFormat.format(quantity.getUnit(), dest);

-  }

-

-  @Override

-  public ComparableQuantity<?> parse(CharSequence csq, ParsePosition cursor) throws IllegalArgumentException, ParserException {

-    String str = csq.toString();

-    Number number = numberFormat.parse(str, cursor);

-    if (number == null)

-      throw new IllegalArgumentException("Number cannot be parsed");

-

-    Unit unit = unitFormat.parse(csq);

-    return Quantities.getQuantity(number.longValue(), unit);

-  }

-

-  @Override

-  ComparableQuantity<?> parse(CharSequence csq, int index) throws IllegalArgumentException, ParserException {

-    return parse(csq, new ParsePosition(index));

-  }

-

-  @Override

-  public ComparableQuantity<?> parse(CharSequence csq) throws IllegalArgumentException, ParserException {

-    return parse(csq, 0);

-  }

-

-  private static final long serialVersionUID = 1L;

-

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/ParseException.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/ParseException.java
deleted file mode 100644
index b8e9d97..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/ParseException.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/**

- * Copyright (c) 2005, 2010, Werner Keil, Ikayzo 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Ikayzo and others - initial API and implementation

- */

-/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */

-/* JavaCCOptions:KEEP_LINE_COL=null */

-package org.eclipse.uomo.units.impl.format;

-

-import static org.eclipse.uomo.units.impl.format.TokenMgrError.addEscapes;

-

-/**

- * This exception is thrown when parse errors are encountered.

- * You can explicitly create objects of this exception type by

- * calling the method generateParseException in the generated

- * parser.

- *

- * You can modify this class to customize your error reporting

- * mechanisms so long as you retain the public fields.

- *

- * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author  <a href="mailto:uomo@catmedia.us">Werner Keil</a>

- * @version 1.0.1 ($Revision: 105 $), $Date: 2010-08-05 21:44:23 +0100 (Do, 05 Aug 2010) $

- */

-class ParseException extends RuntimeException {

-

-    /**

-     * The version identifier for this Serializable class.

-     * Increment only if the <i>serialized</i> form of the

-     * class changes.

-     */

-    private static final long serialVersionUID = 2932151235799168061L;

-

-  /**

-   * This constructor is used by the method "generateParseException"

-   * in the generated parser.  Calling this constructor generates

-   * a new object of this type with the fields "currentToken",

-   * "expectedTokenSequences", and "tokenImage" set.

-   */

-  public ParseException(Token currentTokenVal,

-                        int[][] expectedTokenSequencesVal,

-                        String[] tokenImageVal

-                       )

-  {

-    super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));

-    currentToken = currentTokenVal;

-    expectedTokenSequences = expectedTokenSequencesVal;

-    tokenImage = tokenImageVal;

-  }

-

-  /**

-   * The following constructors are for use by you for whatever

-   * purpose you can think of.  Constructing the exception in this

-   * manner makes the exception behave in the normal way - i.e., as

-   * documented in the class "Throwable".  The fields "errorToken",

-   * "expectedTokenSequences", and "tokenImage" do not contain

-   * relevant information.  The JavaCC generated code does not use

-   * these constructors.

-   */

-

-  public ParseException() {

-    super();

-  }

-

-  /** Constructor with message. */

-  public ParseException(String message) {

-    super(message);

-  }

-

-

-  /**

-   * This is the last token that has been consumed successfully.  If

-   * this object has been created due to a parse error, the token

-   * followng this token will (therefore) be the first error token.

-   */

-  public Token currentToken;

-

-  /**

-   * Each entry in this array is an array of integers.  Each array

-   * of integers represents a sequence of tokens (by their ordinal

-   * values) that is expected at this point of the parse.

-   */

-  public int[][] expectedTokenSequences;

-

-  /**

-   * This is a reference to the "tokenImage" array of the generated

-   * parser within which the parse error occurred.  This array is

-   * defined in the generated ...Constants interface.

-   */

-  public String[] tokenImage;

-

-  /**

-   * It uses "currentToken" and "expectedTokenSequences" to generate a parse

-   * error message and returns it.  If this object has been created

-   * due to a parse error, and you do not catch it (it gets thrown

-   * from the parser) the correct error message

-   * gets displayed.

-   */

-  private static String initialise(Token currentToken,

-                           int[][] expectedTokenSequences,

-                           String[] tokenImage) {

-    String eol = System.getProperty("line.separator", "\n");

-    StringBuffer expected = new StringBuffer();

-    int maxSize = 0;

-    for (int i = 0; i < expectedTokenSequences.length; i++) {

-      if (maxSize < expectedTokenSequences[i].length) {

-        maxSize = expectedTokenSequences[i].length;

-      }

-      for (int j = 0; j < expectedTokenSequences[i].length; j++) {

-        expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');

-      }

-      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {

-        expected.append("...");

-      }

-      expected.append(eol).append("    ");

-    }

-    String retval = "Encountered \"";

-    Token tok = currentToken.next;

-    for (int i = 0; i < maxSize; i++) {

-      if (i != 0) retval += " ";

-      if (tok.kind == 0) {

-        retval += tokenImage[0];

-        break;

-      }

-      retval += " " + tokenImage[tok.kind];

-      retval += " \"";

-      retval += addEscapes(tok.image);

-      retval += " \"";

-      tok = tok.next;

-    }

-    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;

-    retval += "." + eol;

-    if (expectedTokenSequences.length == 1) {

-      retval += "Was expecting:" + eol + "    ";

-    } else {

-      retval += "Was expecting one of:" + eol + "    ";

-    }

-    retval += expected.toString();

-    return retval;

-  }

-

-  /**

-   * The end of line string for this machine.

-   */

-  protected String eol = System.getProperty("line.separator", "\n");

-

-}

-/* JavaCC - OriginalChecksum=c67b0f8ee6c642900399352b33f90efd (do not edit this line) */

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/QuantityFormat.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/QuantityFormat.java
deleted file mode 100644
index 7313baa..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/QuantityFormat.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Ikayzo and others - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.format;

-

-import java.io.IOException;

-import java.text.NumberFormat;

-import java.text.ParsePosition;

-

-import javax.measure.MeasurementException;

-import javax.measure.Quantity;

-import javax.measure.Unit;

-import javax.measure.format.ParserException;

-import javax.measure.format.UnitFormat;

-

-import org.eclipse.uomo.units.AbstractQuantity;

-import org.eclipse.uomo.units.AbstractUnit;

-import org.eclipse.uomo.units.impl.NumberQuantity;

-

-import tec.uom.lib.common.function.Parser;

-

-/**

- * <p>

- * This class provides the interface for formatting and parsing {@link Quantity quantities}.

- * </p>

- * 

- * <p>

- * Instances of this class should be able to format quantities stated in {@link CompoundUnit}. See {@link #formatCompound formatCompound(...)}.

- * </p>

- * 

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @version 1.2, $Date: 2017-12-24 $

- * @since 0.7

- */

-@SuppressWarnings("rawtypes")

-public abstract class QuantityFormat implements Parser<CharSequence, Quantity> {

-

-  /**

-   * 

-   */

-  private static final long serialVersionUID = -4628006924354248662L;

-

-  /**

-   * Holds the default format instance.

-   */

-  private static final QuantityFormat DEFAULT = new Standard();

-

-  /**

-   * Holds the localized format instance.

-   */

-  private static final NumberSpaceQuantityFormat LOCAL = new NumberSpaceQuantityFormat(NumberFormat.getInstance(), LocalUnitFormat.getInstance());

-

-  

-  /**

-   * Holds the Number-Space-Unit format instance.

-   */

-  // private static final QuantityFormat NUM_SPACE = new NumberSpaceUnit(NumberFormat.getInstance(), SimpleUnitFormat.getInstance());

-

-  // TODO use it as an option (after fixing parse())

-

-  /**

-   * Returns the quantity format for the default locale. The default format assumes the quantity is composed of a decimal number and a {@link Unit}

-   * separated by whitespace(s).

-   * 

-   * @return <code>MeasureFormat.getInstance(NumberFormat.getInstance(), UnitFormat.getInstance())</code>

-   */

-  public static QuantityFormat getInstance() {

-    return DEFAULT;

-  }

-

-  /**

-   * Returns the quantity format using the specified number format and unit format (the number and unit are separated by one space).

-   *

-   * @param numberFormat

-   *          the number format.

-   * @param unitFormat

-   *          the unit format.

-   * @return the corresponding format.

-   */

-  public static QuantityFormat getInstance(NumberFormat numberFormat, UnitFormat unitFormat) {

-    return new NumberSpaceQuantityFormat(numberFormat, unitFormat);

-  }

-

-  /**

-   * Returns the culture invariant format based upon {@link BigDecimal} canonical format and the {@link UnitFormat#getStandardInstance() standard}

-   * unit format. This format <b>is not</b> locale-sensitive and can be used for unambiguous electronic communication of quantities together with

-   * their units without loss of information. For example: <code>"1.23456789 kg.m/s2"</code> returns

-   * <code>Quantities.getQuantity(new BigDecimal("1.23456789"), AbstractUnit.parse("kg.m/s2")));</code>

-   *

-   * @param style

-   *          the format style to apply.

-   * @return the desired format.

-   */

-  public static QuantityFormat getInstance(FormatBehavior style) {

-    switch (style) {

-      case LOCALE_NEUTRAL:

-        return DEFAULT;

-      case LOCALE_SENSITIVE:

-        return LOCAL;

-      default:

-        return DEFAULT;

-    }

-  }

-  

-  /**

-   * Formats the specified quantity into an <code>Appendable</code>.

-   * 

-   * @param quantity

-   *          the quantity to format.

-   * @param dest

-   *          the appendable destination.

-   * @return the specified <code>Appendable</code>.

-   * @throws IOException

-   *           if an I/O exception occurs.

-   */

-  public abstract Appendable format(Quantity<?> quantity, Appendable dest) throws IOException;

-

-  /**

-   * Parses a portion of the specified <code>CharSequence</code> from the specified position to produce an object. If parsing succeeds, then the index

-   * of the <code>cursor</code> argument is updated to the index after the last character used.

-   * 

-   * @param csq

-   *          the <code>CharSequence</code> to parse.

-   * @param index

-   *          the current parsing index.

-   * @return the object parsed from the specified character sub-sequence.

-   * @throws IllegalArgumentException

-   *           if any problem occurs while parsing the specified character sequence (e.g. illegal syntax).

-   */

-  abstract Quantity<?> parse(CharSequence csq, int index) throws IllegalArgumentException, ParserException;

-

-  /**

-   * Convenience method equivalent to {@link #format(AbstractQuantity, Appendable)} except it does not raise an IOException.

-   * 

-   * @param q

-   *          the quantity to format.

-   * @param dest

-   *          the appendable destination.

-   * @return the specified <code>StringBuilder</code>.

-   */

-  public final StringBuilder format(Quantity<?> q, StringBuilder dest) {

-    try {

-      return (StringBuilder) this.format(q, (Appendable) dest);

-    } catch (IOException ex) {

-      throw new MeasurementException(ex); // Should not happen.

-    }

-  }

-

-  /**

-   * Formats an object to produce a string. This is equivalent to <blockquote> {@link #format(Unit, StringBuilder) format}<code>(unit,

-   *         new StringBuilder()).toString();</code> </blockquote>

-   *

-   * @param obj

-   *          The object to format

-   * @return Formatted string.

-   * @exception IllegalArgumentException

-   *              if the Format cannot format the given object

-   */

-  public final String format(Quantity q) {

-    if (q instanceof AbstractQuantity) {

-      return format((AbstractQuantity<?>) q, new StringBuilder()).toString();

-    } else {

-      return (this.format(q, new StringBuilder())).toString();

-    }

-  }

-

-  static int getFractionDigitsCount(double d) {

-    if (d >= 1) { // we only need the fraction digits

-      d = d - (long) d;

-    }

-    if (d == 0) { // nothing to count

-      return 0;

-    }

-    d *= 10; // shifts 1 digit to left

-    int count = 1;

-    while (d - (long) d != 0) { // keeps shifting until there are no more

-      // fractions

-      d *= 10;

-      count++;

-    }

-    return count;

-  }

-

-  // Holds standard implementation.

-  private static final class Standard extends QuantityFormat {

-

-    /**

-     * 

-     */

-    // private static final long serialVersionUID = 2758248665095734058L;

-

-    @Override

-    public Appendable format(Quantity q, Appendable dest) throws IOException {

-      Unit unit = q.getUnit();

-      // if (unit instanceof CompoundUnit)

-      // return formatCompound(q.doubleValue(unit),

-      // (CompoundUnit) unit, dest);

-      // else {

-

-      Number number = q.getValue();

-      dest.append(number.toString());

-      // }

-      if (q.getUnit().equals(AbstractUnit.ONE))

-        return dest;

-      dest.append(' ');

-      return SimpleUnitFormat.getInstance().format(unit, dest);

-      // }

-    }

-

-    @SuppressWarnings("unchecked")

-    @Override

-    Quantity<?> parse(CharSequence csq, int index) throws ParserException {

-      int startDecimal = index; // cursor.getIndex();

-      while ((startDecimal < csq.length()) && Character.isWhitespace(csq.charAt(startDecimal))) {

-        startDecimal++;

-      }

-      int endDecimal = startDecimal + 1;

-      while ((endDecimal < csq.length()) && !Character.isWhitespace(csq.charAt(endDecimal))) {

-        endDecimal++;

-      }

-      Double decimal = new Double(csq.subSequence(startDecimal, endDecimal).toString());

-      // cursor.setIndex(endDecimal + 1);

-      int startUnit = endDecimal + 1;// csq.toString().indexOf(' ') + 1;

-      Unit unit = SimpleUnitFormat.getInstance().parse(csq, new ParsePosition(startUnit));

-      return NumberQuantity.of(decimal.doubleValue(), unit);

-    }

-

-    public Quantity<?> parse(CharSequence csq) throws ParserException {

-      return parse(csq, 0);

-    }

-  }

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/SimpleCharStream.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/SimpleCharStream.java
deleted file mode 100644
index 20c2268..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/SimpleCharStream.java
+++ /dev/null
@@ -1,481 +0,0 @@
-/**

- * Copyright (c) 2005, 2010, Werner Keil, Ikayzo 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Ikayzo and others - initial API and implementation

- */

-/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */

-/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */

-package org.eclipse.uomo.units.impl.format;

-

-/**

- * An implementation of interface CharStream, where the stream is assumed to

- * contain only ASCII characters (without unicode processing).

- */

-

-class SimpleCharStream

-{

-/** Whether parser is static. */

-  static final boolean staticFlag = false;

-  int bufsize;

-  int available;

-  int tokenBegin;

-/** Position in buffer. */

-  private int bufpos = -1;

-  protected int bufline[];

-  protected int bufcolumn[];

-

-  protected int column = 0;

-  protected int line = 1;

-

-  protected boolean prevCharIsCR = false;

-  protected boolean prevCharIsLF = false;

-

-  protected java.io.Reader inputStream;

-

-  protected char[] buffer;

-  protected int maxNextCharInd = 0;

-  protected int inBuf = 0;

-  protected int tabSize = 8;

-

-  protected void setTabSize(int i) { tabSize = i; }

-  protected int getTabSize(int i) { return tabSize; }

-

-

-  protected void expandBuff(boolean wrapAround)

-  {

-    char[] newbuffer = new char[bufsize + 2048];

-    int newbufline[] = new int[bufsize + 2048];

-    int newbufcolumn[] = new int[bufsize + 2048];

-

-    try

-    {

-      if (wrapAround)

-      {

-        System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);

-        System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);

-        buffer = newbuffer;

-

-        System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);

-        System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);

-        bufline = newbufline;

-

-        System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);

-        System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);

-        bufcolumn = newbufcolumn;

-

-        maxNextCharInd = (bufpos += (bufsize - tokenBegin));

-      }

-      else

-      {

-        System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);

-        buffer = newbuffer;

-

-        System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);

-        bufline = newbufline;

-

-        System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);

-        bufcolumn = newbufcolumn;

-

-        maxNextCharInd = (bufpos -= tokenBegin);

-      }

-    }

-    catch (Throwable t)

-    {

-      throw new Error(t.getMessage());

-    }

-

-

-    bufsize += 2048;

-    available = bufsize;

-    tokenBegin = 0;

-  }

-

-  protected void fillBuff() throws java.io.IOException

-  {

-    if (maxNextCharInd == available)

-    {

-      if (available == bufsize)

-      {

-        if (tokenBegin > 2048)

-        {

-          bufpos = maxNextCharInd = 0;

-          available = tokenBegin;

-        }

-        else if (tokenBegin < 0)

-          bufpos = maxNextCharInd = 0;

-        else

-          expandBuff(false);

-      }

-      else if (available > tokenBegin)

-        available = bufsize;

-      else if ((tokenBegin - available) < 2048)

-        expandBuff(true);

-      else

-        available = tokenBegin;

-    }

-

-    int i;

-    try {

-      if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1)

-      {

-        inputStream.close();

-        throw new java.io.IOException();

-      }

-      else

-        maxNextCharInd += i;

-      return;

-    }

-    catch(java.io.IOException e) {

-      --bufpos;

-      backup(0);

-      if (tokenBegin == -1)

-        tokenBegin = bufpos;

-      throw e;

-    }

-  }

-

-/** Start. */

-  protected char beginToken() throws java.io.IOException

-  {

-    tokenBegin = -1;

-    char c = readChar();

-    tokenBegin = bufpos;

-

-    return c;

-  }

-

-  protected void updateLineColumn(char c)

-  {

-    column++;

-

-    if (prevCharIsLF)

-    {

-      prevCharIsLF = false;

-      line += (column = 1);

-    }

-    else if (prevCharIsCR)

-    {

-      prevCharIsCR = false;

-      if (c == '\n')

-      {

-        prevCharIsLF = true;

-      }

-      else

-        line += (column = 1);

-    }

-

-    switch (c)

-    {

-      case '\r' :

-        prevCharIsCR = true;

-        break;

-      case '\n' :

-        prevCharIsLF = true;

-        break;

-      case '\t' :

-        column--;

-        column += (tabSize - (column % tabSize));

-        break;

-      default :

-        break;

-    }

-

-    bufline[bufpos] = line;

-    bufcolumn[bufpos] = column;

-  }

-

-/** Read a character. */

-  protected char readChar() throws java.io.IOException

-  {

-    if (inBuf > 0)

-    {

-      --inBuf;

-

-      if (++bufpos == bufsize)

-        bufpos = 0;

-

-      return buffer[bufpos];

-    }

-

-    if (++bufpos >= maxNextCharInd)

-      fillBuff();

-

-    char c = buffer[bufpos];

-

-    updateLineColumn(c);

-    return c;

-  }

-

-  @Deprecated

-  /**

-   * @deprecated

-   * @see #getEndColumn

-   */

-

-  protected int getColumn() {

-    return bufcolumn[bufpos];

-  }

-

-  @Deprecated

-  /**

-   * @deprecated

-   * @see #getEndLine

-   */

-

-  protected int getLine() {

-    return bufline[bufpos];

-  }

-

-  /** Get token end column number. */

-  protected int getEndColumn() {

-    return bufcolumn[bufpos];

-  }

-

-  /** Get token end line number. */

-  protected int getEndLine() {

-     return bufline[bufpos];

-  }

-

-  /** Get token beginning column number. */

-  protected int getBeginColumn() {

-    return bufcolumn[tokenBegin];

-  }

-

-  /** Get token beginning line number. */

-  protected int getBeginLine() {

-    return bufline[tokenBegin];

-  }

-

-/** Backup a number of characters. */

-  protected void backup(int amount) {

-

-    inBuf += amount;

-    if ((bufpos -= amount) < 0)

-      bufpos += bufsize;

-  }

-

-  /** Constructor. */

-  protected SimpleCharStream(java.io.Reader dstream, int startline,

-  int startcolumn, int buffersize)

-  {

-    inputStream = dstream;

-    line = startline;

-    column = startcolumn - 1;

-

-    available = bufsize = buffersize;

-    buffer = new char[buffersize];

-    bufline = new int[buffersize];

-    bufcolumn = new int[buffersize];

-  }

-

-  /** Constructor. */

-  protected SimpleCharStream(java.io.Reader dstream, int startline,

-                          int startcolumn)

-  {

-    this(dstream, startline, startcolumn, 4096);

-  }

-

-  /** Constructor. */

-  protected SimpleCharStream(java.io.Reader dstream)

-  {

-    this(dstream, 1, 1, 4096);

-  }

-

-  /** Reinitialise. */

-  void reInit(java.io.Reader dstream, int startline,

-  int startcolumn, int buffersize)

-  {

-    inputStream = dstream;

-    line = startline;

-    column = startcolumn - 1;

-

-    if (buffer == null || buffersize != buffer.length)

-    {

-      available = bufsize = buffersize;

-      buffer = new char[buffersize];

-      bufline = new int[buffersize];

-      bufcolumn = new int[buffersize];

-    }

-    prevCharIsLF = prevCharIsCR = false;

-    tokenBegin = inBuf = maxNextCharInd = 0;

-    bufpos = -1;

-  }

-

-  /** Reinitialise. */

-  protected void reInit(java.io.Reader dstream, int startline,

-                     int startcolumn)

-  {

-    reInit(dstream, startline, startcolumn, 4096);

-  }

-

-  /** Reinitialise. */

-  protected void reInit(java.io.Reader dstream)

-  {

-    reInit(dstream, 1, 1, 4096);

-  }

-  /** Constructor. */

-  protected SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,

-  int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException

-  {

-    this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);

-  }

-

-  /** Constructor. */

-  protected SimpleCharStream(java.io.InputStream dstream, int startline,

-  int startcolumn, int buffersize)

-  {

-    this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);

-  }

-

-  /** Constructor. */

-  protected SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,

-                          int startcolumn) throws java.io.UnsupportedEncodingException

-  {

-    this(dstream, encoding, startline, startcolumn, 4096);

-  }

-

-  /** Constructor. */

-  protected SimpleCharStream(java.io.InputStream dstream, int startline,

-                          int startcolumn)

-  {

-    this(dstream, startline, startcolumn, 4096);

-  }

-

-  /** Constructor. */

-  protected SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException

-  {

-    this(dstream, encoding, 1, 1, 4096);

-  }

-

-  /** Constructor. */

-  protected SimpleCharStream(java.io.InputStream dstream)

-  {

-    this(dstream, 1, 1, 4096);

-  }

-

-  /** Reinitialise. */

-  protected void reInit(java.io.InputStream dstream, String encoding, int startline,

-                          int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException

-  {

-    reInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);

-  }

-

-  /** Reinitialise. */

-  protected void reInit(java.io.InputStream dstream, int startline,

-                          int startcolumn, int buffersize)

-  {

-    reInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);

-  }

-

-  /** Reinitialise. */

-  protected void reInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException

-  {

-    reInit(dstream, encoding, 1, 1, 4096);

-  }

-

-  /** Reinitialise. */

-  protected void reInit(java.io.InputStream dstream)

-  {

-    reInit(dstream, 1, 1, 4096);

-  }

-  /** Reinitialise. */

-  protected void reInit(java.io.InputStream dstream, String encoding, int startline,

-                     int startcolumn) throws java.io.UnsupportedEncodingException

-  {

-    reInit(dstream, encoding, startline, startcolumn, 4096);

-  }

-  /** Reinitialise. */

-  protected void reInit(java.io.InputStream dstream, int startline,

-                     int startcolumn)

-  {

-    reInit(dstream, startline, startcolumn, 4096);

-  }

-  /** Get token literal value. */

-  protected String getImage()

-  {

-    if (bufpos >= tokenBegin)

-      return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);

-    else

-      return new String(buffer, tokenBegin, bufsize - tokenBegin) +

-                            new String(buffer, 0, bufpos + 1);

-  }

-

-  /** Get the suffix. */

-  protected char[] getSuffix(int len)

-  {

-    char[] ret = new char[len];

-

-    if ((bufpos + 1) >= len)

-      System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);

-    else

-    {

-      System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,

-                                                        len - bufpos - 1);

-      System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);

-    }

-

-    return ret;

-  }

-

-  /** Reset buffer when finished. */

-  protected void done()

-  {

-    buffer = null;

-    bufline = null;

-    bufcolumn = null;

-  }

-

-  /**

-   * Method to adjust line and column numbers for the start of a token.

-   */

-  protected void adjustBeginLineColumn(int newLine, int newCol)

-  {

-    int start = tokenBegin;

-    int len;

-

-    if (bufpos >= tokenBegin)

-    {

-      len = bufpos - tokenBegin + inBuf + 1;

-    }

-    else

-    {

-      len = bufsize - tokenBegin + bufpos + 1 + inBuf;

-    }

-

-    int i = 0, j = 0, k = 0;

-    int nextColDiff = 0, columnDiff = 0;

-

-    while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize])

-    {

-      bufline[j] = newLine;

-      nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];

-      bufcolumn[j] = newCol + columnDiff;

-      columnDiff = nextColDiff;

-      i++;

-    }

-

-    if (i < len)

-    {

-      bufline[j] = newLine++;

-      bufcolumn[j] = newCol + columnDiff;

-

-      while (i++ < len)

-      {

-        if (bufline[j = start % bufsize] != bufline[++start % bufsize])

-          bufline[j] = newLine++;

-        else

-          bufline[j] = newLine;

-      }

-    }

-

-    line = bufline[j];

-    column = bufcolumn[j];

-  }

-

-}

-/* JavaCC - OriginalChecksum=ec4e178f3ccf05ea2ca32d15e09312ca (do not edit this line) */

diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/SimpleUnitFormat.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/SimpleUnitFormat.java
deleted file mode 100644
index 29c2bdf..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/SimpleUnitFormat.java
+++ /dev/null
@@ -1,984 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil and others - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.format;

-

-import static org.eclipse.uomo.units.impl.system.MetricPrefix.*;

-import static org.eclipse.uomo.units.impl.system.Units.LITRE;

-

-import java.io.IOException;

-import java.lang.CharSequence;

-import java.text.FieldPosition;

-import java.text.ParsePosition;

-import java.util.HashMap;

-import java.util.Map;

-

-import org.eclipse.uomo.units.AbstractUnit;

-import org.eclipse.uomo.units.AbstractUnitFormat;

-import org.eclipse.uomo.units.SymbolMap;

-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 org.eclipse.uomo.units.impl.AlternateUnit;

-import org.eclipse.uomo.units.impl.BaseUnit;

-import org.eclipse.uomo.units.impl.ProductUnit;

-import org.eclipse.uomo.units.impl.TransformedUnit;

-import org.eclipse.uomo.units.impl.system.Units;

-import org.eclipse.uomo.units.impl.system.MetricPrefix;

-

-import javax.measure.Unit;

-import javax.measure.UnitConverter;

-import javax.measure.Quantity;

-import javax.measure.format.ParserException;

-import javax.measure.format.UnitFormat;

-

-/**

- * <p>

- * This class implements the {@link UnitFormat} interface for formatting and

- * parsing {@link Unit units}.

- * </p>

- * 

- * <p>

- * For all SI units, the 20 SI prefixes used to form decimal multiples and

- * sub-multiples of SI units are recognized. {@link Units} are directly

- * recognized. For example:<br>

- * <code>

- *        AbstractUnit.parse("m°C").equals(MetricPrefix.MILLI(Units.CELSIUS))

- *        AbstractUnit.parse("kW").equals(MetricPrefix.KILO(Units.WATT))

- *        AbstractUnit.parse("ft").equals(Units.METRE.multiply(0.3048))</code>

- * </p>

- *

- * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @author Eric Russell

- * @version 1.0.3, June 7, 2017

- * @since 1.0

- */

-public abstract class SimpleUnitFormat extends AbstractUnitFormat {

-	/**

-	 * 

-	 */

-	// private static final long serialVersionUID = 4149424034841739785L;

-

-	/**

-	 * Flavor of this format

-	 *

-	 * @author Werner

-	 *

-	 */

-	public enum Flavor {

-		Default, ASCII

-	}

-

-	/**

-	 * Holds the standard unit format.

-	 */

-	private static final DefaultFormat DEFAULT = new DefaultFormat();

-

-	/**

-	 * Holds the ASCIIFormat unit format.

-	 */

-	private static final ASCIIFormat ASCII = new ASCIIFormat();

-

-	/**

-	 * Returns the unit format for the default locale (format used by

-	 * {@link AbstractUnit#parse(CharSequence) AbstractUnit.parse(CharSequence)}

-	 * and {@link Unit#toString() Unit.toString()}).

-	 *

-	 * @return the default unit format (locale sensitive).

-	 */

-	public static SimpleUnitFormat getInstance() {

-		return getInstance(Flavor.Default);

-	}

-

-	/**

-	 * Returns the {@link SimpleUnitFormat} in the desired {@link Flavor}

-	 *

-	 * @return the instance for the given {@link Flavor}.

-	 */

-	public static SimpleUnitFormat getInstance(Flavor flavor) {

-		switch (flavor) {

-		case ASCII:

-			return SimpleUnitFormat.ASCII;

-		default:

-			return DEFAULT;

-		}

-	}

-

-	/**

-	 * Base constructor.

-	 */

-	protected SimpleUnitFormat() {

-	}

-

-	/**

-	 * Formats the specified unit.

-	 *

-	 * @param unit

-	 *            the unit to format.

-	 * @param appendable

-	 *            the appendable destination.

-	 * @throws IOException

-	 *             if an error occurs.

-	 */

-	public abstract Appendable format(Unit<?> unit, Appendable appendable) throws IOException;

-

-	/**

-	 * Parses a sequence of character to produce a unit or a rational product of

-	 * unit.

-	 *

-	 * @param csq

-	 *            the <code>CharSequence</code> to parse.

-	 * @param pos

-	 *            an object holding the parsing index and error position.

-	 * @return an {@link Unit} parsed from the character sequence.

-	 * @throws IllegalArgumentException

-	 *             if the character sequence contains an illegal syntax.

-	 */

-	@SuppressWarnings("rawtypes")

-	public abstract Unit<? extends Quantity> parseProductUnit(CharSequence csq, ParsePosition pos)

-			throws ParserException;

-

-	/**

-	 * Parses a sequence of character to produce a single unit.

-	 *

-	 * @param csq

-	 *            the <code>CharSequence</code> to parse.

-	 * @param pos

-	 *            an object holding the parsing index and error position.

-	 * @return an {@link Unit} parsed from the character sequence.

-	 * @throws IllegalArgumentException

-	 *             if the character sequence does not contain a valid unit

-	 *             identifier.

-	 */

-	@SuppressWarnings("rawtypes")

-	public abstract Unit<? extends Quantity> parseSingleUnit(CharSequence csq, ParsePosition pos)

-			throws ParserException;

-

-	/**

-	 * Attaches a system-wide label to the specified unit. For example:

-	 * <code> SimpleUnitFormat.getInstance().label(DAY.multiply(365), "year");

-	 * SimpleUnitFormat.getInstance().label(METER.multiply(0.3048), "ft"); </code>

-	 * If the specified label is already associated to an unit the previous

-	 * association is discarded or ignored.

-	 *

-	 * @param unit

-	 *            the unit being labeled.

-	 * @param label

-	 *            the new label for this unit.

-	 * @throws IllegalArgumentException

-	 *             if the label is not a

-	 *             {@link SimpleUnitFormat#isValidIdentifier(String)} valid

-	 *             identifier.

-	 */

-	public abstract void label(Unit<?> unit, String label);

-

-	public boolean isLocaleSensitive() {

-		return false;

-	}

-

-	/**

-	 * Attaches a system-wide alias to this unit. Multiple aliases may be

-	 * attached to the same unit. Aliases are used during parsing to recognize

-	 * different variants of the same unit. For example:

-	 * <code> SimpleUnitFormat.getInstance().alias(METER.multiply(0.3048), "foot");

-	 * SimpleUnitFormat.getInstance().alias(METER.multiply(0.3048), "feet"); SimpleUnitFormat.getInstance().alias(METER, "meter");

-	 * SimpleUnitFormat.getInstance().alias(METER, "metre"); </code> If the

-	 * specified label is already associated to an unit the previous association

-	 * is discarded or ignored.

-	 *

-	 * @param unit

-	 *            the unit being aliased.

-	 * @param alias

-	 *            the alias attached to this unit.

-	 * @throws IllegalArgumentException

-	 *             if the label is not a

-	 *             {@link SimpleUnitFormat#isValidIdentifier(String)} valid

-	 *             identifier.

-	 */

-	public abstract void alias(Unit<?> unit, String alias);

-

-	/**

-	 * Indicates if the specified name can be used as unit identifier.

-	 *

-	 * @param name

-	 *            the identifier to be tested.

-	 * @return <code>true</code> if the name specified can be used as label or

-	 *         alias for this format;<code>false</code> otherwise.

-	 */

-	public abstract boolean isValidIdentifier(String name);

-

-	/**

-	 * Formats an unit and appends the resulting text to a given string buffer

-	 * (implements <code>java.text.Format</code>).

-	 *

-	 * @param unit

-	 *            the unit to format.

-	 * @param toAppendTo

-	 *            where the text is to be appended

-	 * @param pos

-	 *            the field position (not used).

-	 * @return <code>toAppendTo</code>

-	 */

-	public final StringBuffer format(Object unit, final StringBuffer toAppendTo, FieldPosition pos) {

-		try {

-			Object dest = toAppendTo;

-			if (dest instanceof Appendable) {

-				format((Unit<?>) unit, (Appendable) dest);

-			} else { // When retroweaver is used to produce 1.4 binaries.

-				format((Unit<?>) unit, new Appendable() {

-

-					public Appendable append(char arg0) throws IOException {

-						toAppendTo.append(arg0);

-						return null;

-					}

-

-					public Appendable append(CharSequence arg0) throws IOException {

-						toAppendTo.append(arg0);

-						return null;

-					}

-

-					public Appendable append(CharSequence arg0, int arg1, int arg2) throws IOException {

-						toAppendTo.append(arg0.subSequence(arg1, arg2));

-						return null;

-					}

-				});

-			}

-			return toAppendTo;

-		} catch (IOException e) {

-			throw new Error(e); // Should never happen.

-		}

-	}

-

-	/**

-	 * Parses the text from a string to produce an object (implements

-	 * <code>java.text.Format</code>).

-	 *

-	 * @param source

-	 *            the string source, part of which should be parsed.

-	 * @param pos

-	 *            the cursor position.

-	 * @return the corresponding unit or <code>null</code> if the string cannot

-	 *         be parsed.

-	 */

-	public final Unit<?> parseObject(String source, ParsePosition pos) throws ParserException {

-		// int start = pos.getIndex();

-		return parseProductUnit(source, pos);

-		/*

-		 * } catch (ParserException e) { pos.setIndex(start);

-		 * pos.setErrorIndex(e.getPosition()); return null; }

-		 */

-	}

-

-	/**

-	 * This class represents an exponent with both a power (numerator) and a

-	 * root (denominator).

-	 */

-	private static class Exponent {

-		public final int pow;

-		public final int root;

-

-		public Exponent(int pow, int root) {

-			this.pow = pow;

-			this.root = root;

-		}

-	}

-

-	/**

-	 * This class represents the standard format.

-	 */

-	protected static class DefaultFormat extends SimpleUnitFormat {

-

-		/**

-		 * Holds the name to unit mapping.

-		 */

-		final HashMap<String, Unit<?>> _nameToUnit = new HashMap<>();

-

-		/**

-		 * Holds the unit to name mapping.

-		 */

-		final HashMap<Unit<?>, String> _unitToName = new HashMap<>();

-

-		@Override

-		public void label(Unit<?> unit, String label) {

-			if (!isValidIdentifier(label))

-				throw new IllegalArgumentException("Label: " + label + " is not a valid identifier.");

-			synchronized (this) {

-				_nameToUnit.put(label, unit);

-				_unitToName.put(unit, label);

-			}

-		}

-

-		@Override

-		public void alias(Unit<?> unit, String alias) {

-			if (!isValidIdentifier(alias))

-				throw new IllegalArgumentException("Alias: " + alias + " is not a valid identifier.");

-			synchronized (this) {

-				_nameToUnit.put(alias, unit);

-			}

-		}

-

-		@Override

-		public boolean isValidIdentifier(String name) {

-			if ((name == null) || (name.length() == 0))

-				return false;

-			/*

-			 * for (int i = 0; i < name.length(); i++) { if

-			 * (!isUnitIdentifierPart(name.charAt(i))) return false; }

-			 */

-			return isUnitIdentifierPart(name.charAt(0));

-		}

-

-		static boolean isUnitIdentifierPart(char ch) {

-			return Character.isLetter(ch) || (!Character.isWhitespace(ch) && !Character.isDigit(ch) && (ch != '\u00b7')

-					&& (ch != '*') && (ch != '/') && (ch != '(') && (ch != ')') && (ch != '[') && (ch != ']')

-					&& (ch != '\u00b9') && (ch != '\u00b2') && (ch != '\u00b3') && (ch != '^') && (ch != '+')

-					&& (ch != '-'));

-		}

-

-		// Returns the name for the specified unit or null if product unit.

-		protected String nameFor(Unit<?> unit) {

-			// Searches label database.

-			String label = _unitToName.get(unit);

-			if (label != null)

-				return label;

-			if (unit instanceof BaseUnit)

-				return ((BaseUnit<?>) unit).getSymbol();

-			if (unit instanceof AlternateUnit)

-				return ((AlternateUnit<?>) unit).getSymbol();

-			if (unit instanceof TransformedUnit) {

-				TransformedUnit<?> tfmUnit = (TransformedUnit<?>) unit;

-				Unit<?> baseUnit = tfmUnit.getParentUnit();

-				UnitConverter cvtr = tfmUnit.getConverterToMetric(); // tfmUnit.getSystemConverter();

-				StringBuilder result = new StringBuilder();

-				String baseUnitName = baseUnit.toString();

-				String prefix = prefixFor(cvtr);

-				if ((baseUnitName.indexOf('\u00b7') >= 0) || (baseUnitName.indexOf('*') >= 0)

-						|| (baseUnitName.indexOf('/') >= 0)) {

-					// We could use parentheses whenever baseUnits is an

-					// instanceof ProductUnit, but most ProductUnits have

-					// aliases,

-					// so we'd end up with a lot of unnecessary parentheses.

-					result.append('(');

-					result.append(baseUnitName);

-					result.append(')');

-				} else {

-					result.append(baseUnitName);

-				}

-				if (prefix != null) {

-					result.insert(0, prefix);

-				} else {

-					if (cvtr instanceof AddConverter) {

-						result.append('+');

-						result.append(((AddConverter) cvtr).getOffset());

-					} else if (cvtr instanceof RationalConverter) {

-						double dividend = ((RationalConverter) cvtr).getDividend().doubleValue();

-						if (dividend != 1) {

-							result.append('*');

-							result.append(dividend);

-						}

-						double divisor = ((RationalConverter) cvtr).getDivisor().doubleValue();

-						if (divisor != 1) {

-							result.append('/');

-							result.append(divisor);

-						}

-					} else if (cvtr instanceof MultiplyConverter) {

-						result.append('*');

-						result.append(((MultiplyConverter) cvtr).getFactor());

-					} else { // Other converters.

-						return "[" + baseUnit + "?]";

-					}

-				}

-				return result.toString();

-			}

-			// Compound unit.

-			// if (unit instanceof CompoundUnit) {

-			// CompoundUnit<?> cpdUnit = (CompoundUnit<?>) unit;

-			// return nameFor(cpdUnit.getHigher()).toString() + ":"

-			// + nameFor(cpdUnit.getLower());

-			// }

-			return null; // Product unit.

-		}

-

-		// Returns the prefix for the specified unit converter.

-		protected String prefixFor(UnitConverter converter) {

-			for (int i = 0; i < CONVERTERS.length; i++) {

-				if (CONVERTERS[i].equals(converter)) {

-					return PREFIXES[i];

-				}

-			}

-			return null; // TODO or return blank?

-		}

-

-		// Returns the unit for the specified name.

-		protected Unit<?> unitFor(String name) {

-			Unit<?> unit = _nameToUnit.get(name);

-			if (unit != null)

-				return unit;

-			unit = SYMBOL_TO_UNIT.get(name);

-			return unit;

-		}

-

-		// //////////////////////////

-		// Parsing.

-		@SuppressWarnings({ "rawtypes", "unchecked" })

-		public Unit<? extends Quantity> parseSingleUnit(CharSequence csq, ParsePosition pos) throws ParserException {

-			int startIndex = pos.getIndex();

-			String name = readIdentifier(csq, pos);

-			Unit unit = unitFor(name);

-			check(unit != null, name + " not recognized", csq, startIndex);

-			return unit;

-		}

-

-		@SuppressWarnings({ "rawtypes", "unchecked" })

-		@Override

-		public Unit<? extends Quantity> parseProductUnit(CharSequence csq, ParsePosition pos) throws ParserException {

-			Unit result = AbstractUnit.ONE;

-			int token = nextToken(csq, pos);

-			switch (token) {

-			case IDENTIFIER:

-				result = parseSingleUnit(csq, pos);

-				break;

-			case OPEN_PAREN:

-				pos.setIndex(pos.getIndex() + 1);

-				result = parseProductUnit(csq, pos);

-				token = nextToken(csq, pos);

-				check(token == CLOSE_PAREN, "')' expected", csq, pos.getIndex());

-				pos.setIndex(pos.getIndex() + 1);

-				break;

-			}

-			token = nextToken(csq, pos);

-			while (true) {

-				switch (token) {

-				case EXPONENT:

-					Exponent e = readExponent(csq, pos);

-					if (e.pow != 1) {

-						result = result.pow(e.pow);

-					}

-					if (e.root != 1) {

-						result = result.root(e.root);

-					}

-					break;

-				case MULTIPLY:

-					pos.setIndex(pos.getIndex() + 1);

-					token = nextToken(csq, pos);

-					if (token == INTEGER) {

-						long n = readLong(csq, pos);

-						if (n != 1) {

-							result = result.multiply(n);

-						}

-					} else if (token == FLOAT) {

-						double d = readDouble(csq, pos);

-						if (d != 1.0) {

-							result = result.multiply(d);

-						}

-					} else {

-						result = result.multiply(parseProductUnit(csq, pos));

-					}

-					break;

-				case DIVIDE:

-					pos.setIndex(pos.getIndex() + 1);

-					token = nextToken(csq, pos);

-					if (token == INTEGER) {

-						long n = readLong(csq, pos);

-						if (n != 1) {

-							result = result.divide(n);

-						}

-					} else if (token == FLOAT) {

-						double d = readDouble(csq, pos);

-						if (d != 1.0) {

-							result = result.divide(d);

-						}

-					} else {

-						result = result.divide(parseProductUnit(csq, pos));

-					}

-					break;

-				case PLUS:

-					pos.setIndex(pos.getIndex() + 1);

-					token = nextToken(csq, pos);

-					if (token == INTEGER) {

-						long n = readLong(csq, pos);

-						if (n != 1) {

-							result = result.shift(n);

-						}

-					} else if (token == FLOAT) {

-						double d = readDouble(csq, pos);

-						if (d != 1.0) {

-							result = result.shift(d);

-						}

-					} else {

-						throw new ParserException("not a number", pos.getIndex());

-					}

-					break;

-				case EOF:

-				case CLOSE_PAREN:

-					return result;

-				default:

-					throw new ParserException("unexpected token " + token, pos.getIndex());

-				}

-				token = nextToken(csq, pos);

-			}

-		}

-

-		private static final int EOF = 0;

-		private static final int IDENTIFIER = 1;

-		private static final int OPEN_PAREN = 2;

-		private static final int CLOSE_PAREN = 3;

-		private static final int EXPONENT = 4;

-		private static final int MULTIPLY = 5;

-		private static final int DIVIDE = 6;

-		private static final int PLUS = 7;

-		private static final int INTEGER = 8;

-		private static final int FLOAT = 9;

-

-		private int nextToken(CharSequence csq, ParsePosition pos) {

-			final int length = csq.length();

-			while (pos.getIndex() < length) {

-				char c = csq.charAt(pos.getIndex());

-				if (isUnitIdentifierPart(c)) {

-					return IDENTIFIER;

-				} else if (c == '(') {

-					return OPEN_PAREN;

-				} else if (c == ')') {

-					return CLOSE_PAREN;

-				} else if ((c == '^') || (c == '\u00b9') || (c == '\u00b2') || (c == '\u00b3')) {

-					return EXPONENT;

-				} else if (c == '*') {

-					char c2 = csq.charAt(pos.getIndex() + 1);

-					if (c2 == '*') {

-						return EXPONENT;

-					} else {

-						return MULTIPLY;

-					}

-				} else if (c == '\u00b7') {

-					return MULTIPLY;

-				} else if (c == '/') {

-					return DIVIDE;

-				} else if (c == '+') {

-					return PLUS;

-				} else if ((c == '-') || Character.isDigit(c)) {

-					int index = pos.getIndex() + 1;

-					while ((index < length) && (Character.isDigit(c) || (c == '-') || (c == '.') || (c == 'E'))) {

-						c = csq.charAt(index++);

-						if (c == '.') {

-							return FLOAT;

-						}

-					}

-					return INTEGER;

-				}

-				pos.setIndex(pos.getIndex() + 1);

-			}

-			return EOF;

-		}

-

-		private void check(boolean expr, String message, CharSequence csq, int index) throws ParserException {

-			if (!expr) {

-				throw new ParserException(message + " (in " + csq + " at index " + index + ")", index);

-			}

-		}

-

-		private Exponent readExponent(CharSequence csq, ParsePosition pos) {

-			char c = csq.charAt(pos.getIndex());

-			if (c == '^') {

-				pos.setIndex(pos.getIndex() + 1);

-			} else if (c == '*') {

-				pos.setIndex(pos.getIndex() + 2);

-			}

-			final int length = csq.length();

-			int pow = 0;

-			boolean isPowNegative = false;

-			int root = 0;

-			boolean isRootNegative = false;

-			boolean isRoot = false;

-			while (pos.getIndex() < length) {

-				c = csq.charAt(pos.getIndex());

-				if (c == '\u00b9') {

-					if (isRoot) {

-						root = root * 10 + 1;

-					} else {

-						pow = pow * 10 + 1;

-					}

-				} else if (c == '\u00b2') {

-					if (isRoot) {

-						root = root * 10 + 2;

-					} else {

-						pow = pow * 10 + 2;

-					}

-				} else if (c == '\u00b3') {

-					if (isRoot) {

-						root = root * 10 + 3;

-					} else {

-						pow = pow * 10 + 3;

-					}

-				} else if (c == '-') {

-					if (isRoot) {

-						isRootNegative = true;

-					} else {

-						isPowNegative = true;

-					}

-				} else if ((c >= '0') && (c <= '9')) {

-					if (isRoot) {

-						root = root * 10 + (c - '0');

-					} else {

-						pow = pow * 10 + (c - '0');

-					}

-				} else if (c == ':') {

-					isRoot = true;

-				} else {

-					break;

-				}

-				pos.setIndex(pos.getIndex() + 1);

-			}

-			if (pow == 0)

-				pow = 1;

-			if (root == 0)

-				root = 1;

-			return new Exponent(isPowNegative ? -pow : pow, isRootNegative ? -root : root);

-		}

-

-		private long readLong(CharSequence csq, ParsePosition pos) {

-			final int length = csq.length();

-			int result = 0;

-			boolean isNegative = false;

-			while (pos.getIndex() < length) {

-				char c = csq.charAt(pos.getIndex());

-				if (c == '-') {

-					isNegative = true;

-				} else if ((c >= '0') && (c <= '9')) {

-					result = result * 10 + (c - '0');

-				} else {

-					break;

-				}

-				pos.setIndex(pos.getIndex() + 1);

-			}

-			return isNegative ? -result : result;

-		}

-

-		private double readDouble(CharSequence csq, ParsePosition pos) {

-			final int length = csq.length();

-			int start = pos.getIndex();

-			int end = start + 1;

-			while (end < length) {

-				if ("0123456789+-.E".indexOf(csq.charAt(end)) < 0) {

-					break;

-				}

-				end += 1;

-			}

-			pos.setIndex(end + 1);

-			return Double.parseDouble(csq.subSequence(start, end).toString());

-		}

-

-		private String readIdentifier(CharSequence csq, ParsePosition pos) {

-			final int length = csq.length();

-			int start = pos.getIndex();

-			int i = start;

-			while ((++i < length) && isUnitIdentifierPart(csq.charAt(i))) {

-			}

-			pos.setIndex(i);

-			return csq.subSequence(start, i).toString();

-		}

-

-		// //////////////////////////

-		// Formatting.

-

-		@Override

-		public Appendable format(Unit<?> unit, Appendable appendable) throws IOException {

-			String name = nameFor(unit);

-			if (name != null) {

-				return appendable.append(name);

-			}

-			if (!(unit instanceof ProductUnit)) {

-				throw new IllegalArgumentException("Cannot format given Object as a Unit");

-			}

-

-			// Product unit.

-			ProductUnit<?> productUnit = (ProductUnit<?>) unit;

-			int invNbr = 0;

-

-			// Write positive exponents first.

-			boolean start = true;

-			for (int i = 0; i < productUnit.getUnitCount(); i++) {

-				int pow = productUnit.getUnitPow(i);

-				if (pow >= 0) {

-					if (!start) {

-						appendable.append('\u00b7'); // Separator.

-					}

-					name = nameFor(productUnit.getUnit(i));

-					int root = productUnit.getUnitRoot(i);

-					append(appendable, name, pow, root);

-					start = false;

-				} else {

-					invNbr++;

-				}

-			}

-

-			// Write negative exponents.

-			if (invNbr != 0) {

-				if (start) {

-					appendable.append('1'); // e.g. 1/s

-				}

-				appendable.append('/');

-				if (invNbr > 1) {

-					appendable.append('(');

-				}

-				start = true;

-				for (int i = 0; i < productUnit.getUnitCount(); i++) {

-					int pow = productUnit.getUnitPow(i);

-					if (pow < 0) {

-						name = nameFor(productUnit.getUnit(i));

-						int root = productUnit.getUnitRoot(i);

-						if (!start) {

-							appendable.append('\u00b7'); // Separator.

-						}

-						append(appendable, name, -pow, root);

-						start = false;

-					}

-				}

-				if (invNbr > 1) {

-					appendable.append(')');

-				}

-			}

-			return appendable;

-		}

-

-		private void append(Appendable appendable, CharSequence symbol, int pow, int root) throws IOException {

-			appendable.append(symbol);

-			if ((pow != 1) || (root != 1)) {

-				// Write exponent.

-				if ((pow == 2) && (root == 1)) {

-					appendable.append('\u00b2'); // Square

-				} else if ((pow == 3) && (root == 1)) {

-					appendable.append('\u00b3'); // Cubic

-				} else {

-					// Use general exponent form.

-					appendable.append('^');

-					appendable.append(String.valueOf(pow));

-					if (root != 1) {

-						appendable.append(':');

-						appendable.append(String.valueOf(root));

-					}

-				}

-			}

-		}

-

-		// private static final long serialVersionUID = 1L;

-

-		@Override

-		public Unit<?> parse(CharSequence csq) throws ParserException {

-			return parse(csq, 0);

-		}

-

-		protected Unit<?> parse(CharSequence csq, int index) throws ParserException {

-			return parseObject(csq.toString(), new ParsePosition(index));

-		}

-

-		@Override

-		protected SymbolMap getSymbolMap() {

-			// TODO Auto-generated method stub

-			return null;

-		}

-

-		@Override

-		public Unit<?> parse(CharSequence csq, ParsePosition cursor) throws IllegalArgumentException {

-			// TODO Auto-generated method stub

-			return null;

-		}

-	}

-

-	/**

-	 * This class represents the ASCII format.

-	 */

-	protected final static class ASCIIFormat extends DefaultFormat {

-

-		@Override

-		protected String nameFor(Unit<?> unit) {

-			// First search if specific ASCII name should be used.

-			String name = _unitToName.get(unit);

-			if (name != null)

-				return name;

-			// Else returns default name.

-			return DEFAULT.nameFor(unit);

-		}

-

-		@Override

-		protected Unit<?> unitFor(String name) {

-			// First search if specific ASCII name.

-			Unit<?> unit = _nameToUnit.get(name);

-			if (unit != null)

-				return unit;

-			// Else returns default mapping.

-			return DEFAULT.unitFor(name);

-		}

-

-		@Override

-		public Appendable format(Unit<?> unit, Appendable appendable) throws IOException {

-			String name = nameFor(unit);

-			if (name != null)

-				return appendable.append(name);

-			if (!(unit instanceof ProductUnit))

-				throw new IllegalArgumentException("Cannot format given Object as a Unit");

-

-			ProductUnit<?> productUnit = (ProductUnit<?>) unit;

-			for (int i = 0; i < productUnit.getUnitCount(); i++) {

-				if (i != 0) {

-					appendable.append('*'); // Separator.

-				}

-				name = nameFor(productUnit.getUnit(i));

-				int pow = productUnit.getUnitPow(i);

-				int root = productUnit.getUnitRoot(i);

-				appendable.append(name);

-				if ((pow != 1) || (root != 1)) {

-					// Use general exponent form.

-					appendable.append('^');

-					appendable.append(String.valueOf(pow));

-					if (root != 1) {

-						appendable.append(':');

-						appendable.append(String.valueOf(root));

-					}

-				}

-			}

-			return appendable;

-		}

-

-		@Override

-		public boolean isValidIdentifier(String name) {

-			if ((name == null) || (name.length() == 0))

-				return false;

-			// label must not begin with a digit or mathematical operator

-			return isUnitIdentifierPart(name.charAt(0)) && isAllASCII(name);

-			/*

-			 * for (int i = 0; i < name.length(); i++) { if

-			 * (!isAsciiCharacter(name.charAt(i))) return false; } return true;

-			 */

-		}

-	}

-

-	/**

-	 * Holds the unique symbols collection (base units or alternate units).

-	 */

-	private static final Map<String, Unit<?>> SYMBOL_TO_UNIT = new HashMap<>();

-

-	// //////////////////////////////////////////////////////////////////////////

-	// Initializes the standard unit database for SI units.

-

-	private static final Unit<?>[] SI_UNITS = { Units.AMPERE, Units.BECQUEREL, Units.CANDELA, Units.COULOMB,

-			Units.FARAD, Units.GRAY, Units.HENRY, Units.HERTZ, Units.JOULE, Units.KATAL, Units.KELVIN, Units.LUMEN,

-			Units.LUX, Units.METRE, Units.MOLE, Units.NEWTON, Units.OHM, Units.PASCAL, Units.RADIAN, Units.SECOND,

-			Units.SIEMENS, Units.SIEVERT, Units.STERADIAN, Units.TESLA, Units.VOLT, Units.WATT, Units.WEBER };

-

-	private static final String[] PREFIXES = { YOTTA.getSymbol(), ZETTA.getSymbol(), EXA.getSymbol(), PETA.getSymbol(),

-			TERA.getSymbol(), GIGA.getSymbol(), MEGA.getSymbol(), KILO.getSymbol(), HECTO.getSymbol(), DEKA.getSymbol(),

-			DECI.getSymbol(), CENTI.getSymbol(), MILLI.getSymbol(), MICRO.getSymbol(), NANO.getSymbol(),

-			PICO.getSymbol(), FEMTO.getSymbol(), ATTO.getSymbol(), ZEPTO.getSymbol(), YOCTO.getSymbol() };

-

-	// TODO we could try retrieving this dynamically in a static {} method from

-	// MetricPrefix if symbols above are also aligned

-	private static final UnitConverter[] CONVERTERS = { YOTTA.getConverter(), ZETTA.getConverter(), EXA.getConverter(),

-			PETA.getConverter(), TERA.getConverter(), GIGA.getConverter(), MEGA.getConverter(), KILO.getConverter(),

-			HECTO.getConverter(), DEKA.getConverter(), DECI.getConverter(), CENTI.getConverter(), MILLI.getConverter(),

-			MICRO.getConverter(), NANO.getConverter(), PICO.getConverter(), FEMTO.getConverter(), ATTO.getConverter(),

-			ZEPTO.getConverter(), YOCTO.getConverter() };

-

-	private static String asciiPrefix(String prefix) {

-		return prefix == "µ" ? "micro" : prefix;

-	}

-

-	// to check if a string only contains US-ASCII characters

-	//

-	protected static boolean isAllASCII(String input) {

-		boolean isASCII = true;

-		for (int i = 0; i < input.length(); i++) {

-			int c = input.charAt(i);

-			if (c > 0x7F) {

-				isASCII = false;

-				break;

-			}

-		}

-		return isASCII;

-	}

-

-	static {

-		for (int i = 0; i < SI_UNITS.length; i++) {

-			Unit<?> si = SI_UNITS[i];

-			String symbol = (si instanceof BaseUnit) ? ((BaseUnit<?>) si).getSymbol()

-					: ((AlternateUnit<?>) si).getSymbol();

-			DEFAULT.label(si, symbol);

-			if (isAllASCII(symbol))

-				ASCII.label(si, symbol);

-			for (int j = 0; j < PREFIXES.length; j++) {

-				Unit<?> u = si.transform(CONVERTERS[j]);

-				DEFAULT.label(u, PREFIXES[j] + symbol);

-				if (PREFIXES[j] == "µ") {

-					ASCII.label(u, "micro"); // + symbol);

-				}

-			}

-		}

-		// Special case for KILOGRAM.

-		DEFAULT.label(Units.GRAM, "g");

-		for (int i = 0; i < PREFIXES.length; i++) {

-			if (CONVERTERS[i] == KILO.getConverter()) // TODO should it better

-				// be equals()?

-				continue; // kg is already defined.

-			DEFAULT.label(Units.KILOGRAM.transform(CONVERTERS[i].concatenate(MILLI.getConverter())), PREFIXES[i] + "g");

-			if (PREFIXES[i] == "µ") {

-				ASCII.label(Units.KILOGRAM.transform(CONVERTERS[i].concatenate(MILLI.getConverter())), "microg");

-			}

-		}

-

-		// Alias and ASCIIFormat for Ohm

-		DEFAULT.alias(Units.OHM, "Ohm");

-		ASCII.label(Units.OHM, "Ohm");

-		for (int i = 0; i < PREFIXES.length; i++) {

-			DEFAULT.alias(Units.OHM.transform(CONVERTERS[i]), PREFIXES[i] + "Ohm");

-			ASCII.label(Units.OHM.transform(CONVERTERS[i]), asciiPrefix(PREFIXES[i]) + "Ohm");

-		}

-

-		// Special case for DEGREE_CElSIUS.

-		// DEFAULT.label(Units.CELSIUS, "°C");

-		DEFAULT.label(Units.CELSIUS, "\u00b0C");

-		DEFAULT.alias(Units.CELSIUS, "℃");

-		// DEFAULT.alias(Units.CELSIUS, "°C");

-		ASCII.label(Units.CELSIUS, "Celsius");

-		for (int i = 0; i < PREFIXES.length; i++) {

-			DEFAULT.label(Units.CELSIUS.transform(CONVERTERS[i]), PREFIXES[i] + "℃");

-			DEFAULT.alias(Units.CELSIUS.transform(CONVERTERS[i]), PREFIXES[i] + "°C");

-			ASCII.label(Units.CELSIUS.transform(CONVERTERS[i]), asciiPrefix(PREFIXES[i]) + "Celsius");

-		}

-

-		DEFAULT.label(Units.PERCENT, "%");

-		DEFAULT.label(Units.KILOGRAM, "kg");

-		DEFAULT.label(Units.METRE, "m");

-		DEFAULT.label(Units.SECOND, "s");

-		DEFAULT.label(Units.MINUTE, "min");

-		DEFAULT.label(Units.HOUR, "h");

-		DEFAULT.label(Units.DAY, "day");

-		DEFAULT.label(Units.WEEK, "week");

-		DEFAULT.label(Units.YEAR, "year");

-		DEFAULT.label(Units.KILOMETRE_PER_HOUR, "km/h");

-		DEFAULT.label(Units.CUBIC_METRE, "\u33A5");

-		ASCII.label(Units.CUBIC_METRE, "m3");

-		ASCII.label(LITRE, "l");

-		DEFAULT.label(LITRE, "l");

-		DEFAULT.label(MetricPrefix.NANO(LITRE), "nl");

-		ASCII.label(MetricPrefix.NANO(LITRE), "nl");

-		DEFAULT.label(MetricPrefix.MICRO(LITRE), "µl");

-		ASCII.label(MetricPrefix.MICRO(LITRE), "microL");

-		ASCII.label(MetricPrefix.MILLI(LITRE), "mL");

-		DEFAULT.label(MetricPrefix.MILLI(LITRE), "ml");

-		ASCII.label(MetricPrefix.CENTI(LITRE), "cL");

-		DEFAULT.label(MetricPrefix.CENTI(LITRE), "cl");

-		ASCII.label(MetricPrefix.DECI(LITRE), "dL");

-		DEFAULT.label(MetricPrefix.DECI(LITRE), "dl");

-		DEFAULT.label(Units.NEWTON, "N");

-		ASCII.label(Units.NEWTON, "N");

-		DEFAULT.label(Units.RADIAN, "rad");

-		ASCII.label(Units.RADIAN, "rad");

-	}

-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/SymbolMapImpl.java b/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/SymbolMapImpl.java
deleted file mode 100644
index dbe8b3c..0000000
--- a/bundles/org.eclipse.uomo.units/src/main/java/org/eclipse/uomo/units/impl/format/SymbolMapImpl.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*

- * Copyright (c) 2005, 2017, 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

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Werner Keil, Eric Russell - initial API and implementation

- */

-package org.eclipse.uomo.units.impl.format;

-

-import java.lang.reflect.Field;

-import java.util.Collections;

-import java.util.Comparator;

-import java.util.Enumeration;

-import java.util.HashMap;

-import java.util.List;

-import java.util.Map;

-import java.util.ResourceBundle;

-import java.util.TreeMap;

-import java.util.logging.Level;

-import java.util.logging.Logger;

-import java.util.stream.Collectors;

-import org.eclipse.uomo.units.AbstractUnit;

-import org.eclipse.uomo.units.impl.system.MetricPrefix;

-import javax.measure.Unit;

-import javax.measure.UnitConverter;

-

-/**

- * <p>

- * This class provides a set of mappings between {@link AbstractUnit units} and symbols (both ways), between {@link MetricPrefix prefixes} and symbols

- * (both ways), and from {@link AbstractConverter unit converters} to {@link MetricPrefix prefixes} (one way). No attempt is made to verify the

- * uniqueness of the mappings.

- * </p>

- *

- * <p>

- * Mappings are read from a <code>ResourceBundle</code>, the keys of which should consist of a fully-qualified class name, followed by a dot ('.'),

- * and then the name of a static field belonging to that class, followed optionally by another dot and a number. If the trailing dot and number are

- * not present, the value associated with the key is treated as a {@link SymbolMapImpl#label(AbstractUnit, String) label}, otherwise if the trailing dot

- * and number are present, the value is treated as an {@link SymbolMapImpl#alias(AbstractUnit,String) alias}. Aliases map from String to Unit only,

- * whereas labels map in both directions. A given unit may have any number of aliases, but may have only one label.

- * </p>

- *

- * @author <a href="mailto:eric-r@northwestern.edu">Eric Russell</a>

- * @author <a href="mailto:units@catmedia.us">Werner Keil</a>

- * @version 1.7, February 25, 2017

- */

-@SuppressWarnings("rawtypes")

-public final class SymbolMapImpl {

-  private static final Logger logger = Logger.getLogger(SymbolMapImpl.class.getName());

-

-  private final Map<String, Unit<?>> symbolToUnit;

-  private final Map<Unit<?>, String> unitToSymbol;

-  private final Map<String, Object> symbolToPrefix;

-  private final Map<Object, String> prefixToSymbol;

-  private final Map<UnitConverter, MetricPrefix> converterToPrefix;

-

-  /**

-   * Creates an empty mapping.

-   */

-  private SymbolMapImpl() {

-    symbolToUnit = new TreeMap<>();

-    unitToSymbol = new HashMap<>();

-    symbolToPrefix = new TreeMap<>();

-    prefixToSymbol = new HashMap<>();

-    converterToPrefix = new HashMap<>();

-  }

-

-  /**

-   * Creates a symbol map from the specified resource bundle,

-   *

-   * @param rb

-   *          the resource bundle.

-   */

-  private SymbolMapImpl(ResourceBundle rb) {

-    this();

-    for (Enumeration<String> i = rb.getKeys(); i.hasMoreElements();) {

-      String fqn = i.nextElement();

-      String symbol = rb.getString(fqn);

-      boolean isAlias = false;

-      int lastDot = fqn.lastIndexOf('.');

-      String className = fqn.substring(0, lastDot);

-      String fieldName = fqn.substring(lastDot + 1, fqn.length());

-      if (Character.isDigit(fieldName.charAt(0))) {

-        isAlias = true;

-        fqn = className;

-        lastDot = fqn.lastIndexOf('.');

-        className = fqn.substring(0, lastDot);

-        fieldName = fqn.substring(lastDot + 1, fqn.length());

-      }

-      try {

-        Class<?> c = Class.forName(className);

-        Field field = c.getField(fieldName);

-        Object value = field.get(null);

-        if (value instanceof Unit<?>) {

-          if (isAlias) {

-            alias((Unit) value, symbol);

-          } else {

-            label((AbstractUnit<?>) value, symbol);

-          }

-        } else if (value instanceof MetricPrefix) {

-          label((MetricPrefix) value, symbol);

-        } else {

-          throw new ClassCastException("unable to cast " + value + " to Unit or Prefix");

-        }

-      } catch (Exception error) {

-        logger.log(Level.SEVERE, "Error", error);

-      }

-    }

-  }

-

-  /**

-   * Creates a symbol map from the specified resource bundle,

-   *

-   * @param rb

-   *          the resource bundle.

-   */

-  public static SymbolMapImpl of(ResourceBundle rb) {

-    return new SymbolMapImpl(rb);

-  }

-

-  /**

-   * Attaches a label to the specified unit. For example:<br>

-   * <code> symbolMap.label(DAY.multiply(365), "year"); symbolMap.label(US.FOOT, "ft");

-   * </code>

-   *

-   * @param unit

-   *          the unit to label.

-   * @param symbol

-   *          the new symbol for the unit.

-   */

-  public void label(Unit<?> unit, String symbol) {

-    symbolToUnit.put(symbol, unit);

-    unitToSymbol.put(unit, symbol);

-  }

-

-  /**

-   * Attaches an alias to the specified unit. Multiple aliases may be attached to the same unit. Aliases are used during parsing to recognize

-   * different variants of the same unit.<code> symbolMap.alias(US.FOOT, "foot"); symbolMap.alias(US.FOOT, "feet");

-   * symbolMap.alias(Units.METER, "meter"); symbolMap.alias(Units.METER, "metre"); </code>

-   *

-   * @param unit

-   *          the unit to label.

-   * @param symbol

-   *          the new symbol for the unit.

-   */

-  public void alias(Unit<?> unit, String symbol) {

-    symbolToUnit.put(symbol, unit);

-  }

-

-  /**

-   * Attaches a label to the specified prefix. For example:<br>

-   * <code> symbolMap.label(MetricPrefix.GIGA, "G"); symbolMap.label(MetricPrefix.MICRO, "µ");

-   * </code>

-   */

-  public void label(MetricPrefix prefix, String symbol) {

-    symbolToPrefix.put(symbol, prefix);

-    prefixToSymbol.put(prefix, symbol);

-    converterToPrefix.put(prefix.getConverter(), prefix);

-  }

-

-  /**

-   * Returns the unit for the specified symbol.

-   *

-   * @param symbol

-   *          the symbol.

-   * @return the corresponding unit or <code>null</code> if none.

-   */

-  public Unit<?> getUnit(String symbol) {

-    return symbolToUnit.get(symbol);

-  }

-

-  /**

-   * Returns the symbol (label) for the specified unit.

-   *

-   * @param unit

-   *          the corresponding symbol.

-   * @return the corresponding symbol or <code>null</code> if none.

-   */

-  public String getSymbol(Unit<?> unit) {

-    return unitToSymbol.get(unit);

-  }

-

-  /**

-   * Returns the prefix (if any) for the specified symbol.

-   *

-   * @param symbol

-   *          the unit symbol.

-   * @return the corresponding prefix or <code>null</code> if none.

-   */

-  public MetricPrefix getPrefix(String symbol) {

-	final List<String> list = symbolToPrefix.keySet().stream().collect(Collectors.toList());

-	final Comparator<String> comparator = Comparator.comparing(String::length);

-	Collections.sort(list, comparator.reversed());

-

-	for (String key : list) {

-	    if (symbol.startsWith(key)) {

-		return (MetricPrefix) symbolToPrefix.get(key);

-	    }

-	}

-	return null;

-    }

-

-  /**

-   * Returns the prefix for the specified converter.

-   *

-   * @param converter

-   *          the unit converter.

-   * @return the corresponding prefix or <code>null</code> if none.

-   */

-  public MetricPrefix getPrefix(UnitConverter converter) {

-    return converterToPrefix.get(converter);

-  }

-

-  /**

-   * Returns the symbol for the specified prefix.

-   *

-   * @param prefix

-   *          the prefix.

-   * @return the corresponding symbol or <code>null</code> if none.

-   */

-  public String getSymbol(MetricPrefix prefix) {

-    return prefixToSymbol.get(prefix);

-  }

-

-  @Override

-  public String toString() {

-    StringBuilder sb = new StringBuilder();

-    sb.append("tec.units.indriya.format.SymbolMap: [");

-    sb.append("symbolToUnit: ").append(symbolToUnit).append(',');

-    sb.append("unitToSymbol: ").append(unitToSymbol).append(',');

-    sb.append("symbolToPrefix: ").append(symbolToPrefix).append(',');

-    sb.append("prefixToSymbol: ").append(prefixToSymbol).append(',');

-    sb.append("converterToPrefix: ").append(converterToPrefix).append(',');

-    sb.append("converterToPrefix: ").append(converterToPrefix);

-    sb.append(" ]");

-    return sb.toString();

-  }

-

-}

diff --git