571573: Remove Bintray/JCenter

Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=571573

Signed-off-by: Werner Keil <werner.keil@gmx.net>
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 32ddd0b..2fcf9cc 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, 2020, Copyright (c) 2006, 2017 Kestral Computing P/L and others.

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

@@ -7,6 +7,7 @@
  * 

  * Contributors:

  *    Kestral Computing P/L - initial implementation

+ *    Werner Keil - JSR 385 integration

  *    

  *******************************************************************************/

 

@@ -37,7 +38,7 @@
 import org.eclipse.uomo.ucum.special.SpecialUnitHandler;

 import org.eclipse.uomo.util.Registry;

 

-import tech.units.indriya.AbstractConverter;

+import tech.units.indriya.function.AbstractConverter;

 

 /**

  * = [mu_0] = 4.[pi].10*-7.N/A2 = (g.m/s2)/(C/s)2? = g.m/s2/(C2/s2) =

diff --git a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/DefinedUnit.java b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/DefinedUnit.java
index 22073e7..7581af6 100644
--- a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/DefinedUnit.java
+++ b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/DefinedUnit.java
@@ -132,6 +132,11 @@
 	}

 

 	@Override

+	public Unit shift(Number n) {

+		return shift(n.doubleValue());

+	}

+	

+	@Override

 	public Unit alternate(String arg0) {

 		throw new UnsupportedOperationException();

 	}

@@ -145,7 +150,12 @@
 	public Unit divide(Unit arg0) {

 		throw new UnsupportedOperationException();

 	}

-

+	

+	@Override

+	public Unit divide(Number n) {

+		return divide(n.doubleValue());

+	}

+	

 	@Override

 	public UnitConverter getConverterTo(Unit arg0)

 			throws UnconvertibleException {

@@ -159,10 +169,11 @@
 		// TODO Auto-generated method stub

 		return null;

 	}

-

+	

 	@Override

-	public Dimension getDimension() {

-		return UnitDimension.NONE;

+	public boolean isEquivalentTo(Unit that) {

+		//return this.getConverterTo(that).isIdentity();

+		return false;

 	}

 

 	@Override

@@ -210,5 +221,4 @@
 		// TODO Auto-generated method stub

 		return null;

 	}

-

 }

diff --git a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/UcumUnit.java b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/UcumUnit.java
index bf4f8da..d260e56 100644
--- a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/UcumUnit.java
+++ b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/model/UcumUnit.java
@@ -12,14 +12,16 @@
 

 package org.eclipse.uomo.ucum.model;

 

+import javax.measure.Dimension;

 import javax.measure.Unit;

 

 import tech.units.indriya.function.MultiplyConverter;

+import tech.units.indriya.unit.UnitDimension;

 import tech.uom.lib.common.function.*;

 

 /**

  * @author Werner Keil

- * @version 2.0

+ * @version 2.1

  */

 @SuppressWarnings("rawtypes")

 public abstract class UcumUnit extends Concept implements Unit {

@@ -33,9 +35,24 @@
 	 * kind of thing this base unit represents

 	 */

 	private String property;

+	

+	/**

+	 * kind of thing this base unit represents

+	 */

+	private Dimension dimension;

 

-	protected UcumUnit(ConceptKind kind, String code, String codeUC) {

+	protected UcumUnit(ConceptKind kind, String code, String codeUC, Dimension dim) {

 		super(kind, code, codeUC);

+		this.dimension = dim;

+	}

+	

+	protected UcumUnit(ConceptKind kind, String code, String codeUC) {

+		this(kind, code, codeUC, UnitDimension.NONE);

+	}

+	

+	@Override

+	public Dimension getDimension() {

+		return dimension;

 	}

 

 	/**

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 1f67fa9..c62d60b 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
@@ -1,5 +1,5 @@
 /*******************************************************************************

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

+ * Crown Copyright (c) 2006, 2011, Copyright (c) 2006, 2021 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 org.eclipse.uomo.core.ICode;

 import org.eclipse.uomo.core.IDescription;

 import javax.measure.Quantity;

+import javax.measure.Quantity.Scale;

 import javax.measure.Unit;

 

 public class Value<Q extends Quantity<Q>> implements Quantity<Q>, IDescription, ICode<String> {

@@ -25,20 +26,32 @@
 	private final String unit;

 	private final String unitUC;

 	private final BigDecimal value;

+	private final Scale scale;

 	private Unit<Q> realUnit;

 	@SuppressWarnings("unused")

 	private String text;

-

+	

+	/**

+	 * @param unit

+	 * @param unitUC

+	 * @param value

+	 * @param scale

+	 */

+	public Value(String unit, String unitUC, BigDecimal value, Scale scale) {

+		super();

+		this.unit = unit;

+		this.unitUC = unitUC;

+		this.value = value;

+		this.scale = scale;

+	}

+	

 	/**

 	 * @param unit

 	 * @param unitUC

 	 * @param value

 	 */

 	public Value(String unit, String unitUC, BigDecimal value) {

-		super();

-		this.unit = unit;

-		this.unitUC = unitUC;

-		this.value = value;

+		this(unit, unitUC, value, Scale.ABSOLUTE);

 	}

 

 	/**

@@ -55,6 +68,13 @@
 	public String getCodeUC() {

 		return unitUC;

 	}

+	

+	/**

+	 * @return the scale

+	 */

+	public Scale getScale() {

+		return scale;

+	}

 

 	/**

 	 * @param string the string value to set

@@ -134,6 +154,12 @@
 	}

 

 	@Override

+	public Quantity<Q> negate() {

+		// TODO Auto-generated method stub

+		return null;

+	}

+	

+	@Override

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

 		// TODO Auto-generated method stub

 		return null;

@@ -143,5 +169,11 @@
 	public <T extends Quantity<T>> Quantity<T> asType(Class<T> type) throws ClassCastException {

 		// TODO Auto-generated method stub

 		return null;

-	}		

+	}

+	

+	@Override

+	public boolean isEquivalentTo(Quantity<Q> q) {

+		//return this.getConverterTo(q).isIdentity();

+		return false;

+	}

 }

diff --git a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/CelsiusHandler.java b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/CelsiusHandler.java
index aec3341..cb6544a 100644
--- a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/CelsiusHandler.java
+++ b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/CelsiusHandler.java
@@ -76,4 +76,10 @@
 		// TODO Auto-generated method stub

 		return null;

 	}

+	

+	@Override

+	public boolean isEquivalentTo(Quantity<Temperature> that) {

+		//return this.getConverterTo(that).isIdentity();

+		return false;

+	}

 }

diff --git a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/FahrenheitHandler.java b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/FahrenheitHandler.java
index 96ed1a0..8e554c3 100644
--- a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/FahrenheitHandler.java
+++ b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/FahrenheitHandler.java
@@ -79,4 +79,10 @@
 		// TODO Auto-generated method stub

 		return null;

 	}

+	

+	@Override

+	public boolean isEquivalentTo(Quantity<Temperature> that) {

+		//return this.getConverterTo(that).isIdentity();

+		return false;

+	}

 }

diff --git a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/SpecialUnitHandler.java b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/SpecialUnitHandler.java
index 63f080b..359aad0 100644
--- a/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/SpecialUnitHandler.java
+++ b/bundles/org.eclipse.uomo.ucum/src/main/java/org/eclipse/uomo/ucum/special/SpecialUnitHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************

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

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

@@ -13,6 +13,7 @@
 package org.eclipse.uomo.ucum.special;

 

 import javax.measure.Quantity;

+import javax.measure.Quantity.Scale;

 import javax.measure.Unit;

 import javax.measure.quantity.Temperature;

 

@@ -31,9 +32,7 @@
 	 * TODO use Unit-API here where possible

 	 * @return

 	 */

-	public abstract String getUnits();

-	

-

+	public abstract String getUnits();	

 

 	@Override

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

@@ -52,10 +51,27 @@
 		// TODO Auto-generated method stub

 		return null;

 	}

+	

+	@Override

+	public Quantity<Q> negate() {

+		// TODO Auto-generated method stub

+		return null;

+	}

 

 	@Override

 	public Quantity<?> multiply(Quantity<?> arg0) {

 		// TODO Auto-generated method stub

 		return null;

 	}

+	

+	@Override

+	public boolean isEquivalentTo(Quantity<Q> q) {

+		//return this.getConverterTo(q).isIdentity();

+		return false;

+	}

+	

+	@Override

+	public Scale getScale() {

+		return Scale.ABSOLUTE;

+	}

 }