You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2013/10/18 22:08:51 UTC
svn commit: r1533614 - in
/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing:
./ datum/
Author: desruisseaux
Date: Fri Oct 18 20:08:50 2013
New Revision: 1533614
URL: http://svn.apache.org/r1533614
Log:
Removed the convenience constructors. The original intend was to make direct instantiation of 'DefaultFoo' types easier,
for example by avoiding the need to invoke Collections.singletonMap(DefaultFoo.NAME_KEY, name) in the common case where
the user just wants to specify a name and no other properties. However experience has shown that it still not convenient
enough. We should probably provide a 'GeodeticObjectBuilder' instead.
Modified:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java?rev=1533614&r1=1533613&r2=1533614&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java [UTF-8] Fri Oct 18 20:08:50 2013
@@ -189,6 +189,8 @@ public class AbstractReferenceSystem ext
* {@linkplain #getDomainOfValidity() domain of validity} and the {@linkplain #getScope() scope}
* properties are ignored, in addition to other ignored properties documented in the
* {@linkplain AbstractIdentifiedObject#hashCode(ComparisonMode) super-class}.
+ *
+ * @return The hash code value for the given comparison mode.
*/
@Override
public int hashCode(final ComparisonMode mode) throws IllegalArgumentException {
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java?rev=1533614&r1=1533613&r2=1533614&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java [UTF-8] Fri Oct 18 20:08:50 2013
@@ -17,7 +17,6 @@
package org.apache.sis.referencing.datum;
import java.util.Map;
-import java.util.Collections;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import javax.measure.quantity.Length;
@@ -232,24 +231,6 @@ public class DefaultEllipsoid extends Ab
}
/**
- * Creates a new ellipsoid using the specified name and axis length in metres.
- * This is a convenience method for {@link #createEllipsoid(Map, double, double, Unit) createEllipsoid(Map, …)}
- * with a map containing only the {@value org.opengis.referencing.IdentifiedObject#NAME_KEY} property
- * and the unit of measurement fixed to {@link SI#METRE}.
- *
- * @param name The ellipsoid name.
- * @param semiMajorAxis The equatorial radius in metres.
- * @param semiMinorAxis The polar radius in metres.
- * @return An ellipsoid with the given axis length.
- */
- public static DefaultEllipsoid createEllipsoid(final String name,
- final double semiMajorAxis,
- final double semiMinorAxis)
- {
- return createEllipsoid(Collections.singletonMap(NAME_KEY, name), semiMajorAxis, semiMinorAxis, SI.METRE);
- }
-
- /**
* Creates a new ellipsoid using the specified properties and axis length.
* The properties map is given unchanged to the
* {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}.
@@ -274,24 +255,6 @@ public class DefaultEllipsoid extends Ab
}
/**
- * Creates a new ellipsoid using the specified name, axis length in metres and inverse flattening value. This is
- * a convenience method for {@link #createFlattenedSphere(Map, double, double, Unit) createFlattenedSphere(Map, …)}
- * with a map containing only the {@value org.opengis.referencing.IdentifiedObject#NAME_KEY} property and the unit
- * of measurement fixed to {@link SI#METRE}.
- *
- * @param name The ellipsoid name.
- * @param semiMajorAxis The equatorial radius in metres.
- * @param inverseFlattening The inverse flattening value.
- * @return An ellipsoid with the given axis length.
- */
- public static DefaultEllipsoid createFlattenedSphere(final String name,
- final double semiMajorAxis,
- final double inverseFlattening)
- {
- return createFlattenedSphere(Collections.singletonMap(NAME_KEY, name), semiMajorAxis, inverseFlattening, SI.METRE);
- }
-
- /**
* Creates a new ellipsoid using the specified properties, axis length and inverse flattening value.
* The properties map is given unchanged to the
* {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}.
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java?rev=1533614&r1=1533613&r2=1533614&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java [UTF-8] Fri Oct 18 20:08:50 2013
@@ -17,7 +17,6 @@
package org.apache.sis.referencing.datum;
import java.util.Map;
-import java.util.Collections;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
import org.opengis.referencing.datum.EngineeringDatum;
@@ -47,17 +46,6 @@ public class DefaultEngineeringDatum ext
private static final long serialVersionUID = 1498304918725248637L;
/**
- * Creates an engineering datum from a name. This is a convenience constructor for
- * {@link #DefaultEngineeringDatum(Map)}
- * with a map containing only the {@value org.opengis.referencing.IdentifiedObject#NAME_KEY} property.
- *
- * @param name The datum name.
- */
- public DefaultEngineeringDatum(final String name) {
- this(Collections.singletonMap(NAME_KEY, name));
- }
-
- /**
* Creates an engineering datum from the given properties. The properties map is given
* unchanged to the {@linkplain AbstractDatum#AbstractDatum(Map) super-class constructor}.
*
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java?rev=1533614&r1=1533613&r2=1533614&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java [UTF-8] Fri Oct 18 20:08:50 2013
@@ -20,7 +20,6 @@ import java.util.Map;
import java.util.Set;
import java.util.Arrays;
import java.util.HashSet;
-import java.util.Collections;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@@ -30,7 +29,6 @@ import org.opengis.referencing.datum.Geo
import org.opengis.referencing.operation.Matrix;
import org.opengis.referencing.operation.OperationMethod;
import org.apache.sis.referencing.EPSG;
-import org.apache.sis.referencing.GeodeticObjects;
import org.apache.sis.referencing.operation.matrix.MatrixSIS;
import org.apache.sis.referencing.operation.matrix.NoninvertibleMatrixException;
import org.apache.sis.internal.util.CollectionsExt;
@@ -124,19 +122,6 @@ public class DefaultGeodeticDatum extend
private final BursaWolfParameters[] bursaWolf;
/**
- * Creates a geodetic datum using the Greenwich prime meridian. This is a convenience constructor for
- * {@link #DefaultGeodeticDatum(Map, Ellipsoid, PrimeMeridian) DefaultGeodeticDatum(Map, …)}
- * with a map containing only the {@value org.opengis.referencing.IdentifiedObject#NAME_KEY} property
- * and the {@link #getPrimeMeridian() prime meridian} fixed to Greenwich.
- *
- * @param name The datum name.
- * @param ellipsoid The ellipsoid.
- */
- public DefaultGeodeticDatum(final String name, final Ellipsoid ellipsoid) {
- this(Collections.singletonMap(NAME_KEY, name), ellipsoid, GeodeticObjects.WGS84.primeMeridian());
- }
-
- /**
* Creates a geodetic datum from the given properties. The properties map is given
* unchanged to the {@link AbstractDatum#AbstractDatum(Map) super-class constructor}.
* In addition to the properties documented in the parent constructor,
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java?rev=1533614&r1=1533613&r2=1533614&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java [UTF-8] Fri Oct 18 20:08:50 2013
@@ -17,7 +17,6 @@
package org.apache.sis.referencing.datum;
import java.util.Map;
-import java.util.Collections;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
import org.opengis.referencing.datum.ImageDatum;
@@ -57,18 +56,6 @@ public class DefaultImageDatum extends A
private final PixelInCell pixelInCell;
/**
- * Creates an image datum from a name. This is a convenience constructor for
- * {@link #DefaultImageDatum(Map, PixelInCell) DefaultImageDatum(Map, …)}
- * with a map containing only the {@value org.opengis.referencing.IdentifiedObject#NAME_KEY} property.
- *
- * @param name The datum name.
- * @param pixelInCell the way the image grid is associated with the image data attributes.
- */
- public DefaultImageDatum(final String name, final PixelInCell pixelInCell) {
- this(Collections.singletonMap(NAME_KEY, name), pixelInCell);
- }
-
- /**
* Creates an image datum from the given properties. The properties map is given
* unchanged to the {@linkplain AbstractDatum#AbstractDatum(Map) super-class constructor}.
*
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java?rev=1533614&r1=1533613&r2=1533614&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java [UTF-8] Fri Oct 18 20:08:50 2013
@@ -17,7 +17,6 @@
package org.apache.sis.referencing.datum;
import java.util.Map;
-import java.util.Collections;
import javax.measure.unit.Unit;
import javax.measure.unit.NonSI;
import javax.measure.quantity.Angle;
@@ -97,20 +96,6 @@ public class DefaultPrimeMeridian extend
private final Unit<Angle> angularUnit;
/**
- * Creates a prime meridian from a name and Greenwich longitude in degrees. This is a convenience
- * constructor for {@link #DefaultPrimeMeridian(Map, double, Unit) DefaultPrimeMeridian(Map, …)}
- * with a map containing only the {@value org.opengis.referencing.IdentifiedObject#NAME_KEY} property,
- * and with the unit of measurement fixed to {@link NonSI#DEGREE_ANGLE}.
- *
- * @param name The datum name.
- * @param greenwichLongitude The longitude value relative to the Greenwich Meridian, in degrees.
- * Positive values are east of Greenwich.
- */
- public DefaultPrimeMeridian(final String name, final double greenwichLongitude) {
- this(Collections.singletonMap(NAME_KEY, name), greenwichLongitude, NonSI.DEGREE_ANGLE);
- }
-
- /**
* Creates a prime meridian from the given properties. The properties map is given
* unchanged to the {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map)
* super-class constructor}.
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java?rev=1533614&r1=1533613&r2=1533614&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java Fri Oct 18 20:08:50 2013
@@ -18,7 +18,6 @@ package org.apache.sis.referencing.datum
import java.util.Date;
import java.util.Map;
-import java.util.Collections;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
import org.opengis.referencing.datum.TemporalDatum;
@@ -80,18 +79,6 @@ public class DefaultTemporalDatum extend
private final long origin;
/**
- * Creates a temporal datum from a name. This is a convenience constructor for
- * {@link #DefaultTemporalDatum(Map, Date) DefaultTemporalDatum(Map, â¦)}
- * with a map containing only the {@value org.opengis.referencing.IdentifiedObject#NAME_KEY} property.
- *
- * @param name The datum name.
- * @param origin The date and time origin of this temporal datum.
- */
- public DefaultTemporalDatum(final String name, final Date origin) {
- this(Collections.singletonMap(NAME_KEY, name), origin);
- }
-
- /**
* Creates a temporal datum from the given properties. The properties map is given
* unchanged to the {@linkplain AbstractDatum#AbstractDatum(Map) super-class constructor}.
*
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java?rev=1533614&r1=1533613&r2=1533614&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java [UTF-8] Fri Oct 18 20:08:50 2013
@@ -17,7 +17,6 @@
package org.apache.sis.referencing.datum;
import java.util.Map;
-import java.util.Collections;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@@ -56,7 +55,7 @@ import java.util.Objects;
* <li>Create a {@code VerticalDatum} by invoking the {@code createVerticalDatum(…)}
* method defined in the {@link org.opengis.referencing.datum.DatumFactory} interface.</li>
* <li>Create a {@code DefaultVerticalDatum} by invoking the
- * {@linkplain #DefaultVerticalDatum(Map, Date) constructor}.</li>
+ * {@linkplain #DefaultVerticalDatum(Map, VerticalDatumType) constructor}.</li>
* </ol>
*
* <b>Example:</b> the following code gets a vertical datum for height above the geoid:
@@ -88,18 +87,6 @@ public class DefaultVerticalDatum extend
private VerticalDatumType type;
/**
- * Creates a vertical datum from a name. This is a convenience constructor for
- * {@link #DefaultVerticalDatum(Map, VerticalDatumType) DefaultVerticalDatum(Map, …)}
- * with a map containing only the {@value org.opengis.referencing.IdentifiedObject#NAME_KEY} property.
- *
- * @param name The datum name.
- * @param type The type of this vertical datum.
- */
- public DefaultVerticalDatum(final String name, final VerticalDatumType type) {
- this(Collections.singletonMap(NAME_KEY, name), type);
- }
-
- /**
* Creates a vertical datum from the given properties. The properties map is given
* unchanged to the {@linkplain AbstractDatum#AbstractDatum(Map) super-class constructor}.
*