sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1466461 - in /sis/branches/JDK7: sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/ sis-referencing/src/main/java/org/apache/sis/geometry/ sis-referencing/src/test/java/org/apache/sis/geometry/
Date Wed, 10 Apr 2013 12:57:15 GMT
Author: desruisseaux
Date: Wed Apr 10 12:57:15 2013
New Revision: 1466461

URL: http://svn.apache.org/r1466461
Log:
Renamed AbstractEnvelope.isNull() as isAllNaN() for clarity.

Modified:
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
    sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
    sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
    sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
    sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java?rev=1466461&r1=1466460&r2=1466461&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
[UTF-8] Wed Apr 10 12:57:15 2013
@@ -471,7 +471,7 @@ public class DefaultGeographicBoundingBo
      *
      * @return {@code true} if this metadata does not define any bound value.
      *
-     * @see org.apache.sis.geometry.AbstractEnvelope#isNull()
+     * @see org.apache.sis.geometry.AbstractEnvelope#isAllNaN()
      */
     @Override
     public synchronized boolean isEmpty() {

Modified: sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java?rev=1466461&r1=1466460&r2=1466461&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
[UTF-8] Wed Apr 10 12:57:15 2013
@@ -498,8 +498,8 @@ public abstract class AbstractEnvelope i
     /**
      * Determines whether or not this envelope is empty. An envelope is non-empty only if
it has
      * at least one {@linkplain #getDimension() dimension}, and the {@linkplain #getSpan(int)
span}
-     * is greater than 0 along all dimensions. Note that a non-empty envelope is always
-     * non-{@linkplain #isNull() null}, but the converse is not always true.
+     * is greater than 0 along all dimensions. Note that {@link #isAllNaN()} always returns
+     * {@code false} for a non-empty envelope, but the converse is not always true.
      *
      * @return {@code true} if this envelope is empty.
      *
@@ -516,28 +516,32 @@ public abstract class AbstractEnvelope i
                 return true;
             }
         }
-        assert !isNull() : this;
+        assert !isAllNaN() : this;
         return false;
     }
 
     /**
      * Returns {@code false} if at least one ordinate value is not {@linkplain Double#NaN
NaN}.
-     * This {@code isNull()} check is a little bit different than the {@link #isEmpty()}
check
+     * This {@code isAllNaN()} check is a little bit different than the {@link #isEmpty()}
check
      * since it returns {@code false} for a partially initialized envelope, while {@code
isEmpty()}
      * returns {@code false} only after all dimensions have been initialized. More specifically,
      * the following rules apply:
      *
      * <ul>
-     *   <li>If {@code isNull() == true}, then {@code isEmpty() == true}</li>
-     *   <li>If {@code isEmpty() == false}, then {@code isNull() == false}</li>
+     *   <li>If {@code isAllNaN() == true}, then {@code isEmpty() == true}</li>
+     *   <li>If {@code isEmpty() == false}, then {@code isAllNaN() == false}</li>
      *   <li>The converse of the above-cited rules are not always true.</li>
      * </ul>
      *
+     * Note that a all-NaN envelope can still have a non-null
+     * {@linkplain #getCoordinateReferenceSystem() coordinate reference system}.
+     *
      * @return {@code true} if this envelope has NaN values.
      *
-     * @see GeneralEnvelope#setToNull()
+     * @see GeneralEnvelope#setToNaN()
+     * @see org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox#isEmpty()
      */
-    public boolean isNull() {
+    public boolean isAllNaN() {
         final int dimension = getDimension();
         for (int i=0; i<dimension; i++) {
             if (!Double.isNaN(getLower(i)) || !Double.isNaN(getUpper(i))) {

Modified: sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java?rev=1466461&r1=1466460&r2=1466461&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
[UTF-8] Wed Apr 10 12:57:15 2013
@@ -431,7 +431,7 @@ scanNumber: while ((i += Character.charC
                 }
             }
         }
-        assert !isNull() : this;
+        assert !isAllNaN() : this;
         return false;
     }
 
@@ -439,7 +439,7 @@ scanNumber: while ((i += Character.charC
      * {@inheritDoc}
      */
     @Override
-    public boolean isNull() {
+    public boolean isAllNaN() {
         for (int i=0; i<ordinates.length; i++) {
             if (!Double.isNaN(ordinates[i])) {
                 return false;

Modified: sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java?rev=1466461&r1=1466460&r2=1466461&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
[UTF-8] Wed Apr 10 12:57:15 2013
@@ -354,11 +354,11 @@ public class GeneralEnvelope extends Arr
      * The {@linkplain #getCoordinateReferenceSystem() coordinate reference system}
      * (if any) stay unchanged.
      *
-     * @see #isNull()
+     * @see #isAllNaN()
      */
-    public void setToNull() {
+    public void setToNaN() {
         Arrays.fill(ordinates, Double.NaN);
-        assert isNull() : this;
+        assert isAllNaN() : this;
     }
 
     /**

Modified: sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java?rev=1466461&r1=1466460&r2=1466461&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java
[UTF-8] Wed Apr 10 12:57:15 2013
@@ -493,7 +493,7 @@ public final strictfp class GeneralEnvel
          */
         final GeneralEnvelope e1 = new GeneralEnvelope(4);
         assertTrue  (e1.isEmpty());
-        assertFalse (e1.isNull());
+        assertFalse (e1.isAllNaN());
         assertEquals(e1.getLowerCorner(), e1.getUpperCorner());
         /*
          * Initializes with arbitrary coordinate values.
@@ -502,7 +502,7 @@ public final strictfp class GeneralEnvel
         for (int i=e1.getDimension(); --i>=0;) {
             e1.setRange(i, i*5 + 2, i*6 + 5);
         }
-        assertFalse(e1.isNull ());
+        assertFalse(e1.isAllNaN ());
         assertFalse(e1.isEmpty());
         assertFalse(e1.getLowerCorner().equals(e1.getUpperCorner()));
         /*



Mime
View raw message