sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1566602 - in /sis/branches/JDK7: core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/sis-referencing/src/main/java/org/apache/sis/parameter/ core/sis-referencing/src/main/java/org/apache/sis/referencing/ core/sis-referencing/src/ma...
Date Mon, 10 Feb 2014 12:49:15 GMT
Author: desruisseaux
Date: Mon Feb 10 12:49:14 2014
New Revision: 1566602

URL: http://svn.apache.org/r1566602
Log:
Moved some explicit DefaultParameterDescriptor arguments to the properties map.
Javadoc clarification, and modification in the stylesheet for matching the most common usage.

Modified:
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/TimeDependentBWP.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java
    sis/branches/JDK7/src/main/javadoc/stylesheet.css
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1566602&r1=1566601&r2=1566602&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] Mon Feb 10 12:49:14 2014
@@ -739,7 +739,7 @@ public class Formatter implements Locali
     /**
      * Appends a code list.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>Position:</th>  <td>current line</td></tr>
      *   <tr><th>Color key:</th> <td>{@link ElementKind#CODE_LIST}</td></tr>
      * </table></blockquote>
@@ -759,7 +759,7 @@ public class Formatter implements Locali
      * Appends a character string between quotes.
      * The {@linkplain Symbols#getSeparator() element separator} will be written before the
text if needed.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>Position:</th>  <td>current line</td></tr>
      *   <tr><th>Color key:</th> <td>given</td></tr>
      * </table></blockquote>
@@ -843,7 +843,7 @@ public class Formatter implements Locali
      * Appends a date.
      * The {@linkplain Symbols#getSeparator() element separator} will be written before the
date if needed.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>Position:</th>  <td>current line</td></tr>
      *   <tr><th>Color key:</th> <td>none</td></tr>
      * </table></blockquote>
@@ -861,7 +861,7 @@ public class Formatter implements Locali
      * Appends a boolean value.
      * The {@linkplain Symbols#getSeparator() element separator} will be written before the
boolean if needed.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>Position:</th>  <td>current line</td></tr>
      *   <tr><th>Color key:</th> <td>none</td></tr>
      * </table></blockquote>
@@ -877,7 +877,7 @@ public class Formatter implements Locali
      * Appends an integer value.
      * The {@linkplain Symbols#getSeparator() element separator} will be written before the
number if needed.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>Position:</th>  <td>current line</td></tr>
      *   <tr><th>Color key:</th> <td>{@link ElementKind#INTEGER}</td></tr>
      * </table></blockquote>
@@ -896,7 +896,7 @@ public class Formatter implements Locali
      * Appends an floating point value.
      * The {@linkplain Symbols#getSeparator() element separator} will be written before the
number if needed.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>Position:</th>  <td>current line</td></tr>
      *   <tr><th>Color key:</th> <td>{@link ElementKind#NUMBER}</td></tr>
      * </table></blockquote>
@@ -944,7 +944,7 @@ public class Formatter implements Locali
      *
      * {@example <code>append(SI.KILOMETRE)</code> will append "<code>LENGTHUNIT["km",
1000]</code>" to the WKT.}
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>Position:</th>  <td>depending the previous element</td></tr>
      *   <tr><th>Color key:</th> <td>none</td></tr>
      * </table></blockquote>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java?rev=1566602&r1=1566601&r2=1566602&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java [UTF-8]
(original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java [UTF-8]
Mon Feb 10 12:49:14 2014
@@ -32,7 +32,7 @@ import static org.apache.sis.util.Argume
  * The two constants defined in this class, namely {@link #SQUARE_BRACKETS} and {@link #CURLY_BRACKETS},
  * define the symbols for ISO 19162 compliant WKT formatting. Their properties are:
  *
- * <blockquote><table class="compact" style="text-align:left>
+ * <blockquote><table class="compact">
  *   <tr>
  *     <td>Locale for number format:</td>
  *     <td>{@link Locale#ROOT}</td>

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java?rev=1566602&r1=1566601&r2=1566602&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
[UTF-8] Mon Feb 10 12:49:14 2014
@@ -19,6 +19,7 @@ package org.apache.sis.parameter;
 import java.util.Arrays;
 import java.util.Set;
 import java.util.Map;
+import java.util.Collection;
 import java.util.LinkedHashSet;
 import javax.measure.unit.Unit;
 
@@ -31,6 +32,7 @@ import org.apache.sis.util.Classes;
 import org.apache.sis.util.Numbers;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.util.resources.Errors;
+import org.apache.sis.util.collection.Containers;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.AbstractIdentifiedObject;
@@ -69,6 +71,24 @@ public class DefaultParameterDescriptor<
     private static final long serialVersionUID = -295668622297737705L;
 
     /**
+     * Key for the {@value} property to be given to the constructor.
+     * This is used for setting the value to be returned by {@link #getMinimumValue()}.
+     */
+    public static final String MINIMUM_VALUE_KEY = "minimumValue";
+
+    /**
+     * Key for the {@value} property to be given to the constructor.
+     * This is used for setting the value to be returned by {@link #getMaximumValue()}.
+     */
+    public static final String MAXIMUM_VALUE_KEY = "maximumValue";
+
+    /**
+     * Key for the {@value} property to be given to the constructor.
+     * This is used for setting the value to be returned by {@link #getValidValues()}.
+     */
+    public static final String VALID_VALUES_KEY = "validValues";
+
+    /**
      * The class that describe the type of parameter values.
      */
     private final Class<T> valueClass;
@@ -87,12 +107,12 @@ public class DefaultParameterDescriptor<
     /**
      * The minimum parameter value, or {@code null}.
      */
-    private final Comparable<T> minimum;
+    private final Comparable<T> minimumValue;
 
     /**
      * The maximum parameter value, or {@code null}.
      */
-    private final Comparable<T> maximum;
+    private final Comparable<T> maximumValue;
 
     /**
      * The unit for default, minimum and maximum values, or {@code null}.
@@ -100,9 +120,9 @@ public class DefaultParameterDescriptor<
     private final Unit<?> unit;
 
     /**
-     * Constructs a descriptor from a set of properties. The properties map is given unchanged
to the
-     * {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}.
-     * The following table is a reminder of main (not all) properties:
+     * Constructs a descriptor from a set of properties. The properties given in argument
follow the same rules
+     * than for the {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class
constructor}.
+     * Additionally, the following properties are understood by this constructor:
      *
      * <table class="sis">
      *   <tr>
@@ -111,6 +131,24 @@ public class DefaultParameterDescriptor<
      *     <th>Returned by</th>
      *   </tr>
      *   <tr>
+     *     <td>{@value #MINIMUM_VALUE_KEY}</td>
+     *     <td>{@code Comparable<T>}</td>
+     *     <td>{@link #getMinimumValue()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value #MAXIMUM_VALUE_KEY}</td>
+     *     <td>{@code Comparable<T>}</td>
+     *     <td>{@link #getMaximumValue()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value #VALID_VALUES_KEY}</td>
+     *     <td>{@code Collection<T>} or {@code T[]}</td>
+     *     <td>{@link #getValidValues()}</td>
+     *   </tr>
+     *   <tr>
+     *     <th colspan="3" class="hsep">Defined in parent class (reminder)</th>
+     *   </tr>
+     *   <tr>
      *     <td>{@value org.opengis.referencing.IdentifiedObject#NAME_KEY}</td>
      *     <td>{@link org.opengis.referencing.ReferenceIdentifier} or {@link String}</td>
      *     <td>{@link #getName()}</td>
@@ -134,33 +172,33 @@ public class DefaultParameterDescriptor<
      *
      * @param properties   The properties to be given to the identified object.
      * @param valueClass   The class that describes the type of the parameter value.
-     * @param validValues  A finite set of valid values (usually from a {@link CodeList}),
-     *                     or {@code null} if it doesn't apply.
      * @param defaultValue The default value for the parameter, or {@code null} if none.
-     * @param minimum      The minimum parameter value (inclusive), or {@code null} if none.
-     * @param maximum      The maximum parameter value (inclusive), or {@code null} if none.
      * @param unit         The unit of measurement for the default, minimum and maximum values,
or {@code null} if none.
-     * @param required     {@code true} if this parameter is required, or {@code false} if
it is optional.
+     * @param required     {@code true} if this parameter is mandatory, or {@code false}
if it is optional.
      */
+    @SuppressWarnings("unchecked")
     public DefaultParameterDescriptor(final Map<String,?> properties,
                                       final Class<T>      valueClass,
-                                      final T[]           validValues,
                                       final T             defaultValue,
-                                      final Comparable<T> minimum,
-                                      final Comparable<T> maximum,
                                       final Unit<?>       unit,
                                       final boolean       required)
     {
         super(properties, required ? 1 : 0, 1);
+        final Comparable<T> minimumValue = Containers.property(properties, MINIMUM_VALUE_KEY,
Comparable.class);
+        final Comparable<T> maximumValue = Containers.property(properties, MAXIMUM_VALUE_KEY,
Comparable.class);
+        ensureNonNull("valueClass",      valueClass);
+        ensureCanCast("defaultValue",    valueClass, defaultValue);
+        ensureCanCast(MINIMUM_VALUE_KEY, valueClass, minimumValue);
+        ensureCanCast(MAXIMUM_VALUE_KEY, valueClass, maximumValue);
         this.valueClass   = valueClass;
         this.defaultValue = Numerics.cached(defaultValue);
-        this.minimum      = Numerics.cached(minimum);
-        this.maximum      = Numerics.cached(maximum);
+        this.minimumValue = Numerics.cached(minimumValue);
+        this.maximumValue = Numerics.cached(maximumValue);
         this.unit         = unit;
-        ensureNonNull("valueClass",   valueClass);
-        ensureCanCast("defaultValue", valueClass, defaultValue);
-        ensureCanCast("minimum",      valueClass, minimum);
-        ensureCanCast("maximum",      valueClass, maximum);
+        /*
+         * If the caller specified a unit of measurement, then
+         * verify that the values are of some numerical type.
+         */
         if (unit != null) {
             Class<?> componentType = valueClass;
             for (Class<?> c; (c = componentType.getComponentType()) != null;) {
@@ -172,25 +210,51 @@ public class DefaultParameterDescriptor<
                         Errors.Keys.IllegalUnitFor_2, super.getName().getCode(), unit));
             }
         }
-        if (minimum != null && maximum != null) {
-            if (minimum.compareTo(valueClass.cast(maximum)) > 0) {
+        /*
+         * If the caller specified minimum and maximum values, then
+         * verify that the minimum is not greater than the maximum.
+         */
+        if (minimumValue != null && maximumValue != null) {
+            if (minimumValue.compareTo(valueClass.cast(maximumValue)) > 0) {
                 throw new IllegalArgumentException(Errors.getResources(properties)
-                        .getString(Errors.Keys.IllegalRange_2, minimum, maximum));
+                        .getString(Errors.Keys.IllegalRange_2, minimumValue, maximumValue));
             }
         }
-        if (validValues != null) {
-            final Set<T> valids = new LinkedHashSet<>(hashMapCapacity(validValues.length));
-            for (T value : validValues) {
-                value = Numerics.cached(value);
-                ensureCanCast("validValues", valueClass, value);
-                valids.add(value);
+        /*
+         * If the caller specified a set of valid values, then copy the values in
+         * a new set and verify their type and inclusion in the [min … max] range.
+         */
+        final Object values = properties.get(VALID_VALUES_KEY);
+        if (values != null) {
+            final Object[] array;
+            if (values instanceof Object[]) {
+                array = (Object[]) values;
+            } else if (values instanceof Collection<?>) {
+                array = ((Collection<?>) values).toArray();
+            } else {
+                throw new IllegalArgumentException(Errors.getResources(properties)
+                        .getString(Errors.Keys.IllegalPropertyClass_2, VALID_VALUES_KEY,
values.getClass()));
+            }
+            final Set<T> valids = new LinkedHashSet<>(hashMapCapacity(array.length));
+            for (Object value : array) {
+                if (value != null) {
+                    value = Numerics.cached(value);
+                    final Verifier error = Verifier.ensureValidValue(valueClass, null, minimumValue,
maximumValue, value);
+                    if (error != null) {
+                        throw new IllegalArgumentException(error.message(properties, super.getName().getCode(),
value));
+                    }
+                }
+                valids.add((T) value);
             }
-            this.validValues = unmodifiableOrCopy(valids);
+            validValues = unmodifiableOrCopy(valids);
         } else {
-            this.validValues = null;
+            validValues = null;
         }
+        /*
+         * Finally, verify the default value if any.
+         */
         if (defaultValue != null) {
-            final Verifier error = Verifier.ensureValidValue(valueClass, this.validValues,
minimum, maximum, defaultValue);
+            final Verifier error = Verifier.ensureValidValue(valueClass, validValues, minimumValue,
maximumValue, defaultValue);
             if (error != null) {
                 throw new IllegalArgumentException(error.message(properties, super.getName().getCode(),
defaultValue));
             }
@@ -211,8 +275,8 @@ public class DefaultParameterDescriptor<
         valueClass   = descriptor.getValueClass();
         validValues  = descriptor.getValidValues();
         defaultValue = descriptor.getDefaultValue();
-        minimum      = descriptor.getMinimumValue();
-        maximum      = descriptor.getMaximumValue();
+        minimumValue = descriptor.getMinimumValue();
+        maximumValue = descriptor.getMaximumValue();
         unit         = descriptor.getUnit();
     }
 
@@ -301,7 +365,7 @@ public class DefaultParameterDescriptor<
      */
     @Override
     public Comparable<T> getMinimumValue() {
-        return minimum;
+        return minimumValue;
     }
 
     /**
@@ -313,7 +377,7 @@ public class DefaultParameterDescriptor<
      */
     @Override
     public Comparable<T> getMaximumValue() {
-        return maximum;
+        return maximumValue;
     }
 
     /**
@@ -384,8 +448,8 @@ public class DefaultParameterDescriptor<
                     return                    this.valueClass == that.valueClass    &&
                            Objects.    equals(this.validValues,  that.validValues)  &&
                            Objects.deepEquals(this.defaultValue, that.defaultValue) &&
-                           Objects.    equals(this.minimum,      that.minimum)      &&
-                           Objects.    equals(this.maximum,      that.maximum)      &&
+                           Objects.    equals(this.minimumValue, that.minimumValue)     
&&
+                           Objects.    equals(this.maximumValue, that.maximumValue)     
&&
                            Objects.    equals(this.unit,         that.unit);
                 }
             }
@@ -400,7 +464,7 @@ public class DefaultParameterDescriptor<
      */
     @Override
     protected long computeHashCode() {
-        return Arrays.deepHashCode(new Object[] {valueClass, defaultValue, minimum, maximum,
unit})
+        return Arrays.deepHashCode(new Object[] {valueClass, defaultValue, minimumValue,
maximumValue, unit})
                 + super.computeHashCode();
     }
 
@@ -415,9 +479,9 @@ public class DefaultParameterDescriptor<
                 .append("[\"").append(getName().getCode()).append("\", ")
                 .append(getMinimumOccurs() == 0 ? "optional" : "mandatory");
         buffer.append(", class=").append(Classes.getShortName(valueClass));
-        if (minimum != null || maximum != null) {
-            buffer.append(", valid=[").append(minimum != null ? minimum : "-∞")
-                  .append(" … ") .append(maximum != null ? maximum :  "∞").append(']');
+        if (minimumValue != null || maximumValue != null) {
+            buffer.append(", valid=[").append(minimumValue != null ? minimumValue : "-∞")
+                  .append(" … ") .append(maximumValue != null ? maximumValue :  "∞").append(']');
         } else if (validValues != null) {
             buffer.append(", valid=").append(validValues);
         }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1566602&r1=1566601&r2=1566602&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
[UTF-8] Mon Feb 10 12:49:14 2014
@@ -273,10 +273,16 @@ public class AbstractIdentifiedObject ex
      * All localizable attributes like {@code "remarks"} may have a language and country
code suffix.
      * For example the {@code "remarks_fr"} property stands for remarks in {@linkplain Locale#FRENCH
French} and
      * the {@code "remarks_fr_CA"} property stands for remarks in {@linkplain Locale#CANADA_FRENCH
French Canadian}.
+     * They are convenience properties for building the {@code InternationalString} value.
      *
-     * <p>The {@code "locale"} property applies only to exception messages, if any.
-     * After successful construction, {@code AbstractIdentifiedObject} instances do not keep
the locale
-     * since localizations are deferred to the {@link InternationalString#toString(Locale)}
method.</p>
+     * <p>The {@code "locale"} property applies only in case of exception for formatting
the error message, and
+     * is used only on a <cite>best effort</cite> basis. The locale is discarded
after successful construction
+     * since localizations are applied by the {@link InternationalString#toString(Locale)}
method.</p>
+     *
+     * {@section Properties map versus explicit arguments}
+     * Generally speaking, information provided in the {@code properties} map are considered
ignorable metadata
+     * while information provided in explicit arguments to the sub-class constructors have
an impact on coordinate
+     * transformation results. See {@link #equals(Object, ComparisonMode)} for more information.
      *
      * @param  properties The properties to be given to this identified object.
      * @throws IllegalArgumentException if a property has an invalid value.
@@ -748,24 +754,28 @@ public class AbstractIdentifiedObject ex
      * from stricter to more permissive values:
      *
      * <blockquote><table class="compact">
-     *   <tr><td>{@link ComparisonMode#STRICT STRICT} –</td>
+     *   <tr><td>{@link ComparisonMode#STRICT STRICT}:</td>
      *        <td>Verifies if the two objects are of the same {@linkplain #getClass()
class}
      *            and compares all public properties, including SIS-specific (non standard)
properties.</td></tr>
-     *   <tr><td>{@link ComparisonMode#BY_CONTRACT BY_CONTRACT} –</td>
+     *   <tr><td>{@link ComparisonMode#BY_CONTRACT BY_CONTRACT}:</td>
      *       <td>Verifies if the two objects implement the same {@linkplain #getInterface()
GeoAPI interface}
      *           and compares all properties defined by that interface: {@linkplain #getName()
name},
      *           {@linkplain #getRemarks() remarks}, {@linkplain #getIdentifiers() identifiers},
<i>etc</i>.</td></tr>
-     *   <tr><td>{@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} –</td>
-     *       <td>Compares only the properties needed for computing transformations.
-     *           In other words, {@code sourceCRS.equals(targetCRS, IGNORE_METADATA)} returns
{@code true}
-     *           if the transformation from {@code sourceCRS} to {@code targetCRS} would
be the
-     *           identity transform, no matter what {@link #getName()} said.</td></tr>
-     *   <tr><td>{@link ComparisonMode#APPROXIMATIVE APPROXIMATIVE} –</td>
+     *   <tr><td>{@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA}:</td>
+     *       <td>Compares only the properties relevant to coordinate transformations.
Generally speaking, the content
+     *           of the {@code properties} map given at {@linkplain #AbstractIdentifiedObject(Map)
construction time}
+     *           is considered ignorable metadata while the explicit arguments given to the
constructor (if any) are
+     *           considered non-ignorable.</td></tr>
+     *   <tr><td>{@link ComparisonMode#APPROXIMATIVE APPROXIMATIVE}:</td>
      *       <td>Same as {@code IGNORE_METADATA}, with some tolerance threshold on
numerical values.</td></tr>
-     *   <tr><td>{@link ComparisonMode#DEBUG DEBUG} –</td>
+     *   <tr><td>{@link ComparisonMode#DEBUG DEBUG}:</td>
      *        <td>Special mode for figuring out why two objects expected to be equal
are not.</td></tr>
      * </table></blockquote>
      *
+     * The main guideline is that if {@code sourceCRS.equals(targetCRS, IGNORE_METADATA)}
returns {@code true},
+     * then the transformation from {@code sourceCRS} to {@code targetCRS} should be the
identity transform
+     * no matter what {@link #getName()} said.
+     *
      * {@section Exceptions to the above rules}
      * Some subclasses (especially
      * {@link org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis},

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java?rev=1566602&r1=1566601&r2=1566602&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
[UTF-8] Mon Feb 10 12:49:14 2014
@@ -112,7 +112,7 @@ public enum CommonCRS {
      * World Geodetic System 1984.
      * This is the default CRS for most {@code org.apache.sis} packages.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>WMS identifier:</th>          <td>CRS:84</td></tr>
      *   <tr><th>EPSG identifiers:</th>        <td>4326 &nbsp;(<i>datum:</i>
6326, &nbsp;<i>ellipsoid:</i> 7030)</td></tr>
      *   <tr><th>Primary names:</th>           <td>"WGS 84" &nbsp;(<i>datum:</i>
"World Geodetic System 1984")</td></tr>
@@ -129,7 +129,7 @@ public enum CommonCRS {
     /**
      * World Geodetic System 1972.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>EPSG identifiers:</th>        <td>4322 &nbsp;(<i>datum:</i>
6322, &nbsp;<i>ellipsoid:</i> 7043)</td></tr>
      *   <tr><th>Primary names:</th>           <td>"WGS 72" &nbsp;(<i>datum:</i>
"World Geodetic System 1972")</td></tr>
      *   <tr><th>Abbreviations or aliases:</th><td>(<i>datum:</i>
"WGS 72", &nbsp;<i>ellipsoid:</i> "NWL 10D")</td></tr>
@@ -147,7 +147,7 @@ public enum CommonCRS {
      * The ellipsoid is <cite>"GRS 1980"</cite>, also known as <cite>"International
1979"</cite>.
      * This ellipsoid is very close, but not identical, to the {@linkplain #WGS84} one.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>EPSG identifiers:</th>        <td>4258 &nbsp;(<i>datum:</i>
6258, &nbsp;<i>ellipsoid:</i> 7019)</td></tr>
      *   <tr><th>Primary names:</th>           <td>"ETRS89" &nbsp;(<i>datum:</i>
"European Terrestrial Reference System 1989", &nbsp;<i>ellipsoid:</i> "GRS
1980")</td></tr>
      *   <tr><th>Abbreviations or aliases:</th><td>"ETRF89", "EUREF89",
"ETRS89-GRS80" &nbsp;(<i>ellipsoid:</i> "International 1979")</td></tr>
@@ -169,7 +169,7 @@ public enum CommonCRS {
      * The ellipsoid is <cite>"GRS 1980"</cite>, also known as <cite>"International
1979"</cite>.
      * This ellipsoid is very close, but not identical, to the {@linkplain #WGS84} one.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>WMS identifier:</th>          <td>CRS:83</td></tr>
      *   <tr><th>EPSG identifiers:</th>        <td>4269 &nbsp;(<i>datum:</i>
6269, &nbsp;<i>ellipsoid:</i> 7019)</td></tr>
      *   <tr><th>Primary names:</th>           <td>"NAD83" &nbsp;(<i>datum:</i>
"North American Datum 1983", &nbsp;<i>ellipsoid:</i> "GRS 1980")</td></tr>
@@ -190,7 +190,7 @@ public enum CommonCRS {
     /**
      * North American Datum 1927.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>WMS identifier:</th>          <td>CRS:27</td></tr>
      *   <tr><th>EPSG identifiers:</th>        <td>4267 &nbsp;(<i>datum:</i>
6267, &nbsp;<i>ellipsoid:</i> 7008)</td></tr>
      *   <tr><th>Primary names:</th>           <td>"NAD27" &nbsp;(<i>datum:</i>
"North American Datum 1927", &nbsp;<i>ellipsoid:</i> "Clarke 1866")</td></tr>
@@ -206,7 +206,7 @@ public enum CommonCRS {
     /**
      * European Datum 1950.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>EPSG identifiers:</th>        <td>4230 &nbsp;(<i>datum:</i>
6230, &nbsp;<i>ellipsoid:</i> 7022)</td></tr>
      *   <tr><th>Primary names:</th>           <td>"ED50" &nbsp;(<i>datum:</i>
"European Datum 1950", &nbsp;<i>ellipsoid:</i> "International 1924")</td></tr>
      *   <tr><th>Abbreviations or aliases:</th><td>(<i>datum:</i>
"ED50", <i>ellipsoid:</i> "Hayford 1909")</td></tr>
@@ -224,7 +224,7 @@ public enum CommonCRS {
      * {@linkplain org.apache.sis.referencing.datum.DefaultEllipsoid#orthodromicDistance
      * orthodromic distance computation}, which may be faster and more robust.
      *
-     * <blockquote><table class="compact" style="text-align:left">
+     * <blockquote><table class="compact">
      *   <tr><th>EPSG identifiers:</th>        <td>4047 &nbsp;(<i>datum:</i>
6047, &nbsp;<i>ellipsoid:</i> 7048)</td></tr>
      *   <tr><th>Primary names:</th>           <td>"Unspecified datum
based upon the GRS 1980 Authalic Sphere"</td></tr>
      *   <tr><th>Prime meridian:</th>          <td>Greenwich</td></tr>
@@ -798,7 +798,7 @@ public enum CommonCRS {
          * Height measured above the Mean Sea Level (MSL) in metres. Can be used as an approximation
of geoidal heights
          * (height measured above an equipotential surface), except that MSL are not specific
to any location or epoch.
          *
-         * <blockquote><table class="compact" style="text-align:left">
+         * <blockquote><table class="compact">
          *   <tr><th>EPSG identifiers:</th>         <td>5714 &nbsp;(<i>datum:</i>
5100)</td></tr>
          *   <tr><th>Primary names:</th>            <td>"MSL height"
&nbsp;(<i>datum:</i> "Mean Sea Level")</td></tr>
          *   <tr><th>Abbreviations or aliases:</th> <td>"mean sea
level height" &nbsp;(<i>datum:</i> "MSL")</td></tr>
@@ -813,7 +813,7 @@ public enum CommonCRS {
         /**
          * Depth measured below the Mean Sea Level (MSL) in metres.
          *
-         * <blockquote><table class="compact" style="text-align:left">
+         * <blockquote><table class="compact">
          *   <tr><th>EPSG identifiers:</th>         <td>5715 &nbsp;(<i>datum:</i>
5100)</td></tr>
          *   <tr><th>Primary names:</th>            <td>"MSL depth"
&nbsp;(<i>datum:</i> "Mean Sea Level")</td></tr>
          *   <tr><th>Abbreviations or aliases:</th> <td>"mean sea
level depth" &nbsp;(<i>datum:</i> "MSL")</td></tr>

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/TimeDependentBWP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/TimeDependentBWP.java?rev=1566602&r1=1566601&r2=1566602&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/TimeDependentBWP.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/TimeDependentBWP.java
[UTF-8] Mon Feb 10 12:49:14 2014
@@ -34,7 +34,6 @@ import static org.apache.sis.internal.re
  * by {@link #getTimeReference()}. Those values vary at a rate given by the parameters listed
in the
  * table below (codes, names and abbreviations are from the EPSG database):
  *
- * <table class="compact"><tr><td>
  * <table class="sis">
  *   <tr><th>Code</th> <th>Name</th>                      
          <th>Abbr.</th></tr>
  *   <tr><td>1040</td> <td>Rate of change of X-axis translation</td>
<td>{@link #dtX}</td></tr>

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java?rev=1566602&r1=1566601&r2=1566602&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java
[UTF-8] Mon Feb 10 12:49:14 2014
@@ -47,9 +47,13 @@ public final strictfp class DefaultParam
      * @param  name The parameter name.
      * @return The properties to be given to descriptor constructor.
      */
-    private static Map<String,Object> properties(final String name) {
-        final Map<String,Object> properties = new HashMap<>(4);
+    private static Map<String,Object> properties(final String name,
+            final Object minimumValue, final Object maximumValue)
+    {
+        final Map<String,Object> properties = new HashMap<>(8);
         assertNull(properties.put(DefaultParameterDescriptor.NAME_KEY, name));
+        assertNull(properties.put(DefaultParameterDescriptor.MINIMUM_VALUE_KEY, minimumValue));
+        assertNull(properties.put(DefaultParameterDescriptor.MAXIMUM_VALUE_KEY, maximumValue));
         assertNull(properties.put(DefaultParameterDescriptor.LOCALE_KEY, Locale.US));
         return properties;
     }
@@ -62,7 +66,7 @@ public final strictfp class DefaultParam
      * @return The parameter descriptor.
      */
     static <T> DefaultParameterDescriptor<T> createSimpleOptional(final String
name, final Class<T> type) {
-        return new DefaultParameterDescriptor<>(properties(name), type, null, null,
null, null, null, false);
+        return new DefaultParameterDescriptor<>(properties(name, null, null), type,
null, null, false);
     }
 
     /**
@@ -70,16 +74,15 @@ public final strictfp class DefaultParam
      *
      * @param  name         The parameter name.
      * @param  defaultValue The default value for the parameter.
-     * @param  minimum      The minimum parameter value.
-     * @param  maximum      The maximum parameter value.
+     * @param  minimumValue The minimum parameter value.
+     * @param  maximumValue The maximum parameter value.
      * @return The parameter descriptor for the given range of values.
      */
     static DefaultParameterDescriptor<Integer> create(final String name,
-            final int defaultValue, final int minimum, final int maximum)
+            final int defaultValue, final int minimumValue, final int maximumValue)
     {
-        return new DefaultParameterDescriptor<>(properties(name),
-                 Integer.class, null, Integer.valueOf(defaultValue),
-                 Integer.valueOf(minimum), Integer.valueOf(maximum), null, true);
+        return new DefaultParameterDescriptor<>(properties(name, minimumValue, maximumValue),
+                 Integer.class, Integer.valueOf(defaultValue), null, true);
     }
 
     /**
@@ -87,18 +90,18 @@ public final strictfp class DefaultParam
      *
      * @param  name         The parameter name.
      * @param  defaultValue The default value for the parameter, or {@link Double#NaN} if
none.
-     * @param  minimum      The minimum parameter value, or {@link Double#NEGATIVE_INFINITY}
if none.
-     * @param  maximum      The maximum parameter value, or {@link Double#POSITIVE_INFINITY}
if none.
+     * @param  minimum      The minimum parameter value, or {@link minimumValue#NEGATIVE_INFINITY}
if none.
+     * @param  maximumValue The maximum parameter value, or {@link Double#POSITIVE_INFINITY}
if none.
      * @param  unit         The unit for default, minimum and maximum values.
      * @return The parameter descriptor for the given range of values.
      */
     static DefaultParameterDescriptor<Double> create(final String name,
-            final double defaultValue, final double minimum, final double maximum, final
Unit<?> unit)
+            final double defaultValue, final double minimumValue, final double maximumValue,
final Unit<?> unit)
     {
-        return new DefaultParameterDescriptor<>(properties(name), Double.class, null,
-                Double.isNaN(defaultValue)          ? null : Double.valueOf(defaultValue),
-                minimum == Double.NEGATIVE_INFINITY ? null : Double.valueOf(minimum),
-                maximum == Double.POSITIVE_INFINITY ? null : Double.valueOf(maximum), unit,
true);
+        return new DefaultParameterDescriptor<>(properties(name,
+                minimumValue == Double.NEGATIVE_INFINITY ? null : Double.valueOf(minimumValue),
+                maximumValue == Double.POSITIVE_INFINITY ? null : Double.valueOf(maximumValue)),
+                Double.class, Double.isNaN(defaultValue) ? null : Double.valueOf(defaultValue),
unit, true);
     }
 
     /**
@@ -114,7 +117,9 @@ public final strictfp class DefaultParam
     static <T> DefaultParameterDescriptor<T> create(final String name, final
Class<T> type,
             final T[] validValues, final T defaultValue)
     {
-        return new DefaultParameterDescriptor<>(properties(name), type, validValues,
defaultValue, null, null, null, true);
+        final Map<String,Object> properties = properties(name, null, null);
+        assertNull(properties.put(DefaultParameterDescriptor.VALID_VALUES_KEY, validValues));
+        return new DefaultParameterDescriptor<>(properties, type, defaultValue, null,
true);
     }
 
     /**
@@ -194,7 +199,7 @@ public final strictfp class DefaultParam
     @Test
     public void testStringType() {
         final ParameterDescriptor<String> descriptor = new DefaultParameterDescriptor<>(
-                properties("String param"), String.class, null, "ABC", "AAA", "BBB", null,
false);
+                properties("String param", "AAA", "BBB"), String.class, "ABC", null, false);
         assertEquals("name", "String param",     descriptor.getName().getCode());
         assertEquals("valueClass", String.class, descriptor.getValueClass());
         assertNull  ("validValues",              descriptor.getValidValues());
@@ -208,8 +213,8 @@ public final strictfp class DefaultParam
          * This operation shall be invalid for non-numerical types.
          */
         try {
-            new DefaultParameterDescriptor<>(properties("Invalid param"),
-                     String.class, null, "ABC", "AAA", "BBB", SI.METRE, false);
+            new DefaultParameterDescriptor<>(properties("Invalid param", "AAA", "BBB"),
+                     String.class, "ABC", SI.METRE, false);
         } catch (IllegalArgumentException e) {
             assertEquals("Unit of measurement “m” is not valid for “Invalid param”
values.", e.getMessage());
         }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java?rev=1566602&r1=1566601&r2=1566602&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java
[UTF-8] Mon Feb 10 12:49:14 2014
@@ -110,17 +110,17 @@ public interface LenientComparable {
      * The strictness level is controlled by the second argument,
      * from stricter to more permissive values:
      *
-     * <blockquote><table class="compact">
-     *   <tr><td>{@link ComparisonMode#STRICT STRICT} –</td>
+     * <blockquote><table class="compact" >
+     *   <tr><td>{@link ComparisonMode#STRICT STRICT}:</td>
      *        <td>All attributes of the compared objects shall be strictly equal.</td></tr>
-     *   <tr><td>{@link ComparisonMode#BY_CONTRACT BY_CONTRACT} –</td>
+     *   <tr><td>{@link ComparisonMode#BY_CONTRACT BY_CONTRACT}:</td>
      *       <td>Only the attributes published in the interface contract need to be
compared.</td></tr>
-     *   <tr><td>{@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} –</td>
+     *   <tr><td>{@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA}:</td>
      *       <td>Only the attributes relevant to the object functionality are compared.</td></tr>
-     *   <tr><td>{@link ComparisonMode#APPROXIMATIVE APPROXIMATIVE} –</td>
+     *   <tr><td>{@link ComparisonMode#APPROXIMATIVE APPROXIMATIVE}:</td>
      *       <td>Only the attributes relevant to the object functionality are compared,
      *           with some tolerance threshold on numerical values.</td></tr>
-     *   <tr><td>{@link ComparisonMode#DEBUG DEBUG} –</td>
+     *   <tr><td>{@link ComparisonMode#DEBUG DEBUG}:</td>
      *        <td>Special mode for figuring out why two objects expected to be equal
are not.</td></tr>
      * </table></blockquote>
      *

Modified: sis/branches/JDK7/src/main/javadoc/stylesheet.css
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/src/main/javadoc/stylesheet.css?rev=1566602&r1=1566601&r2=1566602&view=diff
==============================================================================
--- sis/branches/JDK7/src/main/javadoc/stylesheet.css (original)
+++ sis/branches/JDK7/src/main/javadoc/stylesheet.css Mon Feb 10 12:49:14 2014
@@ -74,6 +74,7 @@
   border-spacing: 0pt;
   padding:        0pt;
   line-height:    1em;
+  text-align:     left;
 }
 
 .contentContainer .block table.compact tr td
@@ -82,6 +83,7 @@
   padding-bottom: 0pt;
   padding-right:  3pt;
   padding-left:   3pt;
+  vertical-align: text-top;
 }
 
 /*

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java?rev=1566602&r1=1566601&r2=1566602&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java
[UTF-8] Mon Feb 10 12:49:14 2014
@@ -22,7 +22,6 @@ package org.apache.sis.storage.netcdf;
  * the compiled file of this class should have no dependency to the UCAR packages.
  */
 import java.io.Serializable;
-import ucar.nc2.Group;
 import ucar.nc2.NetcdfFile;
 import ucar.nc2.VariableSimpleIF;
 import ucar.nc2.constants.CF;



Mime
View raw message