sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1767577 [6/15] - in /sis/trunk: ./ application/ application/sis-console/src/main/java/org/apache/sis/console/ application/sis-openoffice/ application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ core/ core/sis-feature/src/main/j...
Date Tue, 01 Nov 2016 21:03:08 GMT
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticObjectFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticObjectFactory.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticObjectFactory.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticObjectFactory.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -28,7 +28,7 @@ import java.util.concurrent.atomic.Atomi
 import java.lang.reflect.Constructor;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.measure.quantity.Angle;
 import javax.measure.quantity.Length;
 import javax.xml.bind.JAXBException;
@@ -192,7 +192,7 @@ import org.apache.sis.xml.XML;
  * @author  Guilhem Legal (Geomatys)
  * @author  Johann Sorel (Geomatys)
  * @since   0.6
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public class GeodeticObjectFactory extends AbstractFactory implements CRSFactory, CSFactory, DatumFactory, Parser {
@@ -248,7 +248,7 @@ public class GeodeticObjectFactory exten
      * {@code GeodeticObjectFactory} will fallback on the map given to this constructor for any property
      * not present in the map provided to a {@code createFoo(Map<String,?>, …)} method.
      *
-     * @param properties The default properties, or {@code null} if none.
+     * @param  properties  the default properties, or {@code null} if none.
      */
     public GeodeticObjectFactory(Map<String,?> properties) {
         if (properties == null || properties.isEmpty()) {
@@ -270,8 +270,8 @@ public class GeodeticObjectFactory exten
      *
      * <p>This method is invoked by all {@code createFoo(Map<String,?>, …)} methods.</p>
      *
-     * @param  properties The user-supplied properties.
-     * @return The union of the given properties with the default properties.
+     * @param  properties  the user-supplied properties.
+     * @return the union of the given properties with the default properties.
      */
     protected Map<String,?> complete(final Map<String,?> properties) {
         ArgumentChecks.ensureNonNull("properties", properties);
@@ -348,9 +348,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultGeocentricCRS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  datum      The geodetic datum to use in created CRS.
-     * @param  cs         The three-dimensional Cartesian coordinate system for the created CRS.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  datum       the geodetic datum to use in created CRS.
+     * @param  cs          the three-dimensional Cartesian coordinate system for the created CRS.
      * @throws FactoryException if the object creation failed.
      *
      * @see GeodeticAuthorityFactory#createGeocentricCRS(String)
@@ -381,10 +381,10 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultCartesianCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis0 The first  axis (e.g. “Geocentric X”).
-     * @param  axis1 The second axis (e.g. “Geocentric Y”).
-     * @param  axis2 The third  axis (e.g. “Geocentric Z”).
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis0       the first  axis (e.g. “Geocentric X”).
+     * @param  axis1       the second axis (e.g. “Geocentric Y”).
+     * @param  axis2       the third  axis (e.g. “Geocentric Z”).
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultCartesianCS#DefaultCartesianCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
@@ -426,9 +426,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultGeocentricCRS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  datum      Geodetic datum to use in created CRS.
-     * @param  cs         The spherical coordinate system for the created CRS.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  datum       geodetic datum to use in created CRS.
+     * @param  cs          the spherical coordinate system for the created CRS.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultGeocentricCRS#DefaultGeocentricCRS(Map, GeodeticDatum, SphericalCS)
@@ -459,10 +459,10 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultSphericalCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis0 The first  axis (e.g. “Spherical latitude”).
-     * @param  axis1 The second axis (e.g. “Spherical longitude”).
-     * @param  axis2 The third  axis (e.g. “Geocentric radius”).
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis0       the first  axis (e.g. “Spherical latitude”).
+     * @param  axis1       the second axis (e.g. “Spherical longitude”).
+     * @param  axis2       the third  axis (e.g. “Geocentric radius”).
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultSphericalCS#DefaultSphericalCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
@@ -505,9 +505,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultGeographicCRS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  datum      Geodetic datum to use in created CRS.
-     * @param  cs         The two- or three-dimensional ellipsoidal coordinate system for the created CRS.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  datum       geodetic datum to use in created CRS.
+     * @param  cs          the two- or three-dimensional ellipsoidal coordinate system for the created CRS.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultGeographicCRS#DefaultGeographicCRS(Map, GeodeticDatum, EllipsoidalCS)
@@ -543,9 +543,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultGeodeticDatum} instance.
      *
-     * @param  properties    Name and other properties to give to the new object.
-     * @param  ellipsoid     The ellipsoid to use in new geodetic datum.
-     * @param  primeMeridian The prime meridian to use in new geodetic datum.
+     * @param  properties     name and other properties to give to the new object.
+     * @param  ellipsoid      the ellipsoid to use in new geodetic datum.
+     * @param  primeMeridian  the prime meridian to use in new geodetic datum.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultGeodeticDatum#DefaultGeodeticDatum(Map, Ellipsoid, PrimeMeridian)
@@ -570,9 +570,9 @@ public class GeodeticObjectFactory exten
      *
      * <p>The default implementation creates a {@link DefaultPrimeMeridian} instance.</p>
      *
-     * @param  properties  Name and other properties to give to the new object.
-     * @param  longitude   The longitude of prime meridian in supplied angular units East of Greenwich.
-     * @param  angularUnit The angular units of longitude.
+     * @param  properties   name and other properties to give to the new object.
+     * @param  longitude    the longitude of prime meridian in supplied angular units East of Greenwich.
+     * @param  angularUnit  the angular units of longitude.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultPrimeMeridian#DefaultPrimeMeridian(Map, double, Unit)
@@ -603,9 +603,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultEllipsoidalCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis0 The first  axis (e.g. “Geodetic latitude”).
-     * @param  axis1 The second axis (e.g. “Geodetic longitude”).
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis0       the first  axis (e.g. “Geodetic latitude”).
+     * @param  axis1       the second axis (e.g. “Geodetic longitude”).
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultEllipsoidalCS#DefaultEllipsoidalCS(Map, CoordinateSystemAxis, CoordinateSystemAxis)
@@ -638,10 +638,10 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultEllipsoidalCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis0 The first  axis (e.g. “Geodetic latitude”).
-     * @param  axis1 The second axis (e.g. “Geodetic longitude”).
-     * @param  axis2 The third  axis (e.g. “Ellipsoidal height”).
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis0       the first  axis (e.g. “Geodetic latitude”).
+     * @param  axis1       the second axis (e.g. “Geodetic longitude”).
+     * @param  axis2       the third  axis (e.g. “Ellipsoidal height”).
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultEllipsoidalCS#DefaultEllipsoidalCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
@@ -666,10 +666,10 @@ public class GeodeticObjectFactory exten
      * Creates an ellipsoid from semi-axis length values.
      * The default implementation creates a {@link DefaultEllipsoid} instance.
      *
-     * @param  properties    Name and other properties to give to the new object.
-     * @param  semiMajorAxis The equatorial radius in supplied linear units.
-     * @param  semiMinorAxis The polar radius in supplied linear units.
-     * @param  unit          The linear units of ellipsoid axes.
+     * @param  properties     name and other properties to give to the new object.
+     * @param  semiMajorAxis  the equatorial radius in supplied linear units.
+     * @param  semiMinorAxis  the polar radius in supplied linear units.
+     * @param  unit           the linear units of ellipsoid axes.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultEllipsoid#createEllipsoid(Map, double, double, Unit)
@@ -693,10 +693,10 @@ public class GeodeticObjectFactory exten
      * Creates an ellipsoid from a major semi-axis length and inverse flattening.
      * The default implementation creates a {@link DefaultEllipsoid} instance.
      *
-     * @param  properties        Name and other properties to give to the new object.
-     * @param  semiMajorAxis     The equatorial radius in supplied linear units.
-     * @param  inverseFlattening The eccentricity of ellipsoid.
-     * @param  unit              The linear units of major axis.
+     * @param  properties         name and other properties to give to the new object.
+     * @param  semiMajorAxis      the equatorial radius in supplied linear units.
+     * @param  inverseFlattening  the eccentricity of ellipsoid.
+     * @param  unit               the linear units of major axis.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultEllipsoid#createFlattenedSphere(Map, double, double, Unit)
@@ -743,11 +743,11 @@ public class GeodeticObjectFactory exten
      *
      * <p>The default implementation creates a {@link DefaultProjectedCRS} instance.</p>
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  baseCRS    The geographic coordinate reference system to base projection on.
-     * @param  conversion The defining conversion from a {@linkplain org.apache.sis.referencing.cs.AxesConvention#NORMALIZED
-     *                    normalized} base to a normalized derived CRS.
-     * @param  derivedCS  The coordinate system for the projected CRS.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  baseCRS     the geographic coordinate reference system to base projection on.
+     * @param  conversion  the defining conversion from a {@linkplain org.apache.sis.referencing.cs.AxesConvention#NORMALIZED
+     *                     normalized} base to a normalized derived CRS.
+     * @param  derivedCS   the coordinate system for the projected CRS.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultProjectedCRS#DefaultProjectedCRS(Map, GeographicCRS, Conversion, CartesianCS)
@@ -783,9 +783,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultCartesianCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis0 The first  axis (e.g. “Easting”).
-     * @param  axis1 The second axis (e.g. “Northing”).
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis0       the first  axis (e.g. “Easting”).
+     * @param  axis1       the second axis (e.g. “Northing”).
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultCartesianCS#DefaultCartesianCS(Map, CoordinateSystemAxis, CoordinateSystemAxis)
@@ -826,11 +826,11 @@ public class GeodeticObjectFactory exten
      *
      * <p>The default implementation creates a {@link DefaultDerivedCRS} instance.</p>
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  baseCRS    The coordinate reference system to base projection on. Shall be an instance of {@link SingleCRS}.
-     * @param  conversion The defining conversion from a {@linkplain org.apache.sis.referencing.cs.AxesConvention#NORMALIZED
-     *                    normalized} base to a normalized derived CRS.
-     * @param  derivedCS  The coordinate system for the derived CRS.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  baseCRS     the coordinate reference system to base projection on. Shall be an instance of {@link SingleCRS}.
+     * @param  conversion  the defining conversion from a {@linkplain org.apache.sis.referencing.cs.AxesConvention#NORMALIZED
+     *                     normalized} base to a normalized derived CRS.
+     * @param  derivedCS   the coordinate system for the derived CRS.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultDerivedCRS#create(Map, SingleCRS, Conversion, CoordinateSystem)
@@ -870,9 +870,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultVerticalCRS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  datum      The vertical datum to use in created CRS.
-     * @param  cs         The vertical coordinate system for the created CRS.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  datum       the vertical datum to use in created CRS.
+     * @param  cs          the vertical coordinate system for the created CRS.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultVerticalCRS#DefaultVerticalCRS(Map, VerticalDatum, VerticalCS)
@@ -895,8 +895,8 @@ public class GeodeticObjectFactory exten
      * Creates a vertical datum from an enumerated type value.
      * The default implementation creates a {@link DefaultVerticalDatum} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  type       The type of this vertical datum (often geoidal).
+     * @param  properties  name and other properties to give to the new object.
+     * @param  type        the type of this vertical datum (often geoidal).
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultVerticalDatum#DefaultVerticalDatum(Map, VerticalDatumType)
@@ -927,8 +927,8 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultVerticalCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis The single axis (e.g. “height” or “depth”).
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis        the single axis (e.g. “height” or “depth”).
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultVerticalCS#DefaultVerticalCS(Map, CoordinateSystemAxis)
@@ -960,9 +960,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultTemporalCRS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  datum      The temporal datum to use in created CRS.
-     * @param  cs         The temporal coordinate system for the created CRS.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  datum       the temporal datum to use in created CRS.
+     * @param  cs          the temporal coordinate system for the created CRS.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultTemporalCRS#DefaultTemporalCRS(Map, TemporalDatum, TimeCS)
@@ -985,8 +985,8 @@ public class GeodeticObjectFactory exten
      * Creates a temporal datum from an enumerated type value.
      * The default implementation creates a {@link DefaultTemporalDatum} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  origin     The date and time origin of this temporal datum.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  origin      the date and time origin of this temporal datum.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultTemporalDatum#DefaultTemporalDatum(Map, Date)
@@ -1017,8 +1017,8 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultTimeCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis The single axis.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis        the single axis.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultTimeCS#DefaultTimeCS(Map, CoordinateSystemAxis)
@@ -1057,9 +1057,9 @@ public class GeodeticObjectFactory exten
      * and the return type may be changed to {@code org.opengis.referencing.crs.ParametricCRS}.
      * Those change are pending GeoAPI revision.</div>
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  datum      The parametric datum to use in created CRS.
-     * @param  cs         The parametric coordinate system for the created CRS.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  datum       the parametric datum to use in created CRS.
+     * @param  cs          the parametric coordinate system for the created CRS.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultParametricCRS#DefaultParametricCRS(Map, DefaultParametricDatum, DefaultParametricCS)
@@ -1084,7 +1084,7 @@ public class GeodeticObjectFactory exten
      * <div class="warning"><b>Warning:</b> in a future SIS version, the return type may be changed
      * to {@code org.opengis.referencing.datum.ParametricDatum}. This change is pending GeoAPI revision.</div>
      *
-     * @param  properties Name and other properties to give to the new object.
+     * @param  properties  name and other properties to give to the new object.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultParametricDatum#DefaultParametricDatum(Map)
@@ -1117,8 +1117,8 @@ public class GeodeticObjectFactory exten
      * <div class="warning"><b>Warning:</b> in a future SIS version, the return type may be changed
      * to {@code org.opengis.referencing.cs.ParametricCS}. This change is pending GeoAPI revision.</div>
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis The single axis.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis        the single axis.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultParametricCS#DefaultParametricCS(Map, CoordinateSystemAxis)
@@ -1147,7 +1147,7 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultCompoundCRS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
+     * @param  properties  name and other properties to give to the new object.
      * @param  elements   Ordered array of {@code CoordinateReferenceSystem} objects.
      * @throws FactoryException if the object creation failed.
      *
@@ -1171,9 +1171,9 @@ public class GeodeticObjectFactory exten
      * Creates an image coordinate reference system.
      * The default implementation creates a {@link DefaultImageCRS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  datum      The image datum to use in created CRS.
-     * @param  cs         The Cartesian or oblique Cartesian coordinate system for the created CRS.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  datum       the image datum to use in created CRS.
+     * @param  cs          the Cartesian or oblique Cartesian coordinate system for the created CRS.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultImageCRS#DefaultImageCRS(Map, ImageDatum, AffineCS)
@@ -1228,9 +1228,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultAffineCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis0 The first  axis.
-     * @param  axis1 The second axis.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis0       the first  axis.
+     * @param  axis1       the second axis.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultAffineCS#DefaultAffineCS(Map, CoordinateSystemAxis, CoordinateSystemAxis)
@@ -1268,9 +1268,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultEngineeringCRS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  datum      The engineering datum to use in created CRS.
-     * @param  cs         The coordinate system for the created CRS.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  datum       the engineering datum to use in created CRS.
+     * @param  cs          the coordinate system for the created CRS.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultEngineeringCRS#DefaultEngineeringCRS(Map, EngineeringDatum, CoordinateSystem)
@@ -1293,7 +1293,7 @@ public class GeodeticObjectFactory exten
      * Creates an engineering datum.
      * The default implementation creates a {@link DefaultEngineeringDatum} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
+     * @param  properties  name and other properties to give to the new object.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultEngineeringDatum#DefaultEngineeringDatum(Map)
@@ -1324,10 +1324,10 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultAffineCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis0 The first  axis.
-     * @param  axis1 The second axis.
-     * @param  axis2 The third  axis.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis0       the first  axis.
+     * @param  axis1       the second axis.
+     * @param  axis2       the third  axis.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultAffineCS#DefaultAffineCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
@@ -1359,10 +1359,10 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultCylindricalCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis0 The first  axis.
-     * @param  axis1 The second axis.
-     * @param  axis2 The third  axis.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis0       the first  axis.
+     * @param  axis1       the second axis.
+     * @param  axis2       the third  axis.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultCylindricalCS#DefaultCylindricalCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
@@ -1395,9 +1395,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultPolarCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis0 The first  axis.
-     * @param  axis1 The second axis.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis0       the first  axis.
+     * @param  axis1       the second axis.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultPolarCS#DefaultPolarCS(Map, CoordinateSystemAxis, CoordinateSystemAxis)
@@ -1429,8 +1429,8 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultLinearCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis The single axis.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis        the single axis.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultLinearCS#DefaultLinearCS(Map, CoordinateSystemAxis)
@@ -1460,9 +1460,9 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultUserDefinedCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis0 The first  axis.
-     * @param  axis1 The second axis.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis0       the first  axis.
+     * @param  axis1       the second axis.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultUserDefinedCS#DefaultUserDefinedCS(Map, CoordinateSystemAxis, CoordinateSystemAxis)
@@ -1493,10 +1493,10 @@ public class GeodeticObjectFactory exten
      *
      * The default implementation creates a {@link DefaultUserDefinedCS} instance.
      *
-     * @param  properties Name and other properties to give to the new object.
-     * @param  axis0 The first  axis.
-     * @param  axis1 The second axis.
-     * @param  axis2 The third  axis.
+     * @param  properties  name and other properties to give to the new object.
+     * @param  axis0       the first  axis.
+     * @param  axis1       the second axis.
+     * @param  axis2       the third  axis.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultUserDefinedCS#DefaultUserDefinedCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
@@ -1523,10 +1523,10 @@ public class GeodeticObjectFactory exten
      *
      * <p>The default implementation creates a {@link DefaultCoordinateSystemAxis} instance.</p>
      *
-     * @param  properties   Name and other properties to give to the new object.
-     * @param  abbreviation The coordinate axis abbreviation.
-     * @param  direction    The axis direction.
-     * @param  unit         The coordinate axis unit.
+     * @param  properties    name and other properties to give to the new object.
+     * @param  abbreviation  the coordinate axis abbreviation.
+     * @param  direction     the axis direction.
+     * @param  unit          the coordinate axis unit.
      * @throws FactoryException if the object creation failed.
      *
      * @see DefaultCoordinateSystemAxis#DefaultCoordinateSystemAxis(Map, String, AxisDirection, Unit)
@@ -1553,7 +1553,7 @@ public class GeodeticObjectFactory exten
      *
      * <p>The default implementation delegates to {@link XML#unmarshal(String)}</p>
      *
-     * @param  xml Coordinate reference system encoded in XML format.
+     * @param  xml  coordinate reference system encoded in XML format.
      * @throws FactoryException if the object creation failed.
      *
      * @see XML#unmarshal(String)
@@ -1611,7 +1611,7 @@ public class GeodeticObjectFactory exten
      * Applications which need to parse a large amount of WKT strings should consider to use
      * the {@link org.apache.sis.io.wkt.WKTFormat} class instead than this method.
      *
-     * @param  text Coordinate system encoded in Well-Known Text format (version 1 or 2).
+     * @param  text  coordinate system encoded in Well-Known Text format (version 1 or 2).
      * @throws FactoryException if the object creation failed.
      *
      * @see org.apache.sis.io.wkt

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -33,7 +33,7 @@ import java.util.concurrent.atomic.Atomi
 import java.util.ConcurrentModificationException;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.referencing.*;
 import org.opengis.referencing.cs.*;
 import org.opengis.referencing.crs.*;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/BursaWolfInfo.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/BursaWolfInfo.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/BursaWolfInfo.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/BursaWolfInfo.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -21,10 +21,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.LinkedHashMap;
 import java.sql.ResultSet;
-import javax.measure.unit.Unit;
-import javax.measure.unit.NonSI;
-import javax.measure.unit.SI;
-import javax.measure.converter.ConversionException;
+import javax.measure.Unit;
+import javax.measure.IncommensurableException;
 import org.opengis.util.FactoryException;
 import org.opengis.metadata.extent.Extent;
 import org.apache.sis.internal.referencing.ExtentSelector;
@@ -46,7 +44,7 @@ import org.apache.sis.measure.Units;
  *
  * @author  Martin Desruisseaux (IRD)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  *
  * @see BursaWolfParameters
@@ -92,13 +90,13 @@ final class BursaWolfInfo {
     {
         Unit<?> target = unit;
         if (code >= 8605) {
-            if      (code <= 8607) target = SI   .METRE;
-            else if (code <= 8610) target = NonSI.SECOND_ANGLE;
+            if      (code <= 8607) target = Units.METRE;
+            else if (code <= 8610) target = Units.ARC_SECOND;
             else if (code == 8611) target = Units.PPM;
         }
         if (target != unit) try {
             value = unit.getConverterToAny(target).convert(value);
-        } catch (ConversionException e) {
+        } catch (IncommensurableException e) {
             throw new FactoryDataException(Errors.getResources(locale).getString(Errors.Keys.IncompatibleUnit_1, unit), e);
         }
         switch (code) {

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -42,9 +42,10 @@ import java.text.DateFormat;
 import java.text.ParseException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import javax.measure.quantity.Angle;
 import javax.measure.quantity.Length;
+import javax.measure.format.ParserException;
 
 import org.opengis.util.NameSpace;
 import org.opengis.util.GenericName;
@@ -161,7 +162,7 @@ import org.apache.sis.referencing.datum.
  * @author  Andrea Aime (TOPP)
  * @author  Johann Sorel (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  *
  * @see <a href="http://sis.apache.org/tables/CoordinateReferenceSystems.html">List of authority codes</a>
@@ -2407,10 +2408,10 @@ addURIs:    for (int i=0; ; i++) {
                 if (unit == null) {
                     final Unit<?> base = Units.valueOfEPSG(target);
                     if (base != null && !Double.isNaN(b) && !Double.isNaN(c)) {     // May be NaN if the conversion is non-linear.
-                        unit = Units.multiply(base, b/c);
+                        unit = Units.multiply(base, b, c);
                     } else try {
                         unit = Units.valueOf(getString(code, result, 5));           // Try parsing the unit symbol as a fallback.
-                    } catch (IllegalArgumentException e) {
+                    } catch (ParserException e) {
                         throw new FactoryDataException(error().getString(Errors.Keys.UnknownUnit_1, code), e);
                     }
                 }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/TableInfo.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/TableInfo.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/TableInfo.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/TableInfo.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,7 +16,7 @@
  */
 package org.apache.sis.referencing.factory.sql;
 
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.referencing.cs.*;
 import org.opengis.referencing.crs.*;
 import org.opengis.referencing.datum.*;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -24,7 +24,7 @@ import javax.xml.bind.annotation.XmlType
 import javax.xml.bind.annotation.XmlSeeAlso;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
-import javax.measure.converter.ConversionException;
+import javax.measure.IncommensurableException;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.extent.Extent;
@@ -821,7 +821,7 @@ check:      for (int isTarget=0; ; isTar
                                     CoordinateSystems.swapAndScaleAxes(that.getTargetCRS().getCoordinateSystem(),
                                                                        this.getTargetCRS().getCoordinateSystem()));
                             tr2 = MathTransforms.concatenate(before, tr2, after);
-                        } catch (ConversionException | RuntimeException e) {
+                        } catch (IncommensurableException | RuntimeException e) {
                             Logging.recoverableException(Logging.getLogger(Loggers.COORDINATE_OPERATION),
                                     AbstractCoordinateOperation.class, "equals", e);
                         }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -20,9 +20,9 @@ import java.util.Map;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Collections;
-import javax.measure.unit.Unit;
-import javax.measure.quantity.Duration;
-import javax.measure.converter.ConversionException;
+import javax.measure.Unit;
+import javax.measure.quantity.Time;
+import javax.measure.IncommensurableException;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.cs.*;
@@ -107,7 +107,7 @@ import static org.apache.sis.util.Utilit
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  *
  * @see DefaultCoordinateOperationFactory#createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem, CoordinateOperationContext)
@@ -199,7 +199,7 @@ public class CoordinateOperationFinder e
         if (equalsIgnoreMetadata(sourceCRS, targetCRS)) try {
             return createFromAffineTransform(AXIS_CHANGES, sourceCRS, targetCRS,
                     CoordinateSystems.swapAndScaleAxes(sourceCRS.getCoordinateSystem(), targetCRS.getCoordinateSystem()));
-        } catch (IllegalArgumentException | ConversionException e) {
+        } catch (IllegalArgumentException | IncommensurableException e) {
             throw new FactoryException(Resources.format(Resources.Keys.CanNotInstantiateGeodeticObject_1, new CRSPair(sourceCRS, targetCRS)), e);
         }
         /*
@@ -672,7 +672,7 @@ public class CoordinateOperationFinder e
         final Matrix matrix;
         try {
             matrix = CoordinateSystems.swapAndScaleAxes(sourceCS, targetCS);
-        } catch (IllegalArgumentException | ConversionException exception) {
+        } catch (IllegalArgumentException | IncommensurableException exception) {
             throw new OperationNotFoundException(notFoundMessage(sourceCRS, targetCRS), exception);
         }
         return createFromAffineTransform(AXIS_CHANGES, sourceCRS, targetCRS, matrix);
@@ -702,7 +702,7 @@ public class CoordinateOperationFinder e
          * much to add to a time in 'sourceCRS' in order to get a time in 'targetCRS'. This "epoch shift" is
          * in units of 'targetCRS'.
          */
-        final Unit<Duration> targetUnit = targetCS.getAxis(0).getUnit().asType(Duration.class);
+        final Unit<Time> targetUnit = targetCS.getAxis(0).getUnit().asType(Time.class);
         double epochShift = sourceDatum.getOrigin().getTime() -
                             targetDatum.getOrigin().getTime();
         epochShift = Units.MILLISECOND.getConverterTo(targetUnit).convert(epochShift);
@@ -718,7 +718,7 @@ public class CoordinateOperationFinder e
         final Matrix matrix;
         try {
             matrix = CoordinateSystems.swapAndScaleAxes(sourceCS, targetCS);
-        } catch (IllegalArgumentException | ConversionException exception) {
+        } catch (IllegalArgumentException | IncommensurableException exception) {
             throw new OperationNotFoundException(notFoundMessage(sourceCRS, targetCRS), exception);
         }
         final int translationColumn = matrix.getNumCol() - 1;           // Paranoiac check: should always be 1.

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -25,7 +25,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
-import javax.measure.converter.ConversionException;
+import javax.measure.IncommensurableException;
 
 import org.opengis.util.FactoryException;
 import org.opengis.util.NoSuchIdentifierException;
@@ -104,7 +104,7 @@ import org.apache.sis.internal.jdk8.Pred
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 class CoordinateOperationRegistry {
@@ -335,7 +335,7 @@ class CoordinateOperationRegistry {
                     }
                     return operation;
                 }
-            } catch (IllegalArgumentException | ConversionException e) {
+            } catch (IllegalArgumentException | IncommensurableException e) {
                 String message = Resources.format(Resources.Keys.CanNotInstantiateGeodeticObject_1, new CRSPair(sourceCRS, targetCRS));
                 String details = e.getLocalizedMessage();
                 if (details != null) {
@@ -359,12 +359,12 @@ class CoordinateOperationRegistry {
      * @return A coordinate operation from {@code sourceCRS} to {@code targetCRS}, or {@code null}
      *         if no such operation is explicitly defined in the underlying database.
      * @throws IllegalArgumentException if the coordinate systems are not of the same type or axes do not match.
-     * @throws ConversionException if the units are not compatible or a unit conversion is non-linear.
+     * @throws IncommensurableException if the units are not compatible or a unit conversion is non-linear.
      * @throws FactoryException if an error occurred while creating the operation.
      */
     private CoordinateOperation search(final CoordinateReferenceSystem sourceCRS,
                                        final CoordinateReferenceSystem targetCRS)
-            throws IllegalArgumentException, ConversionException, FactoryException
+            throws IllegalArgumentException, IncommensurableException, FactoryException
     {
         final String sourceID = findCode(sourceCRS);
         if (sourceID == null) {
@@ -577,13 +577,13 @@ class CoordinateOperationRegistry {
      * @param  targetCRS  the target CRS requested by the user.
      * @return a coordinate operation for the given source and target CRS.
      * @throws IllegalArgumentException if the coordinate systems are not of the same type or axes do not match.
-     * @throws ConversionException if the units are not compatible or a unit conversion is non-linear.
+     * @throws IncommensurableException if the units are not compatible or a unit conversion is non-linear.
      * @throws FactoryException if the operation can not be constructed.
      */
     private CoordinateOperation complete(final CoordinateOperation       operation,
                                          final CoordinateReferenceSystem sourceCRS,
                                          final CoordinateReferenceSystem targetCRS)
-            throws IllegalArgumentException, ConversionException, FactoryException
+            throws IllegalArgumentException, IncommensurableException, FactoryException
     {
         CoordinateReferenceSystem source = operation.getSourceCRS();
         CoordinateReferenceSystem target = operation.getTargetCRS();
@@ -604,13 +604,13 @@ class CoordinateOperationRegistry {
      * @param  mtFactory  the math transform factory to use.
      * @return the transform from the given source to the given target CRS, or {@code null} if none is needed.
      * @throws IllegalArgumentException if the coordinate systems are not of the same type or axes do not match.
-     * @throws ConversionException if the units are not compatible or a unit conversion is non-linear.
+     * @throws IncommensurableException if the units are not compatible or a unit conversion is non-linear.
      * @throws FactoryException if an error occurred while creating a math transform.
      */
     private static MathTransform swapAndScaleAxes(final CoordinateReferenceSystem sourceCRS,
                                                   final CoordinateReferenceSystem targetCRS,
                                                   final MathTransformFactory      mtFactory)
-            throws IllegalArgumentException, ConversionException, FactoryException
+            throws IllegalArgumentException, IncommensurableException, FactoryException
     {
         assert ReferencingUtilities.getDimension(sourceCRS) != ReferencingUtilities.getDimension(targetCRS)
                 || Utilities.deepEquals(sourceCRS, targetCRS, ComparisonMode.ALLOW_VARIANT);

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -19,7 +19,7 @@ package org.apache.sis.referencing.opera
 import java.util.Map;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlRootElement;
-import javax.measure.converter.ConversionException;
+import javax.measure.IncommensurableException;
 import org.opengis.util.FactoryException;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.referencing.operation.Conversion;
@@ -483,7 +483,7 @@ public class DefaultConversion extends A
                 transform = factory.createConcatenatedTransform(isSource ? s : transform,
                                                                 isSource ? transform : s);
             }
-        } catch (ConversionException e) {
+        } catch (IncommensurableException e) {
             throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalArgumentValue_2,
                     (isSource ? "sourceCRS" : "targetCRS"),
                     (isSource ?  sourceCRS  :  targetCRS).getName()), e);

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/InverseOperationMethod.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/InverseOperationMethod.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/InverseOperationMethod.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/InverseOperationMethod.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -20,7 +20,7 @@ import java.util.Map;
 import java.util.HashMap;
 import java.util.Collection;
 import javax.xml.bind.annotation.XmlTransient;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.quality.PositionalAccuracy;
 import org.opengis.util.InternationalString;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/MathTransformContext.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/MathTransformContext.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/MathTransformContext.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/MathTransformContext.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,7 +16,6 @@
  */
 package org.apache.sis.referencing.operation;
 
-import javax.measure.unit.NonSI;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.cs.CartesianCS;
 import org.opengis.referencing.cs.CoordinateSystem;
@@ -29,6 +28,7 @@ import org.apache.sis.referencing.operat
 import org.apache.sis.referencing.operation.transform.ContextualParameters.MatrixRole;
 import org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory.Context;
 import org.apache.sis.util.resources.Errors;
+import org.apache.sis.measure.Units;
 
 
 /**
@@ -40,7 +40,7 @@ import org.apache.sis.util.resources.Err
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 final class MathTransformContext extends Context {
@@ -59,8 +59,8 @@ final class MathTransformContext extends
      * to the information provided by the super-class.
      */
     MathTransformContext(final GeodeticDatum source, final GeodeticDatum target) {
-        final double rs = ReferencingUtilities.getGreenwichLongitude(source.getPrimeMeridian(), NonSI.DEGREE_ANGLE);
-        final double rt = ReferencingUtilities.getGreenwichLongitude(target.getPrimeMeridian(), NonSI.DEGREE_ANGLE);
+        final double rs = ReferencingUtilities.getGreenwichLongitude(source.getPrimeMeridian(), Units.DEGREE);
+        final double rt = ReferencingUtilities.getGreenwichLongitude(target.getPrimeMeridian(), Units.DEGREE);
         if (rs != rt) {
             sourceMeridian = rs;
             targetMeridian = rt;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -36,7 +36,7 @@ import org.apache.sis.internal.referenci
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4
- * @version 0.7
+ * @version 0.8
  * @module
  *
  * @see Matrices#createDiagonal(int, int)
@@ -89,12 +89,12 @@ class GeneralMatrix extends MatrixSIS im
      * If {@code setToIdentity} is {@code true}, then the elements
      * on the diagonal (<var>j</var> == <var>i</var>) are set to 1.
      *
-     * @param numRow Number of rows.
-     * @param numCol Number of columns.
-     * @param setToIdentity {@code true} for initializing the matrix to the identity matrix,
-     *        or {@code false} for leaving it initialized to zero.
-     * @param precision 1 for normal precision, or 2 for extended precision.
-     *        No other value is allowed (this is not verified).
+     * @param  numRow         number of rows.
+     * @param  numCol         number of columns.
+     * @param  setToIdentity  {@code true} for initializing the matrix to the identity matrix,
+     *                        or {@code false} for leaving it initialized to zero.
+     * @param  precision      1 for normal precision, or 2 for extended precision.
+     *                        No other value is allowed (this is not verified).
      */
     GeneralMatrix(final int numRow, final int numCol, final boolean setToIdentity, final int precision) {
         ensureValidSize(numRow, numCol);
@@ -114,9 +114,9 @@ class GeneralMatrix extends MatrixSIS im
      * The array values are copied in one row at a time in row major fashion.
      * The array shall be exactly {@code numRow*numCol} in length.
      *
-     * @param numRow Number of rows.
-     * @param numCol Number of columns.
-     * @param elements Initial values.
+     * @param  numRow    number of rows.
+     * @param  numCol    number of columns.
+     * @param  elements  initial values.
      */
     GeneralMatrix(final int numRow, final int numCol, final double[] elements) {
         ensureValidSize(numRow, numCol);
@@ -129,7 +129,7 @@ class GeneralMatrix extends MatrixSIS im
     /**
      * Constructs a new matrix and copies the initial values from the given matrix.
      *
-     * @param matrix The matrix to copy.
+     * @param  matrix  the matrix to copy.
      */
     GeneralMatrix(final Matrix matrix) {
         final int numRow = matrix.getNumRow();
@@ -158,10 +158,10 @@ class GeneralMatrix extends MatrixSIS im
     /**
      * Creates a new extended precision matrix of the given size.
      *
-     * @param numRow Number of rows.
-     * @param numCol Number of columns.
-     * @param setToIdentity {@code true} for initializing the matrix to the identity matrix,
-     *        or {@code false} for leaving it initialized to zero.
+     * @param  numRow         number of rows.
+     * @param  numCol         number of columns.
+     * @param  setToIdentity  {@code true} for initializing the matrix to the identity matrix,
+     *                        or {@code false} for leaving it initialized to zero.
      */
     static GeneralMatrix createExtendedPrecision(final int numRow, final int numCol, final boolean setToIdentity) {
         if (numRow == numCol) {
@@ -262,9 +262,9 @@ class GeneralMatrix extends MatrixSIS im
      * Retrieves the value at the specified row and column of this matrix, wrapped in a {@code Number}
      * or a {@link DoubleDouble} depending on available precision.
      *
-     * @param row    The row index, from 0 inclusive to {@link #getNumRow()} exclusive.
-     * @param column The column index, from 0 inclusive to {@link #getNumCol()} exclusive.
-     * @return       The current value at the given row and column.
+     * @param  row     the row index, from 0 inclusive to {@link #getNumRow()} exclusive.
+     * @param  column  the column index, from 0 inclusive to {@link #getNumCol()} exclusive.
+     * @return the current value at the given row and column.
      */
     @Override
     public Number getNumber(int row, int column) {
@@ -285,9 +285,9 @@ class GeneralMatrix extends MatrixSIS im
     /**
      * Retrieves the value at the specified row and column of this matrix.
      *
-     * @param row    The row index, from 0 inclusive to {@link #getNumRow()} exclusive.
-     * @param column The column index, from 0 inclusive to {@link #getNumCol()} exclusive.
-     * @return       The current value at the given row and column.
+     * @param  row     the row index, from 0 inclusive to {@link #getNumRow()} exclusive.
+     * @param  column  the column index, from 0 inclusive to {@link #getNumCol()} exclusive.
+     * @return the current value at the given row and column.
      */
     @Override
     public final double getElement(final int row, final int column) {
@@ -301,9 +301,9 @@ class GeneralMatrix extends MatrixSIS im
     /**
      * Modifies the value at the specified row and column of this matrix.
      *
-     * @param row    The row index, from 0 inclusive to {@link #getNumRow() } exclusive.
-     * @param column The column index, from 0 inclusive to {@link #getNumCol()} exclusive.
-     * @param value  The new value to set at the given row and column.
+     * @param  row     the row index, from 0 inclusive to {@link #getNumRow() } exclusive.
+     * @param  column  the column index, from 0 inclusive to {@link #getNumCol()} exclusive.
+     * @param  value   the new value to set at the given row and column.
      */
     @Override
     public final void setElement(final int row, final int column, final double value) {
@@ -326,7 +326,7 @@ class GeneralMatrix extends MatrixSIS im
      * <p>This method may return a direct reference to the internal array. <strong>Do not modify.</strong>,
      * unless the {@code copy} argument is {@code true}.</p>
      *
-     * @param copy If {@code true}, then the returned array is guaranteed to be a copy, never the internal array.
+     * @param  copy  if {@code true}, then the returned array is guaranteed to be a copy, never the internal array.
      */
     static double[] getExtendedElements(final Matrix matrix, final int numRow, final int numCol, final boolean copy) {
         double[] elements;
@@ -406,11 +406,11 @@ class GeneralMatrix extends MatrixSIS im
      *       may have any values.</li>
      * </ul>
      *
-     * @param  elements The new matrix elements in a row-major array.
+     * @param  elements  the new matrix elements in a row-major array.
      * @return {@code true} if at leat one {@link DoubleDouble} instance has been found, in which case all
      *         errors terms have been initialized, or {@code false} otherwise, in which case no error term
      *         has been initialized (this is a <cite>all or nothing</cite> operation).
-     * @throws IllegalArgumentException If the given array does not have the expected length.
+     * @throws IllegalArgumentException if the given array does not have the expected length.
      *
      * @see Matrices#create(int, int, Number[])
      */
@@ -424,7 +424,10 @@ class GeneralMatrix extends MatrixSIS im
         }
         boolean isExtended = false;
         for (int i=0; i<length; i++) {
-            final Number value = newValues[i];
+            Number value = newValues[i];
+            if (DoubleDouble.shouldConvert(value)) {
+                value = new DoubleDouble(value);
+            }
             final double element = value.doubleValue();
             elements[i] = element;
             final double error;
@@ -461,7 +464,7 @@ class GeneralMatrix extends MatrixSIS im
      * Sets this matrix to the values of another matrix. This method overrides the default implementation with a more
      * efficient implementation in the particular case where the other matrix is an instance of {@code GeneralMatrix}.
      *
-     * @param matrix  The matrix to copy.
+     * @param  matrix  the matrix to copy.
      * @throws MismatchedMatrixSizeException if the given matrix has a different size than this matrix.
      *
      * @since 0.7
@@ -500,7 +503,7 @@ class GeneralMatrix extends MatrixSIS im
     /**
      * Implementation of {@link #isAffine()} with control on whether we require the matrix to be square.
      *
-     * @param square {@code true} if the matrix must be square, or {@code false} for allowing non-square matrices.
+     * @param  square  {@code true} if the matrix must be square, or {@code false} for allowing non-square matrices.
      */
     final boolean isAffine(final boolean square) {
         final int numRow = this.numRow;                     // Protection against accidental changes.
@@ -540,7 +543,7 @@ class GeneralMatrix extends MatrixSIS im
         if (numRow != numCol) {
             return false;
         }
-        int di = 0; // Index of next diagonal element.
+        int di = 0;                                         // Index of next diagonal element.
         final int length = numRow * numCol;
         for (int i=0; i<length; i++) {
             final double element = elements[i];
@@ -630,7 +633,7 @@ class GeneralMatrix extends MatrixSIS im
      * Returns {@code true} if the specified object is of type {@code GeneralMatrix} and
      * all of the data members are equal to the corresponding data members in this matrix.
      *
-     * @param object The object to compare with this matrix for equality.
+     * @param  object  the object to compare with this matrix for equality.
      * @return {@code true} if the given object is equal to this matrix.
      */
     @Override

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -122,9 +122,9 @@ public final class Matrices extends Stat
      * {@value org.apache.sis.referencing.operation.matrix.Matrix4#SIZE} inclusive, the matrix
      * is guaranteed to be an instance of one of {@link Matrix1} … {@link Matrix4} subtypes.</div>
      *
-     * @param numRow For a math transform, this is the number of {@linkplain MathTransform#getTargetDimensions() target dimensions} + 1.
-     * @param numCol For a math transform, this is the number of {@linkplain MathTransform#getSourceDimensions() source dimensions} + 1.
-     * @return An identity matrix of the given size.
+     * @param  numRow  for a math transform, this is the number of {@linkplain MathTransform#getTargetDimensions() target dimensions} + 1.
+     * @param  numCol  for a math transform, this is the number of {@linkplain MathTransform#getSourceDimensions() source dimensions} + 1.
+     * @return an identity matrix of the given size.
      */
     public static MatrixSIS createDiagonal(final int numRow, final int numCol) {
         if (numRow == numCol) {
@@ -144,9 +144,9 @@ public final class Matrices extends Stat
      * {@value org.apache.sis.referencing.operation.matrix.Matrix4#SIZE} inclusive, the matrix
      * is guaranteed to be an instance of one of {@link Matrix1} … {@link Matrix4} subtypes.</div>
      *
-     * @param numRow For a math transform, this is the number of {@linkplain MathTransform#getTargetDimensions() target dimensions} + 1.
-     * @param numCol For a math transform, this is the number of {@linkplain MathTransform#getSourceDimensions() source dimensions} + 1.
-     * @return A matrix of the given size with only zero values.
+     * @param  numRow  for a math transform, this is the number of {@linkplain MathTransform#getTargetDimensions() target dimensions} + 1.
+     * @param  numCol  for a math transform, this is the number of {@linkplain MathTransform#getSourceDimensions() source dimensions} + 1.
+     * @return a matrix of the given size with only zero values.
      */
     public static MatrixSIS createZero(final int numRow, final int numCol) {
         if (numRow == numCol) switch (numRow) {
@@ -176,10 +176,10 @@ public final class Matrices extends Stat
      * {@value org.apache.sis.referencing.operation.matrix.Matrix4#SIZE} inclusive, the matrix
      * is guaranteed to be an instance of one of {@link Matrix1} … {@link Matrix4} subtypes.</div>
      *
-     * @param  numRow   Number of rows.
-     * @param  numCol   Number of columns.
-     * @param  elements The matrix elements in a row-major array. Column indices vary fastest.
-     * @return A matrix initialized to the given elements.
+     * @param  numRow    number of rows.
+     * @param  numCol    number of columns.
+     * @param  elements  the matrix elements in a row-major array. Column indices vary fastest.
+     * @return a matrix initialized to the given elements.
      *
      * @see MatrixSIS#setElements(double[])
      */
@@ -198,10 +198,10 @@ public final class Matrices extends Stat
      * Creates a matrix of size {@code numRow} × {@code numCol} initialized to the given numbers.
      * The elements array size must be equals to {@code numRow*numCol}. Column indices vary fastest.
      *
-     * @param  numRow   Number of rows.
-     * @param  numCol   Number of columns.
-     * @param  elements The matrix elements in a row-major array. Column indices vary fastest.
-     * @return A matrix initialized to the given elements.
+     * @param  numRow    number of rows.
+     * @param  numCol    number of columns.
+     * @param  elements  the matrix elements in a row-major array. Column indices vary fastest.
+     * @return a matrix initialized to the given elements.
      */
     public static MatrixSIS create(final int numRow, final int numCol, final Number[] elements) {
         ArgumentChecks.ensureNonNull("elements", elements);
@@ -240,7 +240,12 @@ public final class Matrices extends Stat
         } else {
             dstCorner = srcCorner = srcOppositeCorner = null;
         }
-        final MatrixSIS matrix = createZero(dstAxes.length+1, srcAxes.length+1);
+        /*
+         * Unconditionally create extended precision matrix even if standard precision would be
+         * enough because callers in other package may perform additional arithmetic operations
+         * on it (for example org.apache.sis.referencing.cs.CoordinateSystems.swapAndScaleAxes).
+         */
+        final MatrixSIS matrix = new GeneralMatrix(dstAxes.length+1, srcAxes.length+1, false, 2);
         /*
          * Maps source axes to destination axes. If no axis is moved (for example if the user
          * want to transform (NORTH,EAST) to (SOUTH,EAST)), then source and destination index
@@ -265,18 +270,23 @@ public final class Matrices extends Stat
                      * They will be left to zero, which is their desired value.
                      */
                     final boolean same = srcDir.equals(dstDir);
-                    double scale = same ? +1 : -1;
-                    double translate = 0;
                     if (useEnvelopes) {
                         // See the comment in transform(Envelope, Envelope) for an explanation about why
                         // we use the lower/upper corners instead than getMinimum()/getMaximum() methods.
-                        translate  = dstCorner.getOrdinate(dstIndex);
-                        scale     *= dstEnvelope.getSpan(dstIndex) /
-                                     srcEnvelope.getSpan(srcIndex);
-                        translate -= scale * (same ? srcCorner : srcOppositeCorner).getOrdinate(srcIndex);
+                        final DoubleDouble scale = new DoubleDouble(same ? +1 : -1, 0);
+                        scale.multiply(dstEnvelope.getSpan(dstIndex));
+                        scale.divide  (srcEnvelope.getSpan(srcIndex));
+
+                        final DoubleDouble translate = new DoubleDouble(scale);
+                        translate.multiply((same ? srcCorner : srcOppositeCorner).getOrdinate(srcIndex));
+                        translate.negate();
+                        translate.add(dstCorner.getOrdinate(dstIndex));
+
+                        matrix.setNumber(dstIndex, srcIndex,       scale);
+                        matrix.setNumber(dstIndex, srcAxes.length, translate);
+                    } else {
+                        matrix.setElement(dstIndex, srcIndex, same ? +1 : -1);
                     }
-                    matrix.setElement(dstIndex, srcIndex,       scale);
-                    matrix.setElement(dstIndex, srcAxes.length, translate);
                 }
             }
             if (!hasFound) {
@@ -332,9 +342,9 @@ public final class Matrices extends Stat
      *   └     ┘   └              ┘   └     ┘
      * }
      *
-     * @param  srcEnvelope The source envelope.
-     * @param  dstEnvelope The destination envelope.
-     * @return The transform from the given source envelope to target envelope.
+     * @param  srcEnvelope  the source envelope.
+     * @param  dstEnvelope  the destination envelope.
+     * @return the transform from the given source envelope to target envelope.
      *
      * @see #createTransform(AxisDirection[], AxisDirection[])
      * @see #createTransform(Envelope, AxisDirection[], Envelope, AxisDirection[])
@@ -409,10 +419,10 @@ public final class Matrices extends Stat
      *   └    ┘   └         ┘   └    ┘
      * }
      *
-     * @param  srcAxes The ordered sequence of axis directions for source coordinate system.
-     * @param  dstAxes The ordered sequence of axis directions for destination coordinate system.
-     * @return The transform from the given source axis directions to the given target axis directions.
-     * @throws IllegalArgumentException If {@code dstAxes} contains at least one axis not found in {@code srcAxes},
+     * @param  srcAxes  the ordered sequence of axis directions for source coordinate system.
+     * @param  dstAxes  the ordered sequence of axis directions for destination coordinate system.
+     * @return the transform from the given source axis directions to the given target axis directions.
+     * @throws IllegalArgumentException if {@code dstAxes} contains at least one axis not found in {@code srcAxes},
      *         or if some colinear axes were found.
      *
      * @see #createTransform(Envelope, Envelope)
@@ -469,15 +479,15 @@ public final class Matrices extends Stat
      * }
      * </div>
      *
-     * @param  srcEnvelope The source envelope.
-     * @param  srcAxes     The ordered sequence of axis directions for source coordinate system.
-     * @param  dstEnvelope The destination envelope.
-     * @param  dstAxes     The ordered sequence of axis directions for destination coordinate system.
-     * @return The transform from the given source envelope and axis directions
+     * @param  srcEnvelope  the source envelope.
+     * @param  srcAxes      the ordered sequence of axis directions for source coordinate system.
+     * @param  dstEnvelope  the destination envelope.
+     * @param  dstAxes      the ordered sequence of axis directions for destination coordinate system.
+     * @return the transform from the given source envelope and axis directions
      *         to the given envelope and target axis directions.
-     * @throws MismatchedDimensionException If an envelope {@linkplain Envelope#getDimension() dimension} does not
+     * @throws MismatchedDimensionException if an envelope {@linkplain Envelope#getDimension() dimension} does not
      *         match the length of the axis directions sequence.
-     * @throws IllegalArgumentException If {@code dstAxes} contains at least one axis not found in {@code srcAxes},
+     * @throws IllegalArgumentException if {@code dstAxes} contains at least one axis not found in {@code srcAxes},
      *         or if some colinear axes were found.
      *
      * @see #createTransform(Envelope, Envelope)
@@ -531,8 +541,8 @@ public final class Matrices extends Stat
      * The inverse of the matrix created by this method will put {@link Double#NaN} values in the extra dimensions.
      * Other dimensions will work as expected.
      *
-     * @param  sourceDimensions The number of dimensions in source coordinates.
-     * @param  selectedDimensions The 0-based indices of source ordinate values to keep.
+     * @param  sourceDimensions    the number of dimensions in source coordinates.
+     * @param  selectedDimensions  the 0-based indices of source ordinate values to keep.
      *         The length of this array will be the number of dimensions in target coordinates.
      * @return An affine transform matrix keeping only the given source dimensions, and discarding all others.
      * @throws IllegalArgumentException if a value of {@code selectedDimensions} is lower than 0
@@ -607,10 +617,10 @@ public final class Matrices extends Stat
      * }
      * </div>
      *
-     * @param  firstAffectedOrdinate The lowest index of the affected ordinates.
-     * @param  subMatrix The matrix to use for affected ordinates.
-     * @param  numTrailingOrdinates Number of trailing ordinates to pass through.
-     * @return A matrix for the same transform than the given matrix,
+     * @param  firstAffectedOrdinate  the lowest index of the affected ordinates.
+     * @param  subMatrix              the matrix to use for affected ordinates.
+     * @param  numTrailingOrdinates   number of trailing ordinates to pass through.
+     * @return a matrix for the same transform than the given matrix,
      *         augmented with leading and trailing pass-through coordinates.
      *
      * @see org.apache.sis.referencing.operation.DefaultMathTransformFactory#createPassThroughTransform(int, MathTransform, int)
@@ -761,8 +771,8 @@ public final class Matrices extends Stat
      * and {@value org.apache.sis.referencing.operation.matrix.Matrix4#SIZE} inclusive, the returned matrix is
      * usually an instance of one of {@link Matrix1} … {@link Matrix4} subtypes.</div>
      *
-     * @param matrix The matrix to copy, or {@code null}.
-     * @return A copy of the given matrix, or {@code null} if the given matrix was null.
+     * @param  matrix  the matrix to copy, or {@code null}.
+     * @return a copy of the given matrix, or {@code null} if the given matrix was null.
      *
      * @see MatrixSIS#clone()
      * @see MatrixSIS#castOrCopy(Matrix)
@@ -790,8 +800,8 @@ public final class Matrices extends Stat
      * Returns an unmodifiable view of the given matrix. The returned matrix is immutable
      * only if the given {@code matrix} is not modified anymore after this method call.
      *
-     * @param matrix The matrix for which to get an unmodifiable view, or {@code null}.
-     * @return A unmodifiable view of the given matrix, or {@code null} if the given matrix was null.
+     * @param  matrix  the matrix for which to get an unmodifiable view, or {@code null}.
+     * @return a unmodifiable view of the given matrix, or {@code null} if the given matrix was null.
      *
      * @since 0.6
      */
@@ -807,9 +817,9 @@ public final class Matrices extends Stat
      * Returns a new matrix which is the result of multiplying the first matrix with the second one.
      * In other words, returns {@code m1} × {@code m2}.
      *
-     * @param  m1 The first matrix to multiply.
-     * @param  m2 The second matrix to multiply.
-     * @return The result of {@code m1} × {@code m2}.
+     * @param  m1  the first matrix to multiply.
+     * @param  m2  the second matrix to multiply.
+     * @return the result of {@code m1} × {@code m2}.
      * @throws MismatchedMatrixSizeException if the number of columns in {@code m1} is not equals to the
      *         number of rows in {@code m2}.
      *
@@ -831,8 +841,8 @@ public final class Matrices extends Stat
     /**
      * Returns the inverse of the given matrix.
      *
-     * @param  matrix The matrix to inverse, or {@code null}.
-     * @return The inverse of this matrix, or {@code null} if the given matrix was null.
+     * @param  matrix  the matrix to inverse, or {@code null}.
+     * @return the inverse of this matrix, or {@code null} if the given matrix was null.
      * @throws NoninvertibleMatrixException if the given matrix is not invertible.
      *
      * @see MatrixSIS#inverse()
@@ -856,7 +866,7 @@ public final class Matrices extends Stat
      * A transform is affine if the matrix is square and its last row contains
      * only zeros, except in the last column which contains 1.
      *
-     * @param matrix The matrix to test.
+     * @param  matrix  the matrix to test.
      * @return {@code true} if the matrix represents an affine transform.
      *
      * @see MatrixSIS#isAffine()
@@ -874,7 +884,7 @@ public final class Matrices extends Stat
      * This method returns {@code true} if the given matrix {@linkplain #isAffine(Matrix) is affine}
      * and differs from the identity matrix only in the last column.
      *
-     * @param matrix The matrix to test.
+     * @param  matrix  the matrix to test.
      * @return {@code true} if the matrix represents a translation.
      *
      * @since 0.7
@@ -906,8 +916,8 @@ public final class Matrices extends Stat
      * errors. In case of doubt, it is often safer to use the strict {@link MatrixSIS#isIdentity()} method instead
      * than this one.</p>
      *
-     * @param  matrix The matrix to test for identity.
-     * @param  tolerance The tolerance value, or 0 for a strict comparison.
+     * @param  matrix     the matrix to test for identity.
+     * @param  tolerance  the tolerance value, or 0 for a strict comparison.
      * @return {@code true} if this matrix is close to the identity matrix given the tolerance threshold.
      *
      * @see MatrixSIS#isIdentity()
@@ -924,7 +934,7 @@ public final class Matrices extends Stat
                 if (i == j) {
                     e--;
                 }
-                if (!(Math.abs(e) <= tolerance)) {  // Uses '!' in order to catch NaN values.
+                if (!(Math.abs(e) <= tolerance)) {              // Uses '!' in order to catch NaN values.
                     return false;
                 }
             }
@@ -947,13 +957,13 @@ public final class Matrices extends Stat
      * and <var>v2</var><sub>j,i</sub> to compare, the tolerance threshold is scaled by
      * {@code max(abs(v1), abs(v2))}. Otherwise the threshold is used as-is.
      *
-     * @param  m1       The first matrix to compare, or {@code null}.
-     * @param  m2       The second matrix to compare, or {@code null}.
-     * @param  epsilon  The tolerance value.
-     * @param  relative If {@code true}, then the tolerance value is relative to the magnitude
-     *         of the matrix elements being compared.
-     * @return {@code true} if the values of the two matrix do not differ by a quantity
-     *         greater than the given tolerance threshold.
+     * @param  m1        the first matrix to compare, or {@code null}.
+     * @param  m2        the second matrix to compare, or {@code null}.
+     * @param  epsilon   the tolerance value.
+     * @param  relative  if {@code true}, then the tolerance value is relative to the magnitude
+     *                   of the matrix elements being compared.
+     * @return {@code true} if the values of the two matrix do not differ by a quantity greater
+     *         than the given tolerance threshold.
      *
      * @see MatrixSIS#equals(Matrix, double)
      */
@@ -1010,9 +1020,9 @@ public final class Matrices extends Stat
      *       For more control, use {@link #equals(Matrix, Matrix, double, boolean)} instead.</li>
      * </ul>
      *
-     * @param  m1  The first matrix to compare, or {@code null}.
-     * @param  m2  The second matrix to compare, or {@code null}.
-     * @param  mode The strictness level of the comparison.
+     * @param  m1    the first matrix to compare, or {@code null}.
+     * @param  m2    the second matrix to compare, or {@code null}.
+     * @param  mode  the strictness level of the comparison.
      * @return {@code true} if both matrices are equal.
      *
      * @see MatrixSIS#equals(Object, ComparisonMode)
@@ -1059,8 +1069,8 @@ public final class Matrices extends Stat
      * reference system. In addition, the last column is often a translation vector having a magnitude very
      * different than the other columns.</div>
      *
-     * @param  matrix The matrix for which to get a string representation.
-     * @return A string representation of the given matrix.
+     * @param  matrix  the matrix for which to get a string representation.
+     * @return a string representation of the given matrix.
      */
     public static String toString(final Matrix matrix) {
         final int numRow = matrix.getNumRow();
@@ -1077,7 +1087,7 @@ public final class Matrices extends Stat
          * Create now the string representation of all matrix elements and measure the width
          * of the integer field and the fraction field, then the total width of each column.
          */
-        int spacing = 1; // Spacing is 1 before the first column only, then SPACING for other columns.
+        int spacing = 1;                // Spacing is 1 before the first column only, then SPACING for other columns.
         for (int i=0; i<numCol; i++) {
             for (int j=0; j<numRow; j++) {
                 final int flatIndex = j*numCol + i;
@@ -1091,7 +1101,7 @@ public final class Matrices extends Stat
                  */
                 if (value == -1 || value == 0 || value == +1) {
                     noFractionDigits[flatIndex] = true;
-                    width = spacing + element.length() - 2; // The -2 is for ignoring the trailing ".0"
+                    width = spacing + element.length() - 2;           // The -2 is for ignoring the trailing ".0"
                     widthBeforeFraction[i] = (byte) Math.max(widthBeforeFraction[i], width);
                 } else {
                     /*
@@ -1128,7 +1138,7 @@ public final class Matrices extends Stat
                 elements[flatIndex] = element;
             }
             totalWidth += columnWidth[i];
-            spacing = SPACING; // Specing before all columns after the first one.
+            spacing = SPACING;                              // Spacing before all columns after the first one.
         }
         /*
          * Now append the formatted elements with the appropriate amount of spaces before each value,
@@ -1147,9 +1157,9 @@ public final class Matrices extends Stat
                 int spaces, s = element.lastIndexOf('.');
                 if (s >= 0) {
                     if (hasDecimalSeparator[i]) s++;
-                    spaces = widthBeforeFraction[i] - s; // Number of spaces for alignment on the decimal separator
+                    spaces = widthBeforeFraction[i] - s;    // Number of spaces for alignment on the decimal separator
                 } else {
-                    spaces = columnWidth[i] - width; // Number of spaces for right alignment (NaN or ∞ cases)
+                    spaces = columnWidth[i] - width;        // Number of spaces for right alignment (NaN or ∞ cases)
                 }
                 buffer.append(CharSequences.spaces(spaces)).append(element);
                 if (s >= 0) {
@@ -1159,7 +1169,7 @@ public final class Matrices extends Stat
                      */
                     s += maximumFractionDigits[i] - width;
                     if (noFractionDigits[flatIndex]) {
-                        buffer.setLength(buffer.length() - 2); // Erase the trailing ".0"
+                        buffer.setLength(buffer.length() - 2);      // Erase the trailing ".0"
                         s += 2;
                     } else {
                         int n = Math.min(s, maximumPaddingZeros[flatIndex]);



Mime
View raw message