sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1728058 - in /sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql: EPSGDataAccess.java package-info.java
Date Tue, 02 Feb 2016 09:42:42 GMT
Author: desruisseaux
Date: Tue Feb  2 09:42:42 2016
New Revision: 1728058

URL: http://svn.apache.org/viewvc?rev=1728058&view=rev
Log:
Renamed EPSGDataAccess.parent as 'owner'. Javadoc updates.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java?rev=1728058&r1=1728057&r2=1728058&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
[UTF-8] Tue Feb  2 09:42:42 2016
@@ -268,9 +268,10 @@ public class EPSGDataAccess extends Geod
     private transient boolean quiet;
 
     /**
-     * The {@code ConcurrentAuthorityFactory} that supply caching for all {@code createFoo(String)}
methods.
+     * The {@code ConcurrentAuthorityFactory} that created this Data Access Object (DAO).
+     * The owner supplies caching for all {@code createFoo(String)} methods.
      */
-    protected final EPSGFactory parent;
+    protected final EPSGFactory owner;
 
     /**
      * The connection to the EPSG database. This connection is specified at {@linkplain #EPSGDataAccess
construction time}
@@ -306,7 +307,7 @@ public class EPSGDataAccess extends Geod
     protected EPSGDataAccess(final EPSGFactory parent, final Connection connection, final
SQLTranslator translator) {
         ArgumentChecks.ensureNonNull("connection", connection);
         ArgumentChecks.ensureNonNull("translator", translator);
-        this.parent     = parent;
+        this.owner     = parent;
         this.connection = connection;
         this.translator = translator;
         this.namespace  = parent.nameFactory.createNameSpace(
@@ -321,7 +322,7 @@ public class EPSGDataAccess extends Geod
      */
     @Override
     public Locale getLocale() {
-        return parent.getLocale();
+        return owner.getLocale();
     }
 
     /**
@@ -1010,11 +1011,11 @@ addURIs:    for (int i=0; ; i++) {
         properties.clear();
         GenericName gn = null;
         final Locale locale = getLocale();
-        final Citation authority = parent.getAuthority();
+        final Citation authority = owner.getAuthority();
         final InternationalString edition = authority.getEdition();
         final String version = (edition != null) ? edition.toString() : null;
         if (name != null) {
-            gn = parent.nameFactory.createGenericName(namespace, Constants.EPSG, name);
+            gn = owner.nameFactory.createGenericName(namespace, Constants.EPSG, name);
             properties.put("name", gn);
             properties.put(NamedIdentifier.CODE_KEY,      name);
             properties.put(NamedIdentifier.VERSION_KEY,   version);
@@ -1057,12 +1058,11 @@ addURIs:    for (int i=0; ; i++) {
                     if (naming != null) {
                         ns = namingSystems.get(naming);
                         if (ns == null) {
-                            ns = parent.nameFactory.createNameSpace(
-                                 parent.nameFactory.createLocalName(null, naming), null);
+                            ns = owner.nameFactory.createNameSpace(owner.nameFactory.createLocalName(null,
naming), null);
                             namingSystems.put(naming, ns);
                         }
                     }
-                    aliases.add(parent.nameFactory.createLocalName(ns, alias));
+                    aliases.add(owner.nameFactory.createLocalName(ns, alias));
                 }
             }
         }
@@ -1070,7 +1070,7 @@ addURIs:    for (int i=0; ; i++) {
             properties.put(IdentifiedObject.ALIAS_KEY, aliases.toArray(new GenericName[aliases.size()]));
         }
         properties.put(AbstractIdentifiedObject.LOCALE_KEY, locale);
-        properties.put(ReferencingServices.MT_FACTORY, parent.mtFactory);
+        properties.put(ReferencingServices.MT_FACTORY, owner.mtFactory);
         return properties;
     }
 
@@ -1091,7 +1091,7 @@ addURIs:    for (int i=0; ; i++) {
     {
         final Map<String,Object> properties = createProperties(table, name, code, remarks,
deprecated);
         if (domainCode != null) {
-            properties.put(Datum.DOMAIN_OF_VALIDITY_KEY, parent.createExtent(domainCode));
+            properties.put(Datum.DOMAIN_OF_VALIDITY_KEY, owner.createExtent(domainCode));
         }
         properties.put(Datum.SCOPE_KEY, scope);
         return properties;
@@ -1249,7 +1249,7 @@ addURIs:    for (int i=0; ; i++) {
                  * Note: Do not invoke 'createProperties' now, even if we have all required
informations,
                  *       because the 'properties' map is going to overwritten by calls to
'createDatum', etc.
                  */
-                final CRSFactory crsFactory = parent.crsFactory;
+                final CRSFactory crsFactory = owner.crsFactory;
                 final CoordinateReferenceSystem crs;
                 switch (type.toLowerCase(Locale.US)) {
                     /* ----------------------------------------------------------------------
@@ -1260,17 +1260,17 @@ addURIs:    for (int i=0; ; i++) {
                      * ----------------------------------------------------------------------
*/
                     case "geographic 2d":
                     case "geographic 3d": {
-                        final EllipsoidalCS cs = parent.createEllipsoidalCS(getString(code,
result, 8));
+                        final EllipsoidalCS cs = owner.createEllipsoidalCS(getString(code,
result, 8));
                         final String datumCode = getOptionalString(result, 9);
                         final GeodeticDatum datum;
                         if (datumCode != null) {
-                            datum = parent.createGeodeticDatum(datumCode);
+                            datum = owner.createGeodeticDatum(datumCode);
                         } else {
                             final String geoCode = getString(code, result, 10, 9);
                             result.close();     // Must be closed before call to createGeographicCRS(String)
                             ensureNoCycle(GeographicCRS.class, epsg);
                             try {
-                                datum = parent.createGeographicCRS(geoCode).getDatum();
+                                datum = owner.createGeographicCRS(geoCode).getDatum();
                             } finally {
                                 endOfRecursivity(GeographicCRS.class, epsg);
                             }
@@ -1292,9 +1292,9 @@ addURIs:    for (int i=0; ; i++) {
                         result.close();      // Must be closed before call to createFoo(String)
                         ensureNoCycle(ProjectedCRS.class, epsg);
                         try {
-                            final CartesianCS   cs       = parent.createCartesianCS(csCode);
-                            final GeographicCRS baseCRS  = parent.createGeographicCRS(geoCode);
-                            final CoordinateOperation op = parent.createCoordinateOperation(opCode);
+                            final CartesianCS   cs       = owner.createCartesianCS(csCode);
+                            final GeographicCRS baseCRS  = owner.createGeographicCRS(geoCode);
+                            final CoordinateOperation op = owner.createCoordinateOperation(opCode);
                             if (op instanceof Conversion) {
                                 crs = crsFactory.createProjectedCRS(createProperties("Coordinate
Reference System",
                                         name, epsg, area, scope, remarks, deprecated), baseCRS,
(Conversion) op, cs);
@@ -1310,8 +1310,8 @@ addURIs:    for (int i=0; ; i++) {
                      *   VERTICAL CRS
                      * ----------------------------------------------------------------------
*/
                     case "vertical": {
-                        final VerticalCS    cs    = parent.createVerticalCS   (getString(code,
result, 8));
-                        final VerticalDatum datum = parent.createVerticalDatum(getString(code,
result, 9));
+                        final VerticalCS    cs    = owner.createVerticalCS   (getString(code,
result, 8));
+                        final VerticalDatum datum = owner.createVerticalDatum(getString(code,
result, 9));
                         crs = crsFactory.createVerticalCRS(createProperties("Coordinate Reference
System",
                                 name, epsg, area, scope, remarks, deprecated), datum, cs);
                         break;
@@ -1324,8 +1324,8 @@ addURIs:    for (int i=0; ; i++) {
                      * ----------------------------------------------------------------------
*/
                     case "time":
                     case "temporal": {
-                        final TimeCS        cs    = parent.createTimeCS       (getString(code,
result, 8));
-                        final TemporalDatum datum = parent.createTemporalDatum(getString(code,
result, 9));
+                        final TimeCS        cs    = owner.createTimeCS       (getString(code,
result, 8));
+                        final TemporalDatum datum = owner.createTemporalDatum(getString(code,
result, 9));
                         crs = crsFactory.createTemporalCRS(createProperties("Coordinate Reference
System",
                                 name, epsg, area, scope, remarks, deprecated), datum, cs);
                         break;
@@ -1343,8 +1343,8 @@ addURIs:    for (int i=0; ; i++) {
                         final CoordinateReferenceSystem crs1, crs2;
                         ensureNoCycle(CompoundCRS.class, epsg);
                         try {
-                            crs1 = parent.createCoordinateReferenceSystem(code1);
-                            crs2 = parent.createCoordinateReferenceSystem(code2);
+                            crs1 = owner.createCoordinateReferenceSystem(code1);
+                            crs2 = owner.createCoordinateReferenceSystem(code2);
                         } finally {
                             endOfRecursivity(CompoundCRS.class, epsg);
                         }
@@ -1357,8 +1357,8 @@ addURIs:    for (int i=0; ; i++) {
                      *   GEOCENTRIC CRS
                      * ----------------------------------------------------------------------
*/
                     case "geocentric": {
-                        final CoordinateSystem cs = parent.createCoordinateSystem(getString(code,
result, 8));
-                        final GeodeticDatum datum = parent.createGeodeticDatum   (getString(code,
result, 9));
+                        final CoordinateSystem cs = owner.createCoordinateSystem(getString(code,
result, 8));
+                        final GeodeticDatum datum = owner.createGeodeticDatum   (getString(code,
result, 9));
                         final Map<String,Object> properties = createProperties("Coordinate
Reference System",
                                 name, epsg, area, scope, remarks, deprecated);
                         if (cs instanceof CartesianCS) {
@@ -1375,8 +1375,8 @@ addURIs:    for (int i=0; ; i++) {
                      *   ENGINEERING CRS
                      * ----------------------------------------------------------------------
*/
                     case "engineering": {
-                        final CoordinateSystem cs    = parent.createCoordinateSystem(getString(code,
result, 8));
-                        final EngineeringDatum datum = parent.createEngineeringDatum(getString(code,
result, 9));
+                        final CoordinateSystem cs    = owner.createCoordinateSystem(getString(code,
result, 8));
+                        final EngineeringDatum datum = owner.createEngineeringDatum(getString(code,
result, 9));
                         crs = crsFactory.createEngineeringCRS(createProperties("Coordinate
Reference System",
                                 name, epsg, area, scope, remarks, deprecated), datum, cs);
                         break;
@@ -1468,7 +1468,7 @@ addURIs:    for (int i=0; ; i++) {
                 } catch (NumberFormatException exception) {
                     unexpectedException("createDatum", exception);          // Not a fatal
error.
                 }
-                final DatumFactory datumFactory = parent.datumFactory;
+                final DatumFactory datumFactory = owner.datumFactory;
                 final Datum datum;
                 switch (type.toLowerCase(Locale.US)) {
                     /*
@@ -1478,8 +1478,8 @@ addURIs:    for (int i=0; ; i++) {
                      */
                     case "geodetic": {
                         properties = new HashMap<>(properties);         // Protect
from changes
-                        final Ellipsoid ellipsoid    = parent.createEllipsoid    (getString(code,
result, 10));
-                        final PrimeMeridian meridian = parent.createPrimeMeridian(getString(code,
result, 11));
+                        final Ellipsoid ellipsoid    = owner.createEllipsoid    (getString(code,
result, 10));
+                        final PrimeMeridian meridian = owner.createPrimeMeridian(getString(code,
result, 11));
                         final BursaWolfParameters[] param = createBursaWolfParameters(epsg);
                         if (param != null) {
                             properties.put(DefaultGeodeticDatum.BURSA_WOLF_KEY, param);
@@ -1615,7 +1615,7 @@ addURIs:    for (int i=0; ; i++) {
             final GeodeticDatum datum;
             ensureNoCycle(BursaWolfParameters.class, code);    // See comment at the begining
of this method.
             try {
-                datum = parent.createGeodeticDatum(String.valueOf(info.target));
+                datum = owner.createGeodeticDatum(String.valueOf(info.target));
             } finally {
                 endOfRecursivity(BursaWolfParameters.class, code);
             }
@@ -1632,7 +1632,7 @@ addURIs:    for (int i=0; ; i++) {
                     BursaWolfInfo.setBursaWolfParameter(bwp,
                             getInteger(info.operation, result, 1),
                             getDouble (info.operation, result, 2),
-                            parent.createUnit(getString(info.operation, result, 3)), locale);
+                            owner.createUnit(getString(info.operation, result, 3)), locale);
                 }
             }
             if (info.isFrameRotation()) {
@@ -1700,7 +1700,7 @@ addURIs:    for (int i=0; ; i++) {
                 final String  unitCode          = getString   (code, result, 6);
                 final String  remarks           = getOptionalString (result, 7);
                 final boolean deprecated        = getOptionalBoolean(result, 8);
-                final Unit<Length> unit         = parent.createUnit(unitCode).asType(Length.class);
+                final Unit<Length> unit         = owner.createUnit(unitCode).asType(Length.class);
                 final Map<String,Object> properties = createProperties("Ellipsoid",
name, epsg, remarks, deprecated);
                 final Ellipsoid ellipsoid;
                 if (Double.isNaN(inverseFlattening)) {
@@ -1710,7 +1710,7 @@ addURIs:    for (int i=0; ; i++) {
                         throw new FactoryDataException(error().getString(Errors.Keys.NullValueInTable_3,
code, column));
                     } else {
                         // We only have semiMinorAxis defined. It is OK
-                        ellipsoid = parent.datumFactory.createEllipsoid(properties, semiMajorAxis,
semiMinorAxis, unit);
+                        ellipsoid = owner.datumFactory.createEllipsoid(properties, semiMajorAxis,
semiMinorAxis, unit);
                     }
                 } else {
                     if (!Double.isNaN(semiMinorAxis)) {
@@ -1721,7 +1721,7 @@ addURIs:    for (int i=0; ; i++) {
                         record.setLoggerName(Loggers.CRS_FACTORY);
                         Logging.log(EPSGDataAccess.class, "createEllipsoid", record);
                     }
-                    ellipsoid = parent.datumFactory.createFlattenedSphere(properties, semiMajorAxis,
inverseFlattening, unit);
+                    ellipsoid = owner.datumFactory.createFlattenedSphere(properties, semiMajorAxis,
inverseFlattening, unit);
                 }
                 returnValue = ensureSingleton(ellipsoid, returnValue, code);
             }
@@ -1780,8 +1780,8 @@ addURIs:    for (int i=0; ; i++) {
                 final String  unitCode   = getString   (code, result, 4);
                 final String  remarks    = getOptionalString (result, 5);
                 final boolean deprecated = getOptionalBoolean(result, 6);
-                final Unit<Angle> unit = parent.createUnit(unitCode).asType(Angle.class);
-                final PrimeMeridian primeMeridian = parent.datumFactory.createPrimeMeridian(
+                final Unit<Angle> unit = owner.createUnit(unitCode).asType(Angle.class);
+                final PrimeMeridian primeMeridian = owner.datumFactory.createPrimeMeridian(
                         createProperties("Prime Meridian", name, epsg, remarks, deprecated),
longitude, unit);
                 returnValue = ensureSingleton(primeMeridian, returnValue, code);
             }
@@ -1919,7 +1919,7 @@ addURIs:    for (int i=0; ; i++) {
                 final boolean deprecated = getOptionalBoolean(result, 6);
                 final CoordinateSystemAxis[] axes = createCoordinateSystemAxes(epsg, dimension);
                 final Map<String,Object> properties = createProperties("Coordinate
System", name, epsg, remarks, deprecated);   // Must be after axes.
-                final CSFactory csFactory = parent.csFactory;
+                final CSFactory csFactory = owner.csFactory;
                 CoordinateSystem cs = null;
                 switch (type.toLowerCase(Locale.US)) {
                     case "ellipsoidal": {
@@ -2052,7 +2052,7 @@ addURIs:    for (int i=0; ; i++) {
                      * If 'i' is out of bounds, an exception will be thrown after the loop.
                      * We do not want to thrown an ArrayIndexOutOfBoundsException here.
                      */
-                    axes[i] = parent.createCoordinateSystemAxis(axis);
+                    axes[i] = owner.createCoordinateSystemAxis(axis);
                 }
                 ++i;
             }
@@ -2113,9 +2113,8 @@ addURIs:    for (int i=0; ; i++) {
                     throw new FactoryDataException(exception.getLocalizedMessage(), exception);
                 }
                 final AxisName an = getAxisName(nameCode);
-                final CoordinateSystemAxis axis = parent.csFactory.createCoordinateSystemAxis(
-                        createProperties("Coordinate Axis", an.name, epsg, an.description,
false),
-                        abbreviation, direction, parent.createUnit(unit));
+                final CoordinateSystemAxis axis = owner.csFactory.createCoordinateSystemAxis(createProperties("Coordinate
Axis", an.name, epsg, an.description, false),
+                        abbreviation, direction, owner.createUnit(unit));
                 returnValue = ensureSingleton(axis, returnValue, code);
             }
         } catch (SQLException exception) {
@@ -2299,7 +2298,7 @@ addURIs:    for (int i=0; ; i++) {
                         if (element != null) {
                             valueDomain = MeasurementRange.create(Double.NEGATIVE_INFINITY,
false,
                                     Double.POSITIVE_INFINITY, false,
-                                    parent.createUnit(element));
+                                    owner.createUnit(element));
                         }
                     } else {
                         type = Double.class;
@@ -2338,7 +2337,7 @@ addURIs:    for (int i=0; ; i++) {
                 " ORDER BY SORT_ORDER", method))
         {
             while (result.next()) {
-                descriptors.add(parent.createParameterDescriptor(getString(method, result,
1)));
+                descriptors.add(owner.createParameterDescriptor(getString(method, result,
1)));
             }
         }
         return descriptors.toArray(new ParameterDescriptor<?>[descriptors.size()]);
@@ -2385,7 +2384,7 @@ addURIs:    for (int i=0; ; i++) {
                 } else {
                     reference = null;
                     final String unitCode = getOptionalString(result, 4);
-                    unit = (unitCode != null) ? parent.createUnit(unitCode) : null;
+                    unit = (unitCode != null) ? owner.createUnit(unitCode) : null;
                 }
                 final ParameterValue<?> param;
                 try {
@@ -2563,7 +2562,7 @@ addURIs:    for (int i=0; ; i++) {
                     final int sourceDimensions, targetDimensions;
                     final CoordinateReferenceSystem sourceCRS, targetCRS;
                     if (sourceCode != null) {
-                        sourceCRS = parent.createCoordinateReferenceSystem(sourceCode);
+                        sourceCRS = owner.createCoordinateReferenceSystem(sourceCode);
                         sourceDimensions = sourceCRS.getCoordinateSystem().getDimension();
                     } else {
                         sourceCRS = null;
@@ -2571,7 +2570,7 @@ addURIs:    for (int i=0; ; i++) {
                         isDimensionKnown = false;
                     }
                     if (targetCode != null) {
-                        targetCRS = parent.createCoordinateReferenceSystem(targetCode);
+                        targetCRS = owner.createCoordinateReferenceSystem(targetCode);
                         targetDimensions = targetCRS.getCoordinateSystem().getDimension();
                     } else {
                         targetCRS = null;
@@ -2589,7 +2588,7 @@ addURIs:    for (int i=0; ; i++) {
                         method      = null;
                         parameters  = null;
                     } else {
-                        method = parent.createOperationMethod(methodCode.toString());
+                        method = owner.createOperationMethod(methodCode.toString());
                         if (isDimensionKnown) {
                             method = DefaultOperationMethod.redimension(method, sourceDimensions,
targetDimensions);
                         }
@@ -2618,7 +2617,7 @@ addURIs:    for (int i=0; ; i++) {
                      * (usually to be used later as part of a ProjectedCRS creation).
                      */
                     final CoordinateOperation operation;
-                    final CoordinateOperationFactory copFactory = parent.copFactory;
+                    final CoordinateOperationFactory copFactory = owner.copFactory;
                     if (isConversion && (sourceCRS == null || targetCRS == null))
{
                         operation = copFactory.createDefiningConversion(opProperties, method,
parameters);
                     } else if (isConcatenated) {
@@ -2643,7 +2642,7 @@ addURIs:    for (int i=0; ; i++) {
                         ensureNoCycle(CoordinateOperation.class, epsg);
                         try {
                             for (int i=0; i<operations.length; i++) {
-                                operations[i] = parent.createCoordinateOperation(codes.get(i));
+                                operations[i] = owner.createCoordinateOperation(codes.get(i));
                             }
                         } finally {
                             endOfRecursivity(CoordinateOperation.class, epsg);
@@ -2661,7 +2660,7 @@ addURIs:    for (int i=0; ; i++) {
                          * GeoAPI method can not handle Molodensky transform because it does
not give the target datum).
                          */
                         final MathTransform mt;
-                        final MathTransformFactory mtFactory = parent.mtFactory;
+                        final MathTransformFactory mtFactory = owner.mtFactory;
                         if (mtFactory instanceof DefaultMathTransformFactory) {
                             DefaultMathTransformFactory.Context context = new DefaultMathTransformFactory.Context();
                             context.setSource(sourceCRS);
@@ -2738,7 +2737,7 @@ addURIs:    for (int i=0; ; i++) {
         ArgumentChecks.ensureNonNull("sourceCRS", sourceCRS);
         ArgumentChecks.ensureNonNull("targetCRS", targetCRS);
         final String label = sourceCRS + " ⇨ " + targetCRS;
-        final CoordinateOperationSet set = new CoordinateOperationSet(parent);
+        final CoordinateOperationSet set = new CoordinateOperationSet(owner);
         try {
             final int[] pair = toPrimaryKeys(null, null, null, sourceCRS, targetCRS);
             boolean searchTransformations = false;
@@ -2815,7 +2814,7 @@ addURIs:    for (int i=0; ; i++) {
          * Creates a new finder.
          */
         Finder() {
-            super(parent);
+            super(owner);
         }
 
         /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java?rev=1728058&r1=1728057&r2=1728058&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java
[UTF-8] Tue Feb  2 09:42:42 2016
@@ -38,7 +38,7 @@
  * A widely-used factory is the <a href="http://www.epsg.org">EPSG geodetic dataset</a>.
  * EPSG codes are numerical identifiers.
  * For example {@code "EPSG::4326"} is the EPSG identifier for the <cite>"WGS 84"</cite>
geographic CRS.
- * However, the Apache SIS implementation accepts names as well as numeric identifiers.
+ * As an extension, the Apache SIS implementation accepts names as well as numeric identifiers.
  * For example {@code createProjectedCRS("NTF (Paris) / Lambert zone II")} and {@code createProjectedCRS("27572")}
  * both fetch the same object. However names may be ambiguous since the same name may be
used for more than one object.
  * This is the case of <cite>"WGS 84"</cite> for example. If such an ambiguity
is found, an exception will be thrown.



Mime
View raw message