sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1519473 - in /sis: branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/ branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/ branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/ bra...
Date Mon, 02 Sep 2013 17:02:01 GMT
Author: desruisseaux
Date: Mon Sep  2 17:02:00 2013
New Revision: 1519473

URL: http://svn.apache.org/r1519473
Log:
Ported DefaultPrimeMeridian.

Added:
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
      - copied, changed from r1519302, sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/NumericsTest.java
      - copied, changed from r1519302, sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java
    sis/ip-review/DefaultPrimeMeridian.xhtml   (with props)
    sis/ip-review/rev/10796/DefaultPrimeMeridian.xhtml   (with props)
    sis/ip-review/rev/20874/DefaultPrimeMeridian.xhtml   (with props)
Modified:
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java?rev=1519473&r1=1519472&r2=1519473&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
[UTF-8] Mon Sep  2 17:02:00 2013
@@ -50,7 +50,7 @@ import org.apache.sis.xml.IdentifiedObje
 
 import static org.apache.sis.metadata.PropertyComparator.*;
 import static org.apache.sis.metadata.ValueExistencePolicy.isNullOrEmpty;
-import static org.apache.sis.internal.util.Utilities.floatEpsilonEqual;
+import static org.apache.sis.internal.util.Numerics.floatEpsilonEqual;
 import static org.apache.sis.internal.util.CollectionsExt.snapshot;
 import static org.apache.sis.internal.util.CollectionsExt.modifiableCopy;
 import static org.apache.sis.util.collection.Containers.hashMapCapacity;

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java?rev=1519473&r1=1519472&r2=1519473&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
[UTF-8] Mon Sep  2 17:02:00 2013
@@ -38,7 +38,7 @@ import org.apache.sis.util.ComparisonMod
 import org.apache.sis.util.resources.Errors;
 
 import static java.lang.Double.doubleToLongBits;
-import static org.apache.sis.internal.util.Utilities.SIGN_BIT_MASK;
+import static org.apache.sis.internal.util.Numerics.SIGN_BIT_MASK;
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 import static org.apache.sis.util.ArgumentChecks.ensureDimensionMatches;
 import static org.apache.sis.util.StringBuilders.trimFractionalPart;

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java?rev=1519473&r1=1519472&r2=1519473&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
[UTF-8] Mon Sep  2 17:02:00 2013
@@ -19,6 +19,7 @@ package org.apache.sis.io.wkt;
 import javax.measure.unit.SI;
 import javax.measure.unit.Unit;
 import javax.measure.quantity.Angle;
+import javax.measure.quantity.Quantity;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.referencing.cs.CartesianCS;
 import org.opengis.referencing.cs.CoordinateSystem;
@@ -221,7 +222,7 @@ public enum Convention {
      * which means that the angular units are inferred from the context as required by the
      * <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html#PRIMEM">WKT
specification</a>.
      *
-     * @see ReferencingParser#getForcedAngularUnit()
+     * @see #getForcedUnit(Class)
      */
     final Unit<Angle> forcedAngularUnit;
 
@@ -241,9 +242,9 @@ public enum Convention {
      * Creates a new enumeration value.
      */
     private Convention(final Citation authority, final Unit<Angle> angularUnit, final
boolean unitUS) {
-        this.authority = authority;
+        this.authority         = authority;
         this.forcedAngularUnit = angularUnit;
-        this.unitUS = unitUS;
+        this.unitUS            = unitUS;
     }
 
     /**
@@ -258,6 +259,25 @@ public enum Convention {
     }
 
     /**
+     * If non-null, {@code PRIMEM} and {@code PARAMETER} values shall unconditionally use
the returned units.
+     * The standard value is {@code null}, which means that units are inferred from the context
as required by the
+     * <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html#PRIMEM">WKT
specification</a>.
+     * However some conventions ignore the above WKT specification and use hard-coded units
instead.
+     *
+     * @param  <T>       The compile-time type specified by the {@code quantity} argument.
+     * @param  quantity  The kind of quantity for which to get the unit.
+     *                   The most typical value for this argument is <code>{@linkplain
Angle}.class</code>.
+     * @return The unit to use for the given kind of quantity, or {@code null} for inferring
the unit in the standard way.
+     */
+    @SuppressWarnings("unchecked")
+    public <T extends Quantity> Unit<T> getForcedUnit(final Class<T> quantity)
{
+        if (quantity == Angle.class) {
+            return (Unit) forcedAngularUnit;
+        }
+        return null;
+    }
+
+    /**
      * Returns the convention for the organization, standard or project specified by the
given citation.
      *
      * @param  authority The organization, standard or project for which to get the convention,
or {@code null}.

Copied: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
(from r1519302, sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java?p2=sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java&p1=sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java&r1=1519302&r2=1519473&rev=1519473&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
[UTF-8] Mon Sep  2 17:02:00 2013
@@ -16,25 +16,22 @@
  */
 package org.apache.sis.internal.util;
 
-import java.util.Formatter;
-import java.util.FormattableFlags;
 import org.apache.sis.util.Static;
-import org.apache.sis.util.Classes;
-import org.apache.sis.util.CharSequences;
+import org.apache.sis.util.ComparisonMode;
 
-import static java.lang.Math.abs;
 import static java.lang.Math.max;
+import static java.lang.Math.abs;
 
 
 /**
- * Miscellaneous utilities which should not be put in public API.
+ * Miscellaneous utilities methods working on floating point numbers.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.00)
  * @version 0.4
  * @module
  */
-public final class Utilities extends Static {
+public final class Numerics extends Static {
     /**
      * Relative difference tolerated when comparing floating point numbers using
      * {@link org.apache.sis.util.ComparisonMode#APPROXIMATIVE}.
@@ -80,9 +77,44 @@ public final class Utilities extends Sta
     public static final long SIGN_BIT_MASK = Long.MIN_VALUE;
 
     /**
+     * A prime number used for hash code computation. Value 31 is often used because
+     * some modern compilers can optimize {@code x*31} as {@code (x << 5) - x}
+     * (Josh Bloch, <cite>Effective Java</cite>).
+     */
+    private static final int PRIME_NUMBER = 31;
+
+    /**
      * Do not allow instantiation of this class.
      */
-    private Utilities() {
+    private Numerics() {
+    }
+
+    /**
+     * Returns {@code true} if the given floats are equals. Positive and negative zero are
+     * considered different, while a NaN value is considered equal to all other NaN values.
+     *
+     * @param  o1 The first value to compare.
+     * @param  o2 The second value to compare.
+     * @return {@code true} if both values are equal.
+     *
+     * @see Float#equals(Object)
+     */
+    public static boolean equals(final float o1, final float o2) {
+        return Float.floatToIntBits(o1) == Float.floatToIntBits(o2);
+    }
+
+    /**
+     * Returns {@code true} if the given doubles are equals. Positive and negative zero are
+     * considered different, while a NaN value is considered equal to all other NaN values.
+     *
+     * @param  o1 The first value to compare.
+     * @param  o2 The second value to compare.
+     * @return {@code true} if both values are equal.
+     *
+     * @see Double#equals(Object)
+     */
+    public static boolean equals(final double o1, final double o2) {
+        return Double.doubleToLongBits(o1) == Double.doubleToLongBits(o2);
     }
 
     /**
@@ -102,6 +134,26 @@ public final class Utilities extends Sta
     }
 
     /**
+     * Returns {@code true} if the given values are approximatively equal given the comparison
mode.
+     *
+     * @param  v1 The first value to compare.
+     * @param  v2 The second value to compare.
+     * @param  mode The comparison mode to use for comparing the numbers.
+     * @return {@code true} If both values are approximatively equal.
+     */
+    public static boolean epsilonEqual(final double v1, final double v2, final ComparisonMode
mode) {
+        switch (mode) {
+            default: return equals(v1, v2);
+            case APPROXIMATIVE: return epsilonEqual(v1, v2);
+            case DEBUG: {
+                final boolean equal = epsilonEqual(v1, v2);
+                assert equal : "v1=" + v1 + " v2=" + v2 + " Δv=" + abs(v1-v2);
+                return equal;
+            }
+        }
+    }
+
+    /**
      * Returns {@code true} if the following objects are floating point numbers ({@link Float}
or
      * {@link Double} types) and approximatively equal. If the given object are not floating
point
      * numbers, then this method returns {@code false} unconditionally on the assumption
that
@@ -118,84 +170,38 @@ public final class Utilities extends Sta
     }
 
     /**
-     * Returns a string representation of an instance of the given class having the given
properties.
-     * This is a convenience method for implementation of {@link Object#toString()} methods
that are
-     * used mostly for debugging purpose.
-     *
-     * @param  classe     The class to format.
-     * @param  properties The (<var>key</var>=</var>value</var>)
pairs.
-     * @return A string representation of an instance of the given class having the given
properties.
-     *
-     * @since 0.4
-     */
-    public static String toString(final Class<?> classe, final Object... properties)
{
-        final StringBuffer buffer = new StringBuffer(32).append(Classes.getShortName(classe)).append('[');
-        boolean isNext = false;
-        for (int i=0; i<properties.length; i++) {
-            final Object value = properties[++i];
-            if (value != null) {
-                if (isNext) {
-                    buffer.append(", ");
-                }
-                buffer.append(properties[i-1]).append('=');
-                final boolean isText = (value instanceof CharSequence);
-                if (isText) buffer.append('“');
-                buffer.append(value);
-                if (isText) buffer.append('”');
-                isNext = true;
-            }
-        }
-        return buffer.append(']').toString();
+     * Alters the given seed with the hash code value computed from the given value.
+     *
+     * @param  value The value whose hash code to compute.
+     * @param  seed  The hash code value computed so far. If this method is invoked for the
first
+     *               field, then any arbitrary value (preferably different for each class)
is okay.
+     * @return An updated hash code value.
+     */
+    public static int hash(final float value, final int seed) {
+        return seed * PRIME_NUMBER + Float.floatToIntBits(value);
     }
 
     /**
-     * Formats the given character sequence to the given formatter. This method takes in
account
-     * the {@link FormattableFlags#UPPERCASE} and {@link FormattableFlags#LEFT_JUSTIFY} flags.
+     * Alters the given seed with the hash code value computed from the given value.
      *
-     * @param formatter The formatter in which to format the value.
-     * @param flags     The formatting flags.
-     * @param width     Minimal number of characters to write, padding with {@code ' '} if
necessary.
-     * @param precision Number of characters to keep before truncation, or -1 if no limit.
-     * @param value     The text to format.
-     */
-    public static void formatTo(final Formatter formatter, final int flags,
-            int width, int precision, String value)
-    {
-        final String format;
-        final Object[] args;
-        boolean isUpperCase = (flags & FormattableFlags.UPPERCASE) != 0;
-        if (isUpperCase && width > 0) {
-            // May change the string length in some locales.
-            value = value.toUpperCase(formatter.locale());
-            isUpperCase = false; // Because conversion has already been done.
-        }
-        int length = value.length();
-        if (precision >= 0) {
-            for (int i=0,n=0; i<length; i += n) {
-                if (--precision < 0) {
-                    // Found the amount of characters to keep. The 'n' variable can be
-                    // zero only if precision == 0, in which case the string is empty.
-                    if (n == 0) {
-                        value = "";
-                    } else {
-                        length = (i -= n) + 1;
-                        final StringBuilder buffer = new StringBuilder(length);
-                        value = buffer.append(value, 0, i).append('…').toString();
-                    }
-                    break;
-                }
-                n = Character.charCount(value.codePointAt(i));
-            }
-        }
-        // Double check since length() is faster than codePointCount(...).
-        if (width > length && (width -= value.codePointCount(0, length)) >
0) {
-            format = "%s%s";
-            args = new Object[] {value, value};
-            args[(flags & FormattableFlags.LEFT_JUSTIFY) != 0 ? 1 : 0] = CharSequences.spaces(width);
-        } else {
-            format = isUpperCase ? "%S" : "%s";
-            args = new Object[] {value};
-        }
-        formatter.format(format, args);
+     * @param  value The value whose hash code to compute.
+     * @param  seed  The hash code value computed so far. If this method is invoked for the
first
+     *               field, then any arbitrary value (preferably different for each class)
is okay.
+     * @return An updated hash code value.
+     */
+    public static int hash(final double value, final int seed) {
+        return hash(Double.doubleToLongBits(value), seed);
+    }
+
+    /**
+     * Alters the given seed with the hash code value computed from the given value.
+     *
+     * @param  value The value whose hash code to compute.
+     * @param  seed  The hash code value computed so far. If this method is invoked for the
first
+     *               field, then any arbitrary value (preferably different for each class)
is okay.
+     * @return An updated hash code value.
+     */
+    public static int hash(final long value, final int seed) {
+        return seed * PRIME_NUMBER + (((int) value) ^ ((int) (value >>> 32)));
     }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java?rev=1519473&r1=1519472&r2=1519473&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
[UTF-8] Mon Sep  2 17:02:00 2013
@@ -22,9 +22,6 @@ import org.apache.sis.util.Static;
 import org.apache.sis.util.Classes;
 import org.apache.sis.util.CharSequences;
 
-import static java.lang.Math.abs;
-import static java.lang.Math.max;
-
 
 /**
  * Miscellaneous utilities which should not be put in public API.
@@ -35,49 +32,6 @@ import static java.lang.Math.max;
  * @module
  */
 public final class Utilities extends Static {
-    /**
-     * Relative difference tolerated when comparing floating point numbers using
-     * {@link org.apache.sis.util.ComparisonMode#APPROXIMATIVE}.
-     *
-     * <p>Historically, this was the relative tolerance threshold for considering two
-     * matrixes as equal. This value has been determined empirically in order to allow
-     * {@link org.apache.sis.referencing.operation.transform.ConcatenatedTransform} to
-     * detect the cases where two {@link org.apache.sis.referencing.operation.transform.LinearTransform}
-     * are equal for practical purpose. This threshold can be used as below:</p>
-     *
-     * {@preformat java
-     *     Matrix m1 = ...;
-     *     Matrix m2 = ...;
-     *     if (Matrices.epsilonEqual(m1, m2, EQUIVALENT_THRESHOLD, true)) {
-     *         // Consider that matrixes are equal.
-     *     }
-     * }
-     *
-     * By extension, the same threshold value is used for comparing other floating point
values.
-     *
-     * @see org.apache.sis.internal.referencing.Utilities#LINEAR_TOLERANCE
-     * @see org.apache.sis.internal.referencing.Utilities#ANGULAR_TOLERANCE
-     */
-    public static final double COMPARISON_THRESHOLD = 1E-14;
-
-    /**
-     * Bit mask to isolate the sign bit of non-{@linkplain Double#isNaN(double) NaN} values
in a
-     * {@code double}. For any real value, the following code evaluate to 0 if the given
value is
-     * positive:
-     *
-     * {@preformat java
-     *     Double.doubleToRawLongBits(value) & SIGN_BIT_MASK;
-     * }
-     *
-     * Note that this idiom differentiates positive zero from negative zero.
-     * It should be used only when such difference matter.
-     *
-     * @see org.apache.sis.math.MathFunctions#isPositive(double)
-     * @see org.apache.sis.math.MathFunctions#isNegative(double)
-     * @see org.apache.sis.math.MathFunctions#isSameSign(double, double)
-     * @see org.apache.sis.math.MathFunctions#xorSign(double, double)
-     */
-    public static final long SIGN_BIT_MASK = Long.MIN_VALUE;
 
     /**
      * Do not allow instantiation of this class.
@@ -86,38 +40,6 @@ public final class Utilities extends Sta
     }
 
     /**
-     * Returns {@code true} if the given values are approximatively equal,
-     * up to the {@linkplain #COMPARISON_THRESHOLD comparison threshold}.
-     *
-     * @param  v1 The first value to compare.
-     * @param  v2 The second value to compare.
-     * @return {@code true} If both values are approximatively equal.
-     */
-    public static boolean epsilonEqual(final double v1, final double v2) {
-        final double threshold = COMPARISON_THRESHOLD * max(abs(v1), abs(v2));
-        if (threshold == Double.POSITIVE_INFINITY || Double.isNaN(threshold)) {
-            return Double.doubleToLongBits(v1) == Double.doubleToLongBits(v2);
-        }
-        return abs(v1 - v2) <= threshold;
-    }
-
-    /**
-     * Returns {@code true} if the following objects are floating point numbers ({@link Float}
or
-     * {@link Double} types) and approximatively equal. If the given object are not floating
point
-     * numbers, then this method returns {@code false} unconditionally on the assumption
that
-     * strict equality has already been checked before this method call.
-     *
-     * @param  v1 The first value to compare.
-     * @param  v2 The second value to compare.
-     * @return {@code true} If both values are real number and approximatively equal.
-     */
-    public static boolean floatEpsilonEqual(final Object v1, final Object v2) {
-        return (v1 instanceof Float || v1 instanceof Double) &&
-               (v2 instanceof Float || v2 instanceof Double) &&
-               epsilonEqual(((Number) v1).doubleValue(), ((Number) v2).doubleValue());
-    }
-
-    /**
      * Returns a string representation of an instance of the given class having the given
properties.
      * This is a convenience method for implementation of {@link Object#toString()} methods
that are
      * used mostly for debugging purpose.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java?rev=1519473&r1=1519472&r2=1519473&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
[UTF-8] Mon Sep  2 17:02:00 2013
@@ -27,7 +27,7 @@ import static java.lang.Float.intBitsToF
 import static java.lang.Float.floatToRawIntBits;
 import static java.lang.Double.longBitsToDouble;
 import static java.lang.Double.doubleToRawLongBits;
-import static org.apache.sis.internal.util.Utilities.SIGN_BIT_MASK;
+import static org.apache.sis.internal.util.Numerics.SIGN_BIT_MASK;
 
 
 /**

Copied: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/NumericsTest.java
(from r1519302, sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/NumericsTest.java?p2=sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/NumericsTest.java&p1=sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java&r1=1519302&r2=1519473&rev=1519473&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/NumericsTest.java
[UTF-8] Mon Sep  2 17:02:00 2013
@@ -22,19 +22,19 @@ import org.junit.Test;
 import static java.lang.Double.NaN;
 import static java.lang.Double.POSITIVE_INFINITY;
 import static java.lang.Double.NEGATIVE_INFINITY;
-import static org.apache.sis.internal.util.Utilities.*;
+import static org.apache.sis.internal.util.Numerics.*;
 import static org.apache.sis.test.Assert.*;
 
 
 /**
- * Tests the {@link Utilities} class.
+ * Tests the {@link Numerics} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
  * @version 0.4
  * @module
  */
-public final strictfp class UtilitiesTest extends TestCase {
+public final strictfp class NumericsTest extends TestCase {
     /**
      * Tests the {@link Utilities#epsilonEqual(double, double)} method.
      */
@@ -51,12 +51,4 @@ public final strictfp class UtilitiesTes
         assertTrue (epsilonEqual(-100, -100 + COMPARISON_THRESHOLD * 50));
         assertFalse(epsilonEqual( 100,  100 + COMPARISON_THRESHOLD * 150));
     }
-
-    /**
-     * Tests the {@link Utilities#toString(Class, Object[])} method.
-     */
-    @Test
-    public void testToString() {
-        assertEquals("Number[base=“decimal”, value=20]", Utilities.toString(Number.class,
"base", "decimal", "value", 20));
-    }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java?rev=1519473&r1=1519472&r2=1519473&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java
[UTF-8] Mon Sep  2 17:02:00 2013
@@ -19,10 +19,6 @@ package org.apache.sis.internal.util;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static java.lang.Double.NaN;
-import static java.lang.Double.POSITIVE_INFINITY;
-import static java.lang.Double.NEGATIVE_INFINITY;
-import static org.apache.sis.internal.util.Utilities.*;
 import static org.apache.sis.test.Assert.*;
 
 
@@ -36,23 +32,6 @@ import static org.apache.sis.test.Assert
  */
 public final strictfp class UtilitiesTest extends TestCase {
     /**
-     * Tests the {@link Utilities#epsilonEqual(double, double)} method.
-     */
-    @Test
-    public void testEpsilonEqual() {
-        assertTrue (epsilonEqual(POSITIVE_INFINITY, POSITIVE_INFINITY));
-        assertTrue (epsilonEqual(NEGATIVE_INFINITY, NEGATIVE_INFINITY));
-        assertFalse(epsilonEqual(POSITIVE_INFINITY, NEGATIVE_INFINITY));
-        assertFalse(epsilonEqual(POSITIVE_INFINITY, NaN));
-        assertTrue (epsilonEqual(NaN,               NaN));
-        assertFalse(epsilonEqual(   0,        COMPARISON_THRESHOLD / 2));
-        assertTrue (epsilonEqual(   1,    1 + COMPARISON_THRESHOLD / 2));
-        assertFalse(epsilonEqual(   1,    1 + COMPARISON_THRESHOLD * 2));
-        assertTrue (epsilonEqual(-100, -100 + COMPARISON_THRESHOLD * 50));
-        assertFalse(epsilonEqual( 100,  100 + COMPARISON_THRESHOLD * 150));
-    }
-
-    /**
      * Tests the {@link Utilities#toString(Class, Object[])} method.
      */
     @Test

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1519473&r1=1519472&r2=1519473&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
[UTF-8] Mon Sep  2 17:02:00 2013
@@ -57,6 +57,7 @@ import org.junit.BeforeClass;
     org.apache.sis.math.StatisticsTest.class,
     org.apache.sis.math.StatisticsFormatTest.class,
     org.apache.sis.internal.util.UtilitiesTest.class,
+    org.apache.sis.internal.util.NumericsTest.class,
     org.apache.sis.internal.jdk8.JDK8Test.class,
 
     // Collections.

Added: sis/ip-review/DefaultPrimeMeridian.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/DefaultPrimeMeridian.xhtml?rev=1519473&view=auto
==============================================================================
--- sis/ip-review/DefaultPrimeMeridian.xhtml (added)
+++ sis/ip-review/DefaultPrimeMeridian.xhtml Mon Sep  2 17:02:00 2013
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>DefaultPrimeMeridian history</title>
+    <style type="text/css" media="all">
+      @import url("./reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>DefaultPrimeMeridian history</h1>
+  <p>Click on the commit message for inspecting the <code>diff</code> and
how the code has been rewritten.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn log -r31996:1 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/datum/DefaultPrimeMeridian.java</code></blockquote>
+<table>
+  <tr>
+    <th>Rev.</th>
+    <th>Date</th>
+    <th>Author</th>
+    <th class="last">Message</th>
+  </tr>
+<tr><td class="rev">31000</td><td>2008-07-10</td><td>desruisseaux</td><td>Avoid
usage of 2 deprecated constructors from CRSFactory. Their replacement were tricky and required
more sophesticated code in ReferencingFactoryContainer.toGeodetic3D.</td></tr>
+<tr><td class="rev">30760</td><td>2008-06-18</td><td>desruisseaux</td><td>Upgrated
from JSR-108 to JSR-275 (GEOT-1266). Some opportunist javadoc fixes and @Override annotations
in the process.</td></tr>
+<tr><td class="rev">30641</td><td>2008-06-12</td><td>acuster</td><td>Copyright
headers: lib/referencing, this time with feeling (and the el in Toolkit)</td></tr>
+<tr><td class="rev">30521</td><td>2008-06-05</td><td>acuster</td><td>Copyright:
Update referencing headers</td></tr>
+<tr><td class="rev">30313</td><td>2008-05-16</td><td>desruisseaux</td><td>Changed
my mind about Utilities.shallowEquals(Object,Object) and renamed it as equals, since a few
tests show that the compiler always select the best overloaded flavor working on primitive
types (except if an argument is a boolean and the other a different primitive type). Updated
a few references. Fixed a few javadoc warnings by explicit declaration of parameter and return
values.</td></tr>
+<tr><td class="rev">30258</td><td>2008-05-08</td><td>acuster</td><td>Reshuffle
the top level repo: drop uDig, move up trunk, tags, and branches.</td></tr>
+<tr><td class="rev">30257</td><td>2008-05-08</td><td>acuster</td><td>Move
trunk/gt/ directory contents up to trunk/ and drop gt</td></tr>
+<tr><td class="rev">28922</td><td>2008-01-24</td><td>acuster</td><td>Bump
the (at)since version to 2.5 since WKTParser was cut from 2.4</td></tr>
+<tr><td class="rev">28540</td><td>2007-12-29</td><td>acuster</td><td>Hide
buttons which are not yet used</td></tr>
+<tr><td class="rev">28393</td><td>2007-12-17</td><td>desruisseaux</td><td>WKT
formatting now includes the semi-major and semi-minor axis length if they differ from the
datum. Applied Java 5 features. Uses WarpAffine when applicable during Raster reprojection.</td></tr>
+<tr><td class="rev">27575</td><td>2007-10-22</td><td>desruisseaux</td><td>Converted
Java source files from ISO-LATIN-1 encoding to UTF-8 (GEOT-1516).</td></tr>
+<tr><td class="rev">22327</td><td>2006-10-23</td><td>desruisseaux</td><td>GEOT-982:
regroup 'module', 'plugin', 'ext' and 'unsupported' in a common directory.</td></tr>
+<tr><td class="rev">22315</td><td>2006-10-22</td><td>desruisseaux</td><td>Reorganisation
of directory tree structure (GEOT-982) phase 1: moved 'src' to 'src/main/java'.</td></tr>
+<tr><td class="rev">20874</td><td>2006-08-07</td><td class="unav">jgarnett</td><td><a
href="rev/20874/DefaultPrimeMeridian.xhtml">ip review</a></td></tr>
+<tr><td class="rev">19769</td><td>2006-06-02</td><td>desruisseaux</td><td>Javadoc
fix: replaced 'degrees' by 'decimal degrees' when relevant (GEOT-855)</td></tr>
+<tr><td class="rev">17672</td><td>2006-01-19</td><td>desruisseaux</td><td>Added
@source tag.</td></tr>
+<tr><td class="rev">17660</td><td>2006-01-18</td><td>desruisseaux</td><td>Fixed
SVN attributes, including the addition of URL attribute.</td></tr>
+<tr><td class="rev">15350</td><td>2005-08-16</td><td>desruisseaux</td><td>Merged
the 'split-main' branch to trunk (GEOT-662)</td></tr>
+<tr><td class="rev">15256</td><td>2005-08-09</td><td>desruisseaux</td><td>Extraction
of referencing module from main</td></tr>
+<tr><td class="rev">15255</td><td>2005-08-09</td><td>desruisseaux</td><td>Prepare
branch for splitting main</td></tr>
+<tr><td class="rev">14545</td><td>2005-06-15</td><td>desruisseaux</td><td>Initial
port of coverage I/O helper classes (work in progress)</td></tr>
+<tr><td class="rev">14235</td><td>2005-06-10</td><td>desruisseaux</td><td>Replaced
_PROPERTY suffix by _KEY as of GEOT-577</td></tr>
+<tr><td class="rev">13925</td><td>2005-05-30</td><td>desruisseaux</td><td>Added
@since javadoc tag</td></tr>
+<tr><td class="rev">13906</td><td>2005-05-28</td><td>desruisseaux</td><td>Renamed
some 'Default' prefix as 'Abstract'</td></tr>
+<tr><td class="rev">13836</td><td>2005-05-26</td><td>desruisseaux</td><td>Added
'Default' suffix to some CRS implementations: partial work</td></tr>
+<tr><td class="rev">11363</td><td>2005-02-12</td><td>desruisseaux</td><td>Milestone
in EPSG factory port: Datum now fully supported</td></tr>
+<tr><td class="rev">11001</td><td>2005-02-02</td><td>desruisseaux</td><td>Fixed
wrong encoding in main/src</td></tr>
+<tr><td class="rev">10796</td><td>2005-01-28</td><td class="unav">dzwiers</td><td><a
href="rev/10796/DefaultPrimeMeridian.xhtml">imports cleaned</a></td></tr>
+<tr><td class="rev">9220</td><td>2004-11-21</td><td>desruisseaux</td><td>WKT
bug fixes</td></tr>
+<tr><td class="rev">8518</td><td>2004-10-11</td><td>desruisseaux</td><td>Apply
changes voted in OGC meeting at Southampton: use of Identifier and GenericName</td></tr>
+<tr><td class="rev">6888</td><td>2004-07-14</td><td>desruisseaux</td><td>Update
for GeoAPI changes (Info -->  IdentifiedObject)</td></tr>
+<tr><td class="rev">6343</td><td>2004-06-07</td><td>desruisseaux</td><td>More
ports of legacy CTS to new CRS</td></tr>
+<tr><td class="rev">6098</td><td>2004-05-23</td><td>desruisseaux</td><td>Partial
implementation of GeoAPI referencing package</td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/DefaultPrimeMeridian.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/DefaultPrimeMeridian.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/10796/DefaultPrimeMeridian.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/10796/DefaultPrimeMeridian.xhtml?rev=1519473&view=auto
==============================================================================
--- sis/ip-review/rev/10796/DefaultPrimeMeridian.xhtml (added)
+++ sis/ip-review/rev/10796/DefaultPrimeMeridian.xhtml Mon Sep  2 17:02:00 2013
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>DefaultPrimeMeridian changes for revisions 10795:10796</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>DefaultPrimeMeridian changes for revisions 10795:10796</h1>
+<p>Changes in this commit seem to be the result of some "<cite>auto reformat</cite>"
tool execution.
+The <cite>Java</cite> - <cite>GeoAPI</cite> - <cite>GeoTools</cite>
import ordering is altered,
+imports used only in Javadoc are lost and the encoding of non-ASCII characters is broken.
+This commit has been reverted, except for the removal of really unused imports which are
keep removed.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space
--ignore-eol-style" -r10795:10796 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/datum/DefaultPrimeMeridian.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 10795</th><th>Revision 10796</th></tr>
+<tr><td><pre>/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Managment Committee (PMC)
+<span class="del"> * (C) 2001, Institut de Recherche pour le Développement</span>
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public</pre></td>
+<td><pre>/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Managment Committee (PMC)
+<span class="add"> * (C) 2001, Institut de Recherche pour le D�veloppement</span>
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public</pre></td></tr>
+<tr><td><pre>package org.geotools.referencing.datum;
+
+// J2SE extensions
+import java.util.Map;
+<span class="del">import java.util.Collections;</span>
+import javax.units.Unit;
+<span class="del">import javax.units.NonSI;</span>
+
+<span class="del">// Geotools dependencies</span>
+import org.geotools.referencing.IdentifiedObject;
+import org.geotools.referencing.wkt.Formatter;
+import org.geotools.resources.Utilities;</pre></td>
+<td><pre>package org.geotools.referencing.datum;
+
+// J2SE extensions
+<span class="add">import java.util.Collections;</span>
+import java.util.Map;
+<span class="add"></span>
+<span class="add">import javax.units.NonSI;</span>
+import javax.units.Unit;
+
+import org.geotools.referencing.IdentifiedObject;
+import org.geotools.referencing.wkt.Formatter;
+import org.geotools.resources.Utilities;</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/10796/DefaultPrimeMeridian.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/10796/DefaultPrimeMeridian.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/20874/DefaultPrimeMeridian.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/20874/DefaultPrimeMeridian.xhtml?rev=1519473&view=auto
==============================================================================
--- sis/ip-review/rev/20874/DefaultPrimeMeridian.xhtml (added)
+++ sis/ip-review/rev/20874/DefaultPrimeMeridian.xhtml Mon Sep  2 17:02:00 2013
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>DefaultPrimeMeridian changes for revisions 20873:20874</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>DefaultPrimeMeridian changes for revisions 20873:20874</h1>
+<p>Changes in GeoTools header only. The removal of the "<cite>or (at your option)
any later version</cite>" clause
+must be keep in Geotk for every classes having contribution from a developer other than those
who accepted re-licensing.
+This header does not apply to Apache SIS, since the above-cited contributions are omitted.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space
--ignore-eol-style" -r20873:20874 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/datum/DefaultPrimeMeridian.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 20873</th><th>Revision 20874</th></tr>
+<tr><td><pre>/*
+<span class="del"> * Geotools 2 - OpenSource mapping toolkit</span>
+<span class="del"> * (C) 2003, Geotools Project Managment Committee (PMC)</span>
+ * (C) 2001, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+<span class="del"> *    License as published by the Free Software Foundation; either</span>
+<span class="del"> *    version 2.1 of the License, or (at your option) any later version.</span>
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of</pre></td>
+<td><pre>/*
+<span class="add"> *    GeoTools - OpenSource mapping toolkit</span>
+<span class="add"> *    http://geotools.org</span>
+<span class="add"> *    (C) 2003-2006, GeoTools Project Managment Committee (PMC)</span>
+ * (C) 2001, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+<span class="add"> *    License as published by the Free Software Foundation;</span>
+<span class="add"> *    version 2.1 of the License.</span>
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of</pre></td></tr>
+<tr><td><pre>*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 See the GNU
+*    Lesser General Public License for more details.
+*
+<span class="del">*    You should have received a copy of the GNU Lesser General Public</span>
+<span class="del">*    License along with this library; if not, write to the Free Software</span>
+<span class="del">*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 USA</span>
+<span class="del">*</span>
+*    This package contains documentation from OpenGIS specifications.
+*    OpenGIS consortium's work is fully acknowledged here.
+*/</pre></td>
+<td><pre>*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+*    Lesser General Public License for more details.
+*
+*    This package contains documentation from OpenGIS specifications.
+*    OpenGIS consortium's work is fully acknowledged here.
+*/</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/20874/DefaultPrimeMeridian.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/20874/DefaultPrimeMeridian.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html



Mime
View raw message