sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1583522 - in /sis/branches/JDK6: ./ core/sis-referencing/src/main/java/org/apache/sis/core/ core/sis-referencing/src/main/java/org/apache/sis/distance/ core/sis-referencing/src/main/java/org/apache/sis/geometry/ core/sis-referencing/src/te...
Date Tue, 01 Apr 2014 03:31:41 GMT
Author: desruisseaux
Date: Tue Apr  1 03:31:41 2014
New Revision: 1583522

URL: http://svn.apache.org/r1583522
Log:
Merge from the JDK7 branch.

Added:
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/distance/LatLonPointRadius.java
      - copied unchanged from r1583520, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/distance/LatLonPointRadius.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/distance/
      - copied from r1583520, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/distance/
Removed:
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/core/
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/core/
Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/converter/PathConverterTest.java
    sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/package-info.java
    sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTree.java

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK7:r1579487-1583520

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java?rev=1583522&r1=1583521&r2=1583522&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
[UTF-8] Tue Apr  1 03:31:41 2014
@@ -86,8 +86,8 @@ import org.apache.sis.internal.jdk7.Obje
  *   <li>{@link #getSpan(int)}</li>
  *   <li>{@link #toSimpleEnvelopes()}</li>
  *   <li>{@link #contains(DirectPosition)}</li>
- *   <li>{@link #contains(Envelope, boolean)}</li>
- *   <li>{@link #intersects(Envelope, boolean)}</li>
+ *   <li>{@link #contains(Envelope)}</li>
+ *   <li>{@link #intersects(Envelope)}</li>
  * </ul>
  * </td></tr></table>
  *
@@ -110,7 +110,7 @@ import org.apache.sis.internal.jdk7.Obje
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3 (derived from geotk-2.4)
- * @version 0.3
+ * @version 0.4
  * @module
  */
 public abstract class AbstractEnvelope implements Envelope, Emptiable {
@@ -728,9 +728,7 @@ public abstract class AbstractEnvelope i
 
     /**
      * Returns {@code true} if this envelope completely encloses the specified envelope.
-     * If one or more edges from the specified envelope coincide with an edge from this
-     * envelope, then this method returns {@code true} only if {@code edgesInclusive}
-     * is {@code true}.
+     * All edges of this envelope are considered inclusive.
      *
      * {@section Pre-conditions}
      * This method assumes that the specified envelope uses the same CRS than this envelope.
@@ -740,17 +738,38 @@ public abstract class AbstractEnvelope i
      * For every cases illustrated below, the yellow box is considered completely enclosed
      * in the blue envelope:
      *
-     * <center><img src="doc-files/Contains.png"></center>
+     * <img src="doc-files/Contains.png">
+     *
+     * @param  envelope The envelope to test for inclusion.
+     * @return {@code true} if this envelope completely encloses the specified one.
+     * @throws MismatchedDimensionException if the specified envelope doesn't have the expected
dimension.
+     * @throws AssertionError If assertions are enabled and the envelopes have mismatched
CRS.
+     *
+     * @see #intersects(Envelope)
+     * @see #equals(Envelope, double, boolean)
+     *
+     * @since 0.4
+     */
+    public final boolean contains(final Envelope envelope) throws MismatchedDimensionException
{
+        return contains(envelope, true);
+    }
+
+    /**
+     * Returns {@code true} if this envelope completely encloses the specified envelope.
+     * If one or more edges from the specified envelope coincide with an edge from this
+     * envelope, then this method returns {@code true} only if {@code edgesInclusive}
+     * is {@code true}.
+     *
+     * <p>This method is subject to the same pre-conditions than {@link #contains(Envelope)},
+     * and handles envelopes spanning the anti-meridian in the same way.</p>
      *
      * @param  envelope The envelope to test for inclusion.
      * @param  edgesInclusive {@code true} if this envelope edges are inclusive.
      * @return {@code true} if this envelope completely encloses the specified one.
-     * @throws MismatchedDimensionException if the specified envelope doesn't have
-     *         the expected dimension.
+     * @throws MismatchedDimensionException if the specified envelope doesn't have the expected
dimension.
      * @throws AssertionError If assertions are enabled and the envelopes have mismatched
CRS.
      *
      * @see #intersects(Envelope, boolean)
-     * @see #equals(Envelope, double, boolean)
      */
     public boolean contains(final Envelope envelope, final boolean edgesInclusive) throws
MismatchedDimensionException {
         ensureNonNull("envelope", envelope);
@@ -824,8 +843,7 @@ public abstract class AbstractEnvelope i
 
     /**
      * Returns {@code true} if this envelope intersects the specified envelope.
-     * If one or more edges from the specified envelope coincide with an edge from this envelope,
-     * then this method returns {@code true} only if {@code edgesInclusive} is {@code true}.
+     * All edges of this envelope are considered inclusive.
      *
      * {@section Pre-conditions}
      * This method assumes that the specified envelope uses the same CRS than this envelope.
@@ -835,6 +853,28 @@ public abstract class AbstractEnvelope i
      * This method can handle envelopes spanning the anti-meridian.
      *
      * @param  envelope The envelope to test for intersection.
+     * @return {@code true} if this envelope intersects the specified one.
+     * @throws MismatchedDimensionException if the specified envelope doesn't have the expected
dimension.
+     * @throws AssertionError If assertions are enabled and the envelopes have mismatched
CRS.
+     *
+     * @see #contains(Envelope, boolean)
+     * @see #equals(Envelope, double, boolean)
+     *
+     * @since 0.4
+     */
+    public boolean intersects(final Envelope envelope) throws MismatchedDimensionException
{
+        return intersects(envelope, true);
+    }
+
+    /**
+     * Returns {@code true} if this envelope intersects the specified envelope.
+     * If one or more edges from the specified envelope coincide with an edge from this envelope,
+     * then this method returns {@code true} only if {@code edgesInclusive} is {@code true}.
+     *
+     * <p>This method is subject to the same pre-conditions than {@link #intersects(Envelope)},
+     * and handles envelopes spanning the anti-meridian in the same way.</p>
+     *
+     * @param  envelope The envelope to test for intersection.
      * @param  edgesInclusive {@code true} if this envelope edges are inclusive.
      * @return {@code true} if this envelope intersects the specified one.
      * @throws MismatchedDimensionException if the specified envelope doesn't have the expected
dimension.
@@ -950,8 +990,8 @@ public abstract class AbstractEnvelope i
      *         axis length, or {@code false} if it is an absolute value.
      * @return {@code true} if the given object is equal to this envelope up to the given
tolerance value.
      *
-     * @see #contains(Envelope, boolean)
-     * @see #intersects(Envelope, boolean)
+     * @see #contains(Envelope)
+     * @see #intersects(Envelope)
      */
     public boolean equals(final Envelope other, final double eps, final boolean epsIsRelative)
{
         ensureNonNull("other", other);

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java?rev=1583522&r1=1583521&r2=1583522&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
[UTF-8] Tue Apr  1 03:31:41 2014
@@ -674,7 +674,7 @@ public class Envelope2D extends Rectangl
      *
      * {@section Spanning the anti-meridian of a Geographic CRS}
      * This method supports anti-meridian spanning in the same way than
-     * {@link AbstractEnvelope#contains(Envelope, boolean)}.
+     * {@link AbstractEnvelope#contains(Envelope)}.
      *
      * @param  rect The rectangle to test for inclusion.
      * @return {@code true} if this envelope completely encloses the specified rectangle.
@@ -696,7 +696,7 @@ public class Envelope2D extends Rectangl
      *
      * {@section Spanning the anti-meridian of a Geographic CRS}
      * This method supports anti-meridian spanning in the same way than
-     * {@link AbstractEnvelope#contains(Envelope, boolean)}.
+     * {@link AbstractEnvelope#contains(Envelope)}.
      *
      * @param  rx The <var>x</var> ordinate of the lower corner of the rectangle
to test for inclusion.
      * @param  ry The <var>y</var> ordinate of the lower corner of the rectangle
to test for inclusion.
@@ -743,7 +743,7 @@ public class Envelope2D extends Rectangl
      *
      * {@section Spanning the anti-meridian of a Geographic CRS}
      * This method supports anti-meridian spanning in the same way than
-     * {@link AbstractEnvelope#intersects(Envelope, boolean)}.
+     * {@link AbstractEnvelope#intersects(Envelope)}.
      *
      * @param  rect The rectangle to test for intersection.
      * @return {@code true} if this envelope intersects the specified rectangle.
@@ -765,7 +765,7 @@ public class Envelope2D extends Rectangl
      *
      * {@section Spanning the anti-meridian of a Geographic CRS}
      * This method supports anti-meridian spanning in the same way than
-     * {@link AbstractEnvelope#intersects(Envelope, boolean)}.
+     * {@link AbstractEnvelope#intersects(Envelope)}.
      *
      * @param  rx The <var>x</var> ordinate of the lower corner of the rectangle
to test for intersection.
      * @param  ry The <var>y</var> ordinate of the lower corner of the rectangle
to test for intersection.

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java?rev=1583522&r1=1583521&r2=1583522&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
[UTF-8] Tue Apr  1 03:31:41 2014
@@ -83,8 +83,8 @@ import static org.apache.sis.math.MathFu
  *   <li>{@link #isEmpty()}</li>
  *   <li>{@link #toSimpleEnvelopes() toSimpleEnvelopes()}</li>
  *   <li>{@link #contains(DirectPosition) contains(DirectPosition)}</li>
- *   <li>{@link #contains(Envelope, boolean) contains(Envelope, boolean)}</li>
- *   <li>{@link #intersects(Envelope, boolean) intersects(Envelope, boolean)}</li>
+ *   <li>{@link #contains(Envelope) contains(Envelope)}</li>
+ *   <li>{@link #intersects(Envelope) intersects(Envelope)}</li>
  *   <li>{@link #intersect(Envelope)}</li>
  *   <li>{@link #add(Envelope)}</li>
  *   <li>{@link #add(DirectPosition)}</li>
@@ -665,7 +665,7 @@ public class GeneralEnvelope extends Arr
                 ordinates[iUpper] = Double.POSITIVE_INFINITY;
             }
         }
-        assert contains(envelope, true) || isEmpty() || hasNaN(envelope) : this;
+        assert contains(envelope) || isEmpty() || hasNaN(envelope) : this;
     }
 
     /**
@@ -796,7 +796,7 @@ public class GeneralEnvelope extends Arr
             if (max1 < max0) ordinates[iUpper] = max1;
         }
         // Tests only if the interection result is non-empty.
-        assert isEmpty() || AbstractEnvelope.castOrCopy(envelope).contains(this, true) :
this;
+        assert isEmpty() || AbstractEnvelope.castOrCopy(envelope).contains(this) : this;
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1583522&r1=1583521&r2=1583522&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] Tue Apr  1 03:31:41 2014
@@ -100,6 +100,8 @@ import org.junit.BeforeClass;
     org.apache.sis.geometry.Envelope2DTest.class,
     org.apache.sis.geometry.EnvelopesTest.class,
 
+    org.apache.sis.distance.LatLonPointRadiusTest.class, // Pending refactoring in a geometry
package.
+
     org.apache.sis.test.integration.ReferencingInMetadataTest.class
 })
 public final strictfp class ReferencingTestSuite extends TestSuite {

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/converter/PathConverterTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/converter/PathConverterTest.java?rev=1583522&r1=1583521&r2=1583522&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/converter/PathConverterTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/converter/PathConverterTest.java
[UTF-8] Tue Apr  1 03:31:41 2014
@@ -138,7 +138,7 @@ public final strictfp class PathConverte
     @Test
     @PlatformDependent
     public void testURI_File() throws URISyntaxException {
-        PathConverterTest.assumeUnixRoot();
+        assumeUnixRoot();
         final ObjectConverter<URI,File> c = PathConverter.URIFile.INSTANCE;
         runInvertibleConversion(c, new URI("file:/home/user/index.txt"), new File("/home/user/index.txt"));
         assertSerializedEquals(c);
@@ -177,7 +177,7 @@ public final strictfp class PathConverte
     @Test
     @PlatformDependent
     public void testURL_File() throws MalformedURLException {
-        PathConverterTest.assumeUnixRoot();
+        assumeUnixRoot();
         final ObjectConverter<URL,File> c = PathConverter.URLFile.INSTANCE;
         runInvertibleConversion(c, new URL("file:/home/user/index.txt"), new File("/home/user/index.txt"));
         assertSerializedEquals(c);

Modified: sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/package-info.java?rev=1583522&r1=1583521&r2=1583522&view=diff
==============================================================================
--- sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/package-info.java
[UTF-8] Tue Apr  1 03:31:41 2014
@@ -20,9 +20,9 @@
  * attributes in a NetCDF file. The mapping is defined in the following web pages:
  *
  * <ul>
- *   <li><a href="https://geo-ide.noaa.gov/wiki/index.php?title=NetCDF_Attribute_Convention_for_Dataset_Discovery">NetCDF
- *       Attribute Convention for Dataset Discovery</a> wiki</li>
- *   <li><a href="http://ngdc.noaa.gov/metadata/published/xsl/nciso2.0/UnidataDD2MI.xsl">UnidataDD2MI.xsl</a>
file</li>
+ *   <li><a href="http://wiki.esipfed.org/index.php/Category:Attribute_Conventions_Dataset_Discovery">NetCDF
+ *       Attribute Convention for Dataset Discovery</a> version 1.0.</li>
+ *   <li><a href="http://ngdc.noaa.gov/metadata/published/xsl/nciso2.0/UnidataDD2MI.xsl">UnidataDD2MI.xsl</a>
file.</li>
  * </ul>
  *
  * The NetCDF attributes recognized by this package are listed in the

Modified: sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTree.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTree.java?rev=1583522&r1=1583521&r2=1583522&view=diff
==============================================================================
--- sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTree.java
[UTF-8] (original)
+++ sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTree.java
[UTF-8] Tue Apr  1 03:31:41 2014
@@ -24,9 +24,9 @@ import java.util.List;
 
 //SIS imports
 import org.apache.sis.geometry.DirectPosition2D;
-import org.apache.sis.core.LatLonPointRadius;
 import org.apache.sis.geometry.Envelope2D;
 import org.apache.sis.distance.DistanceUtils;
+import org.apache.sis.distance.LatLonPointRadius;
 
 /**
  * Implementation of Quad Tree Index. Insertion algorithm implemented based on



Mime
View raw message