sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1765513 [1/2] - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/io/wkt/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/ sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/ sis-refer...
Date Tue, 18 Oct 2016 21:22:12 GMT
Author: desruisseaux
Date: Tue Oct 18 21:22:12 2016
New Revision: 1765513

URL: http://svn.apache.org/viewvc?rev=1765513&view=rev
Log:
Remove all dependencies to tec.units (except for parsing - temporarily) and start re-enabling some tests.

Added:
    sis/branches/JDK8/core/sis-utility/src/main/resources/org/apache/sis/measure/
    sis/branches/JDK8/core/sis-utility/src/main/resources/org/apache/sis/measure/UnitNames.properties   (with props)
    sis/branches/JDK8/core/sis-utility/src/main/resources/org/apache/sis/measure/UnitNames_en_US.properties   (with props)
    sis/branches/JDK8/core/sis-utility/src/main/resources/org/apache/sis/measure/UnitNames_fr.properties   (with props)
Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransform.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyTransform.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/SeismicBinGridMock.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/LinearConverter.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitDimension.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitsMap.java
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/MeasureTest.java
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/UnitFormatTest.java
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -1236,7 +1236,7 @@ public class Formatter implements Locali
                 keyword = isSimplified ? WKTKeywords.Unit : WKTKeywords.LengthUnit;
             } else if (base.equals(Units.RADIAN)) {
                 keyword = isSimplified ? WKTKeywords.Unit : WKTKeywords.AngleUnit;
-            } else if (base.equals(Units.ONE)) {
+            } else if (base.equals(Units.UNITY)) {
                 keyword = isSimplified ? WKTKeywords.Unit : WKTKeywords.ScaleUnit;
             } else if (base.equals(Units.SECOND)) {
                 keyword = WKTKeywords.TimeUnit;  // "Unit" alone is not allowed for time units according ISO 19162.

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -2227,7 +2227,7 @@ class GeodeticObjectParser extends MathT
                 buffer.append(number);
                 axes[i] = csFactory.createCoordinateSystemAxis(
                         singletonMap(CoordinateSystemAxis.NAME_KEY, buffer.toString()),
-                        number, AxisDirection.OTHER, Units.ONE);
+                        number, AxisDirection.OTHER, Units.UNITY);
             }
             final Map<String,Object> properties = parseMetadataAndClose(element, name, baseCRS);
             final CoordinateSystem derivedCS = referencing.createAbstractCS(

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -82,7 +82,7 @@ class MathTransformParser extends Abstra
      * For each {@code UNIT_KEYWORDS[i]} element, the associated base unit is {@code BASE_UNIT[i]}.
      */
     private static final Unit<?>[] BASE_UNITS = {
-        Units.METRE, Units.RADIAN, Units.ONE, Units.SECOND
+        Units.METRE, Units.RADIAN, Units.UNITY, Units.SECOND
     };
 
     /**

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -241,6 +241,8 @@ public class DefaultBand extends Default
      * @return Units in which sensor wavelengths are expressed.
      *
      * @since 0.5
+     *
+     * @see org.apache.sis.measure.Units#NANOMETRE
      */
     @Override
 /// @XmlElement(name = "boundUnits")

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -49,7 +49,7 @@ public final class SecondDefiningParamet
     /**
      * The measure, which is either the polar radius or the inverse of the flattening value.
      * We distinguish those two cases by the unit: if the measure is the inverse flattening,
-     * then the unit must be {@link Unit#ONE}.
+     * then the unit must be {@link Units#UNITY}.
      *
      * @see Ellipsoid#getSemiMinorAxis()
      * @see Ellipsoid#getInverseFlattening()
@@ -73,7 +73,7 @@ public final class SecondDefiningParamet
             secondDefiningParameter = new SecondDefiningParameter(ellipsoid, false);
         } else {
             if (ellipsoid.isIvfDefinitive()) {
-                measure = new Measure(ellipsoid.getInverseFlattening(), Units.ONE);
+                measure = new Measure(ellipsoid.getInverseFlattening(), Units.UNITY);
             } else {
                 measure = new Measure(ellipsoid.getSemiMinorAxis(), ellipsoid.getAxisUnit());
             }
@@ -86,7 +86,7 @@ public final class SecondDefiningParamet
      * @return {@code true} if the measure is the inverse of the flattening value.
      */
     public boolean isIvfDefinitive() {
-        return (measure != null) && Units.ONE.equals(measure.unit);
+        return (measure != null) && Units.UNITY.equals(measure.unit);
     }
 
     /**
@@ -131,7 +131,7 @@ public final class SecondDefiningParamet
      * @param measure The inverse flattening value.
      */
     public void setInverseFlattening(final Measure measure) {
-        if (measure.setUnit(Units.ONE)) {
+        if (measure.setUnit(Units.UNITY)) {
             Context.warningOccured(Context.current(), SecondDefiningParameter.class, "setInverseFlattening",
                     Errors.class, Errors.Keys.IncompatiblePropertyValue_1, "uom");
         }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -269,7 +269,7 @@ public class GeodeticObjectBuilder exten
      *           .setConversionMethod("Lambert Conic Conformal (1SP)")
      *           .setConversionName("Lambert zone II")
      *           .setParameter("Latitude of natural origin",             52, Units.GRAD)
-     *           .setParameter("Scale factor at natural origin", 0.99987742, Units.ONE)
+     *           .setParameter("Scale factor at natural origin", 0.99987742, Units.UNITY)
      *           .setParameter("False easting",                      600000, Units.METRE)
      *           .setParameter("False northing",                    2200000, Units.METRE)
      *           .addName("NTF (Paris) / Lambert zone II")

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -174,7 +174,7 @@ public abstract class AbstractProvider e
      * Creates a descriptor for a scale parameter with a default value of 1.
      */
     static ParameterDescriptor<Double> createScale(final ParameterBuilder builder) {
-        return builder.createStrictlyPositive(1.0, Units.ONE);
+        return builder.createStrictlyPositive(1.0, Units.UNITY);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -58,7 +58,7 @@ public final class LambertConformalMichi
         SCALE_FACTOR = builder
                 .addIdentifier("1051")
                 .addName("Ellipsoid scaling factor")
-                .createStrictlyPositive(Double.NaN, Units.ONE);
+                .createStrictlyPositive(Double.NaN, Units.UNITY);
 
         PARAMETERS = builder
                 .addIdentifier(IDENTIFIER)

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -82,7 +82,7 @@ public final class Molodensky extends Ge
      * The operation parameter descriptor for the <cite>Flattening difference</cite> optional
      * parameter value. This parameter is defined by the EPSG database and can be used in
      * replacement of {@link #TGT_SEMI_MINOR}.
-     * Valid values range from -1 to +1, {@linkplain Unit#ONE dimensionless}.
+     * Valid values range from -1 to +1, {@linkplain Units#UNITY dimensionless}.
      */
     public static final ParameterDescriptor<Double> FLATTENING_DIFFERENCE;
 
@@ -93,7 +93,7 @@ public final class Molodensky extends Ge
     static {
         final ParameterBuilder builder = builder();
         AXIS_LENGTH_DIFFERENCE = builder.addIdentifier("8654").addName("Semi-major axis length difference").create(Double.NaN, Units.METRE);
-        FLATTENING_DIFFERENCE  = builder.addIdentifier("8655").addName("Flattening difference").createBounded(-1, +1, Double.NaN, Units.ONE);
+        FLATTENING_DIFFERENCE  = builder.addIdentifier("8655").addName("Flattening difference").createBounded(-1, +1, Double.NaN, Units.UNITY);
         PARAMETERS = builder.setRequired(true)
                 .addIdentifier("9604")
                 .addName("Molodensky")

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -176,7 +176,7 @@ public final class TransverseMercator ex
         }
         group.parameter(Constants.LATITUDE_OF_ORIGIN).setValue(latitude,  Units.DEGREE);
         group.parameter(Constants.CENTRAL_MERIDIAN)  .setValue(longitude, Units.DEGREE);
-        group.parameter(Constants.SCALE_FACTOR)      .setValue(0.9996, Units.ONE);
+        group.parameter(Constants.SCALE_FACTOR)      .setValue(0.9996, Units.UNITY);
         group.parameter(Constants.FALSE_EASTING)     .setValue(500000, Units.METRE);
         group.parameter(Constants.FALSE_NORTHING)    .setValue(isSouth ? 10000000 : 0, Units.METRE);
         return name;

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -69,7 +69,7 @@ import static org.apache.sis.util.Utilit
  *             ParameterDescriptor<?>[] parameters = {
  *                 builder.addName("Latitude of natural origin")    .createBounded( -80,  +84, 0, Units.DEGREE),
  *                 builder.addName("Longitude of natural origin")   .createBounded(-180, +180, 0, Units.DEGREE),
- *                 builder.addName("Scale factor at natural origin").createStrictlyPositive(1, Units.ONE),
+ *                 builder.addName("Scale factor at natural origin").createStrictlyPositive(1, Units.UNITY),
  *                 builder.addName("False easting")                 .create(0, Units.METRE),
  *                 builder.addName("False northing")                .create(0, Units.METRE)
  *             };

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -254,7 +254,7 @@ final class MapProjectionParameters exte
          */
         static final ParameterDescriptor<Double> DESCRIPTOR = new DefaultParameterDescriptor<>(
                 toMap(Constants.INVERSE_FLATTENING), 0, 1, Double.class,
-                MeasurementRange.createGreaterThan(0.0, Units.ONE), null, null);
+                MeasurementRange.createGreaterThan(0.0, Units.UNITY), null, null);
 
         /**
          * Helper method for {@link #DESCRIPTOR} constructions.

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -82,7 +82,7 @@ import static org.apache.sis.util.Argume
  *              .createBounded(-180, +180, 0, Units.DEGREE),  // Projection is valid on all the longitude range (±180°).
  *
  *       builder.addName("Scale factor at natural origin")
- *              .createStrictlyPositive(1, Units.ONE),
+ *              .createStrictlyPositive(1, Units.UNITY),
  *
  *       builder.addName("False easting")
  *              .create(0, Units.METRE),

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -190,7 +190,7 @@ public class DefaultAffineCS extends Abs
         if (!AxisDirections.isSpatialOrUserDefined(direction, true)) {
             return INVALID_DIRECTION;
         }
-        if (!Units.isLinear(unit) && !Units.ONE.equals(unit)) {
+        if (!Units.isLinear(unit) && !Units.UNITY.equals(unit)) {
             return INVALID_UNIT;
         }
         return VALID;

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -157,7 +157,7 @@ public class DefaultLinearCS extends Abs
         if (!AxisDirections.isSpatialOrUserDefined(direction, false)) {
             return INVALID_DIRECTION;
         }
-        if (!Units.isLinear(unit) && !Units.ONE.equals(unit)) {
+        if (!Units.isLinear(unit) && !Units.UNITY.equals(unit)) {
             return INVALID_UNIT;
         }
         return VALID;

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -172,7 +172,7 @@ public class DefaultVerticalCS extends A
         if (unit.equals(Units.METRE)   ||   // Most usual case.
             unit.equals(Units.PASCAL)  ||   // Height or depth estimated by the atmospheric or ocean pressure.
             unit.equals(Units.SECOND)  ||   // Depth estimated by the time needed for an echo to travel.
-            unit.equals(Units.ONE))         // Sigma-level (percentage from sea surface to ocean floor).
+            unit.equals(Units.UNITY))         // Sigma-level (percentage from sea surface to ocean floor).
         {
             return VALID;
         }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransform.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransform.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransform.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -220,7 +220,7 @@ public class InterpolatedMolodenskyTrans
         if (pg != context) {
             Δf = Δfmod / semiMinor;
             pg.getOrCreate(Molodensky.AXIS_LENGTH_DIFFERENCE).setValue(Δa, unit);
-            pg.getOrCreate(Molodensky.FLATTENING_DIFFERENCE) .setValue(Δf, Units.ONE);
+            pg.getOrCreate(Molodensky.FLATTENING_DIFFERENCE) .setValue(Δf, Units.UNITY);
         }
         if (grid instanceof DatumShiftGridFile<?,?>) {
             ((DatumShiftGridFile<?,?>) grid).setFileParameters(pg);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyTransform.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyTransform.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyTransform.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -189,7 +189,7 @@ public class MolodenskyTransform extends
         pg.getOrCreate(Molodensky.TY)                    .setValue(tY, unit);
         pg.getOrCreate(Molodensky.TZ)                    .setValue(tZ, unit);
         pg.getOrCreate(Molodensky.AXIS_LENGTH_DIFFERENCE).setValue(Δa, unit);
-        pg.getOrCreate(Molodensky.FLATTENING_DIFFERENCE) .setValue(Δf, Units.ONE);
+        pg.getOrCreate(Molodensky.FLATTENING_DIFFERENCE) .setValue(Δf, Units.UNITY);
         if (pg != context) {
             pg.parameter("abridged").setValue(isAbridged);  // Only in internal parameters.
         }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -398,10 +398,10 @@ public final strictfp class AxisDirectio
         assertEquals("Z",   AxisDirections.suggestAbbreviation("not needed",             GEOCENTRIC_Z,     Units.METRE));
         assertEquals("D",   AxisDirections.suggestAbbreviation("not needed",             DOWN,             Units.METRE));
         assertEquals("t",   AxisDirections.suggestAbbreviation("not needed",             FUTURE,           Units.DAY));
-        assertEquals("i",   AxisDirections.suggestAbbreviation("not needed",             COLUMN_NEGATIVE,  Units.ONE));
-        assertEquals("j",   AxisDirections.suggestAbbreviation("not needed",             ROW_NEGATIVE,     Units.ONE));
-        assertEquals("x",   AxisDirections.suggestAbbreviation("not needed",             DISPLAY_RIGHT,    Units.ONE));
-        assertEquals("y",   AxisDirections.suggestAbbreviation("not needed",             DISPLAY_DOWN,     Units.ONE));
+        assertEquals("i",   AxisDirections.suggestAbbreviation("not needed",             COLUMN_NEGATIVE,  Units.UNITY));
+        assertEquals("j",   AxisDirections.suggestAbbreviation("not needed",             ROW_NEGATIVE,     Units.UNITY));
+        assertEquals("x",   AxisDirections.suggestAbbreviation("not needed",             DISPLAY_RIGHT,    Units.UNITY));
+        assertEquals("y",   AxisDirections.suggestAbbreviation("not needed",             DISPLAY_DOWN,     Units.UNITY));
         assertEquals("N",   AxisDirections.suggestAbbreviation("not needed",             NORTH,            Units.METRE));
         assertEquals("S",   AxisDirections.suggestAbbreviation("not needed",             SOUTH,            Units.METRE));
         assertEquals("E",   AxisDirections.suggestAbbreviation("not needed",             EAST,             Units.METRE));

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/SeismicBinGridMock.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/SeismicBinGridMock.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/SeismicBinGridMock.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/SeismicBinGridMock.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -44,16 +44,16 @@ public final strictfp class SeismicBinGr
     static {
         final ParameterBuilder builder = builder();
         final ParameterDescriptor<?>[] parameters = {
-            builder.addIdentifier("8733").addName("Bin grid origin I")                  .create(Double.NaN, Units.ONE),
-            builder.addIdentifier("8734").addName("Bin grid origin J")                  .create(Double.NaN, Units.ONE),
+            builder.addIdentifier("8733").addName("Bin grid origin I")                  .create(Double.NaN, Units.UNITY),
+            builder.addIdentifier("8734").addName("Bin grid origin J")                  .create(Double.NaN, Units.UNITY),
             builder.addIdentifier("8735").addName("Bin grid origin Easting")            .create(Double.NaN, Units.METRE),
             builder.addIdentifier("8736").addName("Bin grid origin Northing")           .create(Double.NaN, Units.METRE),
-            builder.addIdentifier("8737").addName("Scale factor of bin grid")           .create(Double.NaN, Units.ONE),
+            builder.addIdentifier("8737").addName("Scale factor of bin grid")           .create(Double.NaN, Units.UNITY),
             builder.addIdentifier("8738").addName("Bin width on I-axis")                .create(Double.NaN, Units.METRE),
             builder.addIdentifier("8739").addName("Bin width on J-axis")                .create(Double.NaN, Units.METRE),
             builder.addIdentifier("8740").addName("Map grid bearing of bin grid J-axis").create(Double.NaN, Units.DEGREE),
-            builder.addIdentifier("8741").addName("Bin node increment on I-axis")       .create(Double.NaN, Units.ONE),
-            builder.addIdentifier("8742").addName("Bin node increment on J-axis")       .create(Double.NaN, Units.ONE)
+            builder.addIdentifier("8741").addName("Bin node increment on I-axis")       .create(Double.NaN, Units.UNITY),
+            builder.addIdentifier("8742").addName("Bin node increment on J-axis")       .create(Double.NaN, Units.UNITY)
         };
         PARAMETERS = builder
                 .addIdentifier("1049")

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -568,7 +568,7 @@ public final strictfp class GeodeticObje
         assertEquals("semi_major",   6378137.0, param.parameter("semi_major"      ).doubleValue(Units.METRE),  STRICT);
         assertEquals("semi_minor",   6356752.3, param.parameter("semi_minor"      ).doubleValue(Units.METRE),  0.1);
         assertEquals("central_meridian", -20.0, param.parameter("central_meridian").doubleValue(Units.DEGREE), STRICT);
-        assertEquals("scale_factor",       1.0, param.parameter("scale_factor"    ).doubleValue(Units.ONE),    STRICT);
+        assertEquals("scale_factor",       1.0, param.parameter("scale_factor"    ).doubleValue(Units.UNITY),    STRICT);
         assertEquals("false_easting", 500000.0, param.parameter("false_easting"   ).doubleValue(Units.METRE),  STRICT);
         assertEquals("false_northing",     0.0, param.parameter("false_northing"  ).doubleValue(Units.METRE),  STRICT);
     }
@@ -654,7 +654,7 @@ public final strictfp class GeodeticObje
         assertNameAndIdentifierEqual("TransverseMercator", 0, crs);
         assertNameAndIdentifierEqual("Sphere", 0, crs.getBaseCRS());
         assertNameAndIdentifierEqual("Sphere", 0, crs.getDatum());
-        verifyProjectedCS(crs.getCoordinateSystem(), Units.FOOT_SURVEY_US);
+        verifyProjectedCS(crs.getCoordinateSystem(), Units.US_SURVEY_FOOT);
 
         final ParameterValueGroup param = crs.getConversionFromBase().getParameterValues();
         assertEquals("Transverse Mercator", crs.getConversionFromBase().getMethod().getName().getCode());
@@ -803,7 +803,7 @@ public final strictfp class GeodeticObje
         assertEquals("semi_major",     6378249.2, param.parameter("semi_major"      ).doubleValue(Units.METRE),  STRICT);
         assertEquals("semi_minor",     6356515.0, param.parameter("semi_minor"      ).doubleValue(Units.METRE),  1E-12);
         assertEquals("central_meridian",     0.0, param.parameter("central_meridian").doubleValue(Units.DEGREE), STRICT);
-        assertEquals("scale_factor",  0.99987742, param.parameter("scale_factor"    ).doubleValue(Units.ONE),    STRICT);
+        assertEquals("scale_factor",  0.99987742, param.parameter("scale_factor"    ).doubleValue(Units.UNITY),    STRICT);
         assertEquals("false_easting",   600000.0, param.parameter("false_easting"   ).doubleValue(Units.METRE),  STRICT);
         assertEquals("false_northing", 2200000.0, param.parameter("false_northing"  ).doubleValue(Units.METRE),  STRICT);
         return param.parameter("latitude_of_origin");
@@ -868,7 +868,7 @@ public final strictfp class GeodeticObje
         assertEquals("semi_minor",        6356515.0, param.parameter("semi_minor"        ).doubleValue(Units.METRE),  1E-12);
         assertEquals("latitude_of_origin",     44.1, param.parameter("latitude_of_origin").doubleValue(Units.DEGREE), STRICT);
         assertEquals("central_meridian", 2.33722917, param.parameter("central_meridian"  ).doubleValue(Units.DEGREE), STRICT);
-        assertEquals("scale_factor",    0.999877499, param.parameter("scale_factor"      ).doubleValue(Units.ONE),    STRICT);
+        assertEquals("scale_factor",    0.999877499, param.parameter("scale_factor"      ).doubleValue(Units.UNITY),    STRICT);
         assertEquals("false_easting",      600000.0, param.parameter("false_easting"     ).doubleValue(Units.METRE),  STRICT);
         assertEquals("false_northing",     200000.0, param.parameter("false_northing"    ).doubleValue(Units.METRE),  STRICT);
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -531,7 +531,7 @@ public final strictfp class DefaultParam
             assertEquals ("Expected integer value", i,    p.intValue());
             assertEquals ("Expected integer value", i,    p.doubleValue(), STRICT);
 
-            p = create("Dimensionless double value", i, Units.ONE);
+            p = create("Dimensionless double value", i, Units.UNITY);
             d = p.getDescriptor();
             validate(p);
 
@@ -542,7 +542,7 @@ public final strictfp class DefaultParam
             assertNull   ("Expected no enumeration.",     d.getValidValues());
             assertEquals ("Expected double type.",        Double.class, d.getValueClass());
             assertTrue   ("Expected double type.",        p.getValue() instanceof Double);
-            assertEquals ("Expected dimensionless.",      Units.ONE, p.getUnit());
+            assertEquals ("Expected dimensionless.",      Units.UNITY, p.getUnit());
             assertEquals ("Expected integer value", i,    p.intValue());
             assertEquals ("Expected integer value", i,    p.doubleValue(), STRICT);
 

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -85,7 +85,7 @@ public final strictfp class ParameterBui
                    .addName(Citations.GEOTIFF, "NatOriginLong")
                    .setRemarks("Some remarks.")               .createBounded(-180, +180, 0, Units.DEGREE),
             builder.addName("Latitude of natural origin")     .createBounded( -80,  +84, 0, Units.DEGREE),
-            builder.addName("Scale factor at natural origin") .createStrictlyPositive(1, Units.ONE),
+            builder.addName("Scale factor at natural origin") .createStrictlyPositive(1, Units.UNITY),
             builder.addName("False easting")                  .create(0, Units.METRE),
             builder.addName("False northing")                 .create(0, Units.METRE)
         };

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -79,7 +79,7 @@ public final strictfp class ParameterFor
                     .setRemarks("This parameter is shown for completeness, but should never have a value different than 0 for this projection.")
                     .createBounded( -80,  +84,  40, Units.DEGREE),
             builder.addIdentifier("8802").addName("Longitude of natural origin")     .addName(OGC, "central_meridian")  .createBounded(-180, +180, -60, Units.DEGREE),
-            builder.addIdentifier("8805").addName("Scale factor at natural origin")  .addName(OGC, "scale_factor")      .createStrictlyPositive(1, Units.ONE),
+            builder.addIdentifier("8805").addName("Scale factor at natural origin")  .addName(OGC, "scale_factor")      .createStrictlyPositive(1, Units.UNITY),
             builder.addIdentifier("8806").addName("False easting").setRequired(false).addName(OGC, "false_easting")     .create( 5000, Units.METRE),
             builder.addIdentifier("8807").addName("False northing")                  .addName(OGC, "false_northing")    .create(10000, Units.METRE)
         };

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -407,7 +407,7 @@ public final strictfp class ParameterMar
         final Iterator<GeneralParameterDescriptor> itd = group.getDescriptor().descriptors().iterator();
         verifyParameter(8801, "Latitude of natural origin",     "latitude_of_origin", 40, Units.DEGREE, itd.next(), it.next());
         verifyParameter(8802, "Longitude of natural origin",    "central_meridian",  -60, Units.DEGREE, itd.next(), it.next());
-        verifyParameter(8805, "Scale factor at natural origin", "scale_factor",        1, Units.ONE,    itd.next(), it.next());
+        verifyParameter(8805, "Scale factor at natural origin", "scale_factor",        1, Units.UNITY,    itd.next(), it.next());
         assertFalse("Unexpected parameter.", it.hasNext());
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -117,7 +117,7 @@ public final strictfp class DefaultProje
                 .setConversionMethod("Lambert Conic Conformal (1SP)")
                 .setConversionName("Lambert zone II")
                 .setParameter("Latitude of natural origin",             52, Units.GRAD)
-                .setParameter("Scale factor at natural origin", 0.99987742, Units.ONE)
+                .setParameter("Scale factor at natural origin", 0.99987742, Units.UNITY)
                 .setParameter("False easting",                      600000, Units.METRE)
                 .setParameter("False northing",                    2200000, Units.METRE)
                 .setCodeSpace(Citations.EPSG, Constants.EPSG)

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -433,7 +433,7 @@ public final strictfp class HardCodedAxe
      * The abbreviation is lower case <cite>"i"</cite>.
      */
     public static final DefaultCoordinateSystemAxis COLUMN = create("Column", "i",
-            AxisDirection.COLUMN_POSITIVE, Units.ONE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+            AxisDirection.COLUMN_POSITIVE, Units.UNITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
 
     /**
      * Axis for row indices in a {@linkplain org.opengis.coverage.grid.GridCoverage grid coverage}.
@@ -441,7 +441,7 @@ public final strictfp class HardCodedAxe
      * The abbreviation is lower case <cite>"j"</cite>.
      */
     public static final DefaultCoordinateSystemAxis ROW = create("Row", "j",
-            AxisDirection.ROW_POSITIVE, Units.ONE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+            AxisDirection.ROW_POSITIVE, Units.UNITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
 
     /**
      * Axis for <var>x</var> values in a display device.
@@ -449,7 +449,7 @@ public final strictfp class HardCodedAxe
      * The abbreviation is lower case <cite>"x"</cite>.
      */
     public static final DefaultCoordinateSystemAxis DISPLAY_X = create("x", "x",
-            AxisDirection.DISPLAY_RIGHT, Units.ONE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+            AxisDirection.DISPLAY_RIGHT, Units.UNITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
 
     /**
      * Axis for <var>y</var> values in a display device.
@@ -457,7 +457,7 @@ public final strictfp class HardCodedAxe
      * The abbreviation is lower case <cite>"y"</cite>.
      */
     public static final DefaultCoordinateSystemAxis DISPLAY_Y = create("y", "y",
-            AxisDirection.DISPLAY_DOWN, Units.ONE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+            AxisDirection.DISPLAY_DOWN, Units.UNITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
 
     /**
      * Undefined or unknown axis. Axis direction is {@link AxisDirection#OTHER OTHER}
@@ -465,7 +465,7 @@ public final strictfp class HardCodedAxe
      * for axes that were not properly defined.
      */
     public static final DefaultCoordinateSystemAxis UNDEFINED = create("Undefined", "z",
-            AxisDirection.OTHER, Units.ONE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+            AxisDirection.OTHER, Units.UNITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
 
     /**
      * Creates a new axis of the given name, abbreviation, direction and unit.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -149,7 +149,7 @@ public final class Measure {
                 return DefinitionURI.PREFIX + ":uom:" + Constants.EPSG + "::" + code;
             }
         }
-        if (unit == null || unit.equals(Units.ONE)) {
+        if (unit == null || unit.equals(Units.UNITY)) {
             return "";
         }
         return Context.schema(Context.current(), "gmd", Schemas.METADATA_ROOT).append(Schemas.UOM_PATH)
@@ -187,7 +187,7 @@ public final class Measure {
      *
      * <div class="note"><b>Example:</b>
      * Some users wrongly assign the "m" unit to {@code Ellipsoid.inverseFlattening}.
-     * The SIS adapter forces the unit to {@link Unit#ONE}, but we want to let the user
+     * The SIS adapter forces the unit to {@link Units#UNITY}, but we want to let the user
      * know that he probably did something wrong.</div>
      *
      * @param  newUnit The new unit (can not be null).

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -18,6 +18,8 @@ package org.apache.sis.measure;
 
 import java.util.Map;
 import java.util.Objects;
+import java.util.ResourceBundle;
+import java.util.MissingResourceException;
 import java.io.Serializable;
 import javax.measure.Unit;
 import javax.measure.Quantity;
@@ -66,19 +68,14 @@ abstract class AbstractUnit<Q extends Qu
      * <p>Users can override this symbol by call to {@link UnitFormat#label(Unit, String)},
      * but such overriding applies only to the target {@code UnitFormat} instance.</p>
      *
+     * <p>The value given assigned to this field is also used by {@link #getName()}
+     * for fetching a localized name from the resource bundle.</p>
+     *
      * @see #getSymbol()
      */
     private final String symbol;
 
     /**
-     * The unit name, or {@code null} if this unit has no specific name. If this unit exists
-     * in the EPSG database, then the value should be the name as specified in the database.
-     *
-     * @see #getName()
-     */
-    private final String name;
-
-    /**
      * The EPSG code, or 0 if this unit has no EPSG code.
      */
     final short epsg;
@@ -86,12 +83,10 @@ abstract class AbstractUnit<Q extends Qu
     /**
      * Creates a new unit having the given symbol and EPSG code.
      *
-     * @param  name    the unit name,   or {@code null} if this unit has no specific name.
      * @param  symbol  the unit symbol, or {@code null} if this unit has no specific symbol.
      * @param  epsg    the EPSG code,   or 0 if this unit has no EPSG code.
      */
-    AbstractUnit(final String name, final String symbol, final short epsg) {
-        this.name   = name;
+    AbstractUnit(final String symbol, final short epsg) {
         this.symbol = symbol;
         this.epsg   = epsg;
     }
@@ -123,7 +118,11 @@ abstract class AbstractUnit<Q extends Qu
      */
     @Override
     public final String getName() {
-        return name;
+        try {
+            return ResourceBundle.getBundle(UnitFormat.RESOURCES).getString(symbol);
+        } catch (MissingResourceException e) {
+            return null;
+        }
     }
 
     /**
@@ -224,7 +223,7 @@ abstract class AbstractUnit<Q extends Qu
     public boolean equals(final Object other) {
         if (other != null && other.getClass() == getClass()) {
             final AbstractUnit<?> that = (AbstractUnit<?>) other;
-            return epsg == that.epsg && Objects.equals(symbol, that.symbol) && Objects.equals(name, that.name);
+            return epsg == that.epsg && Objects.equals(symbol, that.symbol);
         }
         return false;
     }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -58,14 +58,11 @@ final class ConventionalUnit<Q extends Q
      *
      * @param  target     the base or derived units to which this {@code ConventionalUnit} is related.
      * @param  toTarget   the conversion from this unit to the {@code target} unit.
-     * @param  name       the unit name,   or {@code null} if this unit has no specific name.
      * @param  symbol     the unit symbol, or {@code null} if this unit has no specific symbol.
      * @param  epsg       the EPSG code,   or 0 if this unit has no EPSG code.
      */
-    ConventionalUnit(final SystemUnit<Q> target, final UnitConverter toTarget,
-            final String name, final String symbol, final short epsg)
-    {
-        super(name, symbol, epsg);
+    ConventionalUnit(final SystemUnit<Q> target, final UnitConverter toTarget, final String symbol, final short epsg) {
+        super(symbol, epsg);
         this.target   = target;
         this.toTarget = toTarget;
     }
@@ -78,7 +75,7 @@ final class ConventionalUnit<Q extends Q
             return target;
         }
         // TODO: check for existing unit.
-        return new ConventionalUnit<>(target, toTarget, null, null, (short) 0);
+        return new ConventionalUnit<>(target, toTarget, null, (short) 0);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/LinearConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/LinearConverter.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/LinearConverter.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/LinearConverter.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -92,6 +92,16 @@ final class LinearConverter implements U
     }
 
     /**
+     * Returns a linear converter for the given ratio. The scale factor is specified as a ratio because
+     * the unit conversion factors are defined with a value which is exact in base 10.
+     *
+     * @todo modify the {@code LinearConverter} implementation for storing the ratio.
+     */
+    static LinearConverter scale(final double numerator, final double denominator) {
+        return new LinearConverter(numerator / denominator, 0);
+    }
+
+    /**
      * Raises the given converter to the given power. This method assumes that the given converter
      * {@linkplain #isLinear() is linear} (this is not verified) and take only the scale factor;
      * the offset (if any) is ignored.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -55,7 +55,7 @@ final class SystemUnit<Q extends Quantit
     /**
      * The type of quantity that uses this unit, or {@code null} if unknown.
      */
-    final Class<Quantity<Q>> quantity;
+    final Class<Q> quantity;
 
     /**
      * The dimension of this unit of measurement. Can not be null.
@@ -67,14 +67,11 @@ final class SystemUnit<Q extends Quantit
      *
      * @param  quantity   the type of quantity that uses this unit, or {@code null} if unknown.
      * @param  dimension  the unit dimension.
-     * @param  name       the unit name,   or {@code null} if this unit has no specific name.
      * @param  symbol     the unit symbol, or {@code null} if this unit has no specific symbol.
      * @param  epsg       the EPSG code,   or 0 if this unit has no EPSG code.
      */
-    SystemUnit(final Class<Quantity<Q>> quantity, final UnitDimension dimension,
-            final String name, final String symbol, final short epsg)
-    {
-        super(name, symbol, epsg);
+    SystemUnit(final Class<Q> quantity, final UnitDimension dimension, final String symbol, final short epsg) {
+        super(symbol, epsg);
         this.quantity  = quantity;
         this.dimension = dimension;
     }
@@ -88,7 +85,7 @@ final class SystemUnit<Q extends Quantit
         }
         SystemUnit<?> result = Units.get(dim);
         if (result == null) {
-            result = new SystemUnit<>(null, dim, null, null, (short) 0);
+            result = new SystemUnit<>(null, dim, null, (short) 0);
         }
         return result;
     }
@@ -326,7 +323,7 @@ final class SystemUnit<Q extends Quantit
             return this;
         }
         // TODO: check for existing units.
-        return new SystemUnit<>(quantity, dimension, null, symbol, (short) 0);
+        return new SystemUnit<>(quantity, dimension, symbol, (short) 0);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitDimension.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitDimension.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitDimension.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitDimension.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -21,7 +21,6 @@ import java.util.Map;
 import java.util.LinkedHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.BiFunction;
 import java.io.Serializable;
 import java.io.IOException;
 import java.io.ObjectStreamException;
@@ -79,7 +78,10 @@ final class UnitDimension implements Dim
     /**
      * Pseudo-dimension for dimensionless units.
      */
-    private static final UnitDimension NONE = new UnitDimension(Collections.emptyMap());
+    static final UnitDimension NONE = new UnitDimension(Collections.emptyMap());
+    static {
+        POOL.put(NONE.components, NONE);
+    }
 
     /**
      * The product of base dimensions that make this dimension. All keys in this map shall be base dimensions
@@ -216,10 +218,7 @@ final class UnitDimension implements Dim
      */
     @Override
     public UnitDimension multiply(final Dimension multiplicand) {
-        return combine(multiplicand, (sum, toAdd) -> {
-            sum = sum.add(toAdd);
-            return (sum.numerator != 0) ? sum : null;
-        });
+        return combine(multiplicand, false);
     }
 
     /**
@@ -230,10 +229,7 @@ final class UnitDimension implements Dim
      */
     @Override
     public UnitDimension divide(final Dimension divisor) {
-        return combine(divisor, (sum, toRemove) -> {
-            sum = sum.subtract(toRemove);
-            return (sum.numerator != 0) ? sum : null;
-        });
+        return combine(divisor, true);
     }
 
     /**
@@ -243,13 +239,19 @@ final class UnitDimension implements Dim
      * @param  mapping the operation to apply between the powers of {@code this} and {@code other} dimensions.
      * @return the product of this dimension by the given dimension raised to the given power.
      */
-    private UnitDimension combine(final Dimension other, final BiFunction<Fraction, Fraction, Fraction> mapping) {
+    private UnitDimension combine(final Dimension other, final boolean divide) {
         final Map<UnitDimension,Fraction> product = new LinkedHashMap<>(components);
         for (final Map.Entry<? extends Dimension, Fraction> entry : getBaseDimensions(other).entrySet()) {
             final Dimension dim = entry.getKey();
-            final Fraction p = entry.getValue();
+            Fraction p = entry.getValue();
+            if (divide) {
+                p = p.negate();
+            }
             if (dim instanceof UnitDimension) {
-                product.merge((UnitDimension) dim, p, mapping);
+                product.merge((UnitDimension) dim, p, (sum, toAdd) -> {
+                    sum = sum.add(toAdd);
+                    return (sum.numerator != 0) ? sum : null;
+                });
             } else if (p.numerator != 0) {
                 throw new UnsupportedImplementationException(Errors.format(Errors.Keys.UnsupportedImplementation_1, dim.getClass()));
             }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java?rev=1765513&r1=1765512&r2=1765513&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java [UTF-8] Tue Oct 18 21:22:12 2016
@@ -72,6 +72,11 @@ public class UnitFormat extends Format i
     private static final long serialVersionUID = -3064428584419360693L;
 
     /**
+     * The resource bundles for {@linkplain AbstractUnit#getName() unit names}.
+     */
+    static final String RESOURCES = "org.apache.sis.measure.UnitNames";
+
+    /**
      * The suffixes that NetCDF files sometime put after the "degrees" unit.
      * Suffix at even index are for axes having the standard geometric direction,
      * while suffix at odd index are for axes having the reverse direction.
@@ -185,13 +190,13 @@ public class UnitFormat extends Format i
              * If we invoke this method for other purposes, then we would need to provide more control on
              * what kind of formatting is desired.
              */
-            if (Units.ONE.equals(unit)) {
+            if (Units.UNITY.equals(unit)) {
                 return toAppendTo.append("unity");
             } else if (Units.DEGREE.equals(unit)) {
                 return toAppendTo.append("degree");
             } else if (Units.METRE.equals(unit)) {
                 return toAppendTo.append(isLocaleUS ? "meter" : "metre");
-            } else if (Units.FOOT_SURVEY_US.equals(unit)) {
+            } else if (Units.US_SURVEY_FOOT.equals(unit)) {
                 return toAppendTo.append("US survey foot");
             } else if (Units.PPM.equals(unit)) {
                 return toAppendTo.append("parts per million");
@@ -426,8 +431,8 @@ public class UnitFormat extends Format i
             if (equalsIgnorePlural(uom, "grade"))       return Units.GRAD;
             if (equalsIgnorePlural(uom, "grad"))        return Units.GRAD;
             if (isCelsius(uom))                         return Units.CELSIUS;
-            if (uom.isEmpty())                          return Units.ONE;
-            if (uom.equalsIgnoreCase("US survey foot")) return Units.FOOT_SURVEY_US;
+            if (uom.isEmpty())                          return Units.UNITY;
+            if (uom.equalsIgnoreCase("US survey foot")) return Units.US_SURVEY_FOOT;
             if (uom.equalsIgnoreCase("ppm"))            return Units.PPM;
             if (uom.equalsIgnoreCase("psu"))            return Units.PSU;
             if (uom.equalsIgnoreCase("sigma"))          return Units.SIGMA;



Mime
View raw message