sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1799452 [3/7] - in /sis/branches/JDK7: ./ core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-feature/src/test/java/org/apache/sis/feature/ core/sis-feature/sr...
Date Wed, 21 Jun 2017 14:11:41 GMT
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -28,6 +28,10 @@ import org.opengis.metadata.quality.Quan
 /**
  * Accuracy of quantitative attributes and the correctness of non-quantitative attributes
  * and of the classifications of features and their relationships.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_ThematicAccuracy}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -24,6 +24,10 @@ import org.opengis.metadata.quality.Abso
 
 /**
  * Closeness of reported coordinate values to values accepted as or being true.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_AbsoluteExternalPositionalAccuracy}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Accu
 
 /**
  * Correctness of the temporal references of an item (reporting of error in time measurement).
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_AccuracyOfATimeMeasurement}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Comp
 
 /**
  * Excess data present in the dataset, as described by the scope.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_CompletenessCommission}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Comp
 
 /**
  * Data absent from the dataset, as described by the scope.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_CompletenessOmission}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Conc
 
 /**
  * Adherence to rules of the conceptual schema.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_ConceptualConsistency}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -28,6 +28,14 @@ import org.apache.sis.util.iso.Types;
 /**
  * Information about the outcome of evaluating the obtained value (or set of values) against
  * a specified acceptable conformance quality level.
+ * The following properties are mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_ConformanceResult}
+ * {@code   ├─specification……………} Citation of product specification or user requirement against which data is being evaluated.
+ * {@code   │   ├─title………………………} Name by which the cited resource is known.
+ * {@code   │   └─date…………………………} Reference date for the cited resource.
+ * {@code   ├─explanation…………………} Explanation of the meaning of conformance for this result.
+ * {@code   └─pass……………………………………} Indication of the conformance result.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -30,6 +30,19 @@ import org.apache.sis.xml.Namespaces;
 
 /**
  * Result of a data quality measure organising the measured values as a coverage.
+ * The following properties are mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code QE_CoverageResult}
+ * {@code   ├─spatialRepresentationType……………………} Method used to spatially represent the coverage result.
+ * {@code   ├─resultSpatialRepresentation………………} Digital representation of data quality measures composing the coverage result.
+ * {@code   ├─resultContentDescription………………………} Description of the content of the result coverage, i.e. semantic definition of the data quality measures.
+ * {@code   │   └─attributeDescription………………………} Description of the attribute described by the measurement value.
+ * {@code   ├─resultFormat………………………………………………………} Information about the format of the result coverage data.
+ * {@code   │   └─formatSpecificationCitation……} Citation/URL of the specification format.
+ * {@code   │       ├─title……………………………………………………} Name by which the cited resource is known.
+ * {@code   │       └─date………………………………………………………} Reference date for the cited resource.
+ * {@code   └─resultFile……………………………………………………………} Information about the data file containing the result coverage data.
+ * {@code       └─fileFormat…………………………………………………} Defines the format of the transfer data file.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -24,15 +24,22 @@ import org.opengis.metadata.lineage.Line
 import org.opengis.metadata.quality.DataQuality;
 import org.opengis.metadata.quality.Element;
 import org.opengis.metadata.maintenance.Scope;
+import org.opengis.metadata.maintenance.ScopeCode;
 import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.metadata.iso.maintenance.DefaultScope;
 
 
 /**
  * Quality information for the data specified by a data quality scope.
+ * The following properties are mandatory in a well-formed metadata according ISO 19115:
  *
- * <div class="section">Relationship between properties</div>
- * According ISO 19115, at least one of {@linkplain #getLineage() lineage} and
- * {@linkplain #getReports() reports} shall be provided.
+ * <div class="preformat">{@code DQ_DataQuality}
+ * {@code   └─scope………………} The specific data to which the data quality information applies.
+ * {@code       └─level……} Hierarchical level of the data specified by the scope.</div>
+ *
+ * In addition, ISO requires that at least one of {@linkplain #getLineage() lineage}
+ * and {@linkplain #getReports() reports} is provided. Those properties are declared
+ * {@linkplain org.opengis.annotation.Obligation#CONDITIONAL conditional}.
  *
  * <div class="section">Limitations</div>
  * <ul>
@@ -88,6 +95,20 @@ public class DefaultDataQuality extends
     }
 
     /**
+     * Creates a data quality initialized to the given scope level.
+     * The scope level is, indirectly, a mandatory property in well-formed metadata.
+     *
+     * @param level  the hierarchical level of the data to which the quality information applies, or {@code null}.
+     *
+     * @since 0.5
+     */
+    public DefaultDataQuality(final ScopeCode level) {
+        if (level != null) {
+            scope = new DefaultScope(level);
+        }
+    }
+
+    /**
      * Creates a data quality initialized to the given scope.
      *
      * @param scope  the specific data to which the data quality information applies, or {@code null}.

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Doma
 
 /**
  * Adherence of values to the value domains.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_DomainConsistency}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Form
 
 /**
  * Degree to which data is stored in accordance with the physical structure of the dataset, as described by the scope.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_FormatConsistency}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Grid
 
 /**
  * Closeness of gridded data position values to values accepted as or being true.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_GriddedDataPositionalAccuracy}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.NonQ
 
 /**
  * Accuracy of non-quantitative attributes.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_NonQuantitativeAttributeAccuracy}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Quan
 
 /**
  * Accuracy of quantitative attributes.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_QuantitativeAttributeAccuracy}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -29,6 +29,11 @@ import org.opengis.util.RecordType;
 
 /**
  * Information about the value (or set of values) obtained from applying a data quality measure.
+ * The following properties are mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_QuantitativeResult}
+ * {@code   ├─valueUnit……………………} Value unit for reporting a data quality result.
+ * {@code   └─value………………………………} Quantitative value or values, content determined by the evaluation procedure used.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -24,6 +24,10 @@ import org.opengis.metadata.quality.Rela
 /**
  * Closeness of the relative positions of features in the scope to their respective
  * relative positions accepted as or being true.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_RelativeInternalPositionalAccuracy}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Temp
 
 /**
  * Correctness of ordered events or sequences, if reported.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_TemporalConsistency}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Temp
 
 /**
  * Validity of data specified by the scope with respect to time.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_TemporalValidity}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Them
 
 /**
  * Comparison of the classes assigned to features or their attributes to a universe of discourse.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_ThematicClassificationCorrectness}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,10 @@ import org.opengis.metadata.quality.Topo
 
 /**
  * Correctness of the explicitly encoded topological characteristics of the dataset as described by the scope.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code DQ_TopologicalConsistency}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -24,6 +24,10 @@ import org.apache.sis.xml.Namespaces;
 
 /**
  * Degree of adherence of a dataset to a specific set of user requirements.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code QE_Usability}
+ * {@code   └─result……………} Value obtained from applying a data quality measure.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -34,6 +34,11 @@ import static org.apache.sis.internal.me
 
 /**
  * Axis properties.
+ * The following properties are mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code MD_Dimension}
+ * {@code   ├─dimensionName……} Name of the axis.
+ * {@code   └─dimensionSize……} Number of elements along the axis.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>
@@ -239,12 +244,12 @@ public class DefaultDimension extends IS
     }
 
     /**
-     * Returns the enhancement/ modifier of the dimension name.
+     * Returns the enhancement / modifier of the dimension name.
      *
      * <div class="note"><b>Example:</b>
      * dimensionName = "column", dimensionTitle = "longitude"</div>
      *
-     * @return the enhancement/ modifier of the dimension name.
+     * @return the enhancement / modifier of the dimension name.
      *
      * @since 0.5
      */
@@ -255,9 +260,9 @@ public class DefaultDimension extends IS
     }
 
     /**
-     * Sets the enhancement/ modifier of the dimension name.
+     * Sets the enhancement / modifier of the dimension name.
      *
-     * @param  newValue  the new enhancement/ modifier of the dimension name.
+     * @param  newValue  the new enhancement / modifier of the dimension name.
      *
      * @since 0.5
      */

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCP.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCP.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCP.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -29,6 +29,10 @@ import org.apache.sis.xml.Namespaces;
 
 /**
  * Information on ground control point.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code MI_GCP}
+ * {@code   └─geographicCoordinates……} Geographic or map position of the control point, in either two or three dimensions.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCPCollection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCPCollection.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCPCollection.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCPCollection.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -30,6 +30,14 @@ import org.apache.sis.xml.Namespaces;
 
 /**
  * Information about a control point collection.
+ * The following properties are mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code MI_GCPCollection}
+ * {@code   ├─collectionIdentification………} Identifier of the GCP collection.
+ * {@code   ├─collectionName…………………………………} Name of the GCP collection.
+ * {@code   ├─coordinateReferenceSystem……} Coordinate system in which the ground control points are defined.
+ * {@code   └─gcp………………………………………………………………} Ground control point(s) used in the collection.
+ * {@code       └─geographicCoordinates……} Geographic or map position of the control point, in either two or three dimensions.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -29,6 +29,10 @@ import static org.apache.sis.internal.me
 
 /**
  * Number of objects, listed by geometric object type, used in the dataset.
+ * The following property is mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code MD_GeometricObjects}
+ * {@code   └─geometricObjectType……} Name of point and vector spatial objects used to locate zero-, one-, and two-dimensional spatial locations in the dataset.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -37,10 +37,24 @@ import org.apache.sis.xml.Namespaces;
  * Any cell in the grid can be geolocated given its grid coordinate and the grid origin, cell spacing,
  * and orientation indication of whether or not geographic.
  *
- * <div class="section">Relationship between properties</div>
- * Providing the {@linkplain #getCheckPointDescription() check point description} implies that
- * {@linkplain #isCheckPointAvailable() check point availability} is {@code true}. The setter
- * methods will ensure that this condition is not violated.
+ * <p>The following properties are mandatory or conditional (i.e. mandatory under some circumstances)
+ * in a well-formed metadata according ISO 19115:</p>
+ *
+ * <div class="preformat">{@code MD_Georectified}
+ * {@code   ├─numberOfDimensions…………………………………………………} Number of independent spatial-temporal axes.
+ * {@code   ├─axisDimensionProperties……………………………………} Information about spatial-temporal axis properties.
+ * {@code   │   ├─dimensionName……………………………………………………} Name of the axis.
+ * {@code   │   └─dimensionSize……………………………………………………} Number of elements along the axis.
+ * {@code   ├─cellGeometry…………………………………………………………………} Identification of grid data as point or cell.
+ * {@code   ├─transformationParameterAvailability……} Whether parameters for transformation exists.
+ * {@code   ├─checkPointAvailability………………………………………} Whether geographic position points are available to test the accuracy of the georeferenced grid data.
+ * {@code   ├─checkPointDescription…………………………………………} Description of geographic position points used to test the accuracy of the georeferenced grid data.
+ * {@code   ├─cornerPoints…………………………………………………………………} Earth location in the coordinate reference system and the grid coordinate of the cells at opposite ends.
+ * {@code   └─pointInPixel…………………………………………………………………} Point in a pixel corresponding to the Earth location of the pixel.</div>
+ *
+ * Providing the {@linkplain #getCheckPointDescription() check point description} implies
+ * that {@linkplain #isCheckPointAvailable() check point availability} is {@code true}.
+ * The setter methods will ensure that this condition is not violated.
  *
  * <div class="section">Limitations</div>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeoreferenceable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeoreferenceable.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeoreferenceable.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeoreferenceable.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -34,6 +34,20 @@ import org.apache.sis.xml.Namespaces;
  * Individual cells can be geolocated using geolocation information supplied with the data but cannot be
  * geolocated from the grid properties alone.
  *
+ * <p>The following properties are mandatory in a well-formed metadata according ISO 19115:</p>
+ *
+ * <div class="preformat">{@code MD_Georeferenceable}
+ * {@code   ├─numberOfDimensions…………………………………………………} Number of independent spatial-temporal axes.
+ * {@code   ├─axisDimensionProperties……………………………………} Information about spatial-temporal axis properties.
+ * {@code   │   ├─dimensionName……………………………………………………} Name of the axis.
+ * {@code   │   └─dimensionSize……………………………………………………} Number of elements along the axis.
+ * {@code   ├─cellGeometry…………………………………………………………………} Identification of grid data as point or cell.
+ * {@code   ├─transformationParameterAvailability……} Indication of whether or not parameters for transformation exists.
+ * {@code   ├─controlPointAvailability…………………………………} Indication of whether or not control point(s) exists.
+ * {@code   ├─orientationParameterAvailability……………} Indication of whether or not orientation parameters are available.
+ * {@code   ├─geolocationInformation………………………………………} Information that can be used to geolocate the data.
+ * {@code   └─georeferencedParameters……………………………………} Terms which support grid data georeferencing.</div>
+ *
  * <p><b>Limitations:</b></p>
  * <ul>
  *   <li>Instances of this class are not synchronized for multi-threading.

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -33,6 +33,15 @@ import static org.apache.sis.internal.me
 
 /**
  * Method used to represent geographic information in the dataset.
+ * The following properties are mandatory in a well-formed metadata according ISO 19115:
+ *
+ * <div class="preformat">{@code MD_GridSpatialRepresentation}
+ * {@code   ├─numberOfDimensions…………………………………………………} Number of independent spatial-temporal axes.
+ * {@code   ├─axisDimensionProperties……………………………………} Information about spatial-temporal axis properties.
+ * {@code   │   ├─dimensionName……………………………………………………} Name of the axis.
+ * {@code   │   └─dimensionSize……………………………………………………} Number of elements along the axis.
+ * {@code   ├─cellGeometry…………………………………………………………………} Identification of grid data as point or cell.
+ * {@code   └─transformationParameterAvailability……} Indication of whether or not parameters for transformation exists.</div>
  *
  * <p><b>Limitations:</b></p>
  * <ul>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataWriter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataWriter.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataWriter.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataWriter.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -101,7 +101,7 @@ import org.opengis.util.ControlledVocabu
  *       <td>{@code "columnCreationPolicy"}</td>
  *       <td>{@link ValueExistencePolicy}</td>
  *       <td>Whether columns should be created only for non-empty attributes ({@link ValueExistencePolicy#NON_EMPTY
- *           NON-EMPTY}, the default) or for all attributes ({@link ValueExistencePolicy#ALL ALL})</td>
+ *           NON_EMPTY}, the default) or for all attributes ({@link ValueExistencePolicy#ALL ALL})</td>
  *   </tr>
  * </table>
  *

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/package-info.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/package-info.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -43,7 +43,10 @@
  * @author  Touraïvane (IRD)
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @version 0.8
- * @since   0.8
+ *
+ * @see org.apache.sis.referencing.factory.sql
+ *
+ * @since 0.8
  * @module
  */
 package org.apache.sis.metadata.sql;

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=1799452&r1=1799451&r2=1799452&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] Wed Jun 21 14:11:39 2017
@@ -1506,7 +1506,17 @@ public enum CommonCRS {
      */
     public enum Temporal {
         /**
-         * Time measured as days since January 1st, 4713 BC at 12:00 UTC.
+         * Time measured as days since January 1st, 4713 BC at 12:00 UTC in proleptic Julian calendar.
+         * This epoch is equivalent to November 24, 4714 BC when expressed in the proleptic Gregorian
+         * calendar instead than the Julian one.
+         *
+         * <p><b>Note on dates formatting:</b>
+         * the legacy date/time formatting classes in the {@link java.text} package uses the proleptic
+         * Julian calendar for dates before October 15, 1582, while the new date/time formatting classes
+         * in the {@link java.time.format} package use the ISO-8601 calendar system, which is equivalent
+         * to the proleptic Gregorian calendar for every dates. For parsing and formatting of Julian days,
+         * the {@link java.text.SimpleDateFormat} class is closer to the common practice (but not ISO 8601
+         * compliant).</p>
          */
         JULIAN(Vocabulary.Keys.Julian, -2440588L * MILLISECONDS_PER_DAY + MILLISECONDS_PER_DAY/2),
 

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -81,8 +81,11 @@
  * @author  Jody Garnett (Refractions)
  * @author  Didier Richard (IGN)
  * @author  John Grange
- * @version 0.7
- * @since   0.7
+ * @version 0.8
+ *
+ * @see org.apache.sis.metadata.sql
+ *
+ * @since 0.7
  * @module
  */
 package org.apache.sis.referencing.factory.sql;

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransformSeparator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransformSeparator.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransformSeparator.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransformSeparator.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -541,7 +541,7 @@ public class TransformSeparator {
              * not accept arbitrary index for modified ordinates.
              */
             if (containsAll(dimensions, lower, subLower) && containsAll(dimensions, subUpper, upper)) {
-                return factory.createPassThroughTransform(subLower - lower, subTransform, upper - subUpper);
+                return factory.createPassThroughTransform(subLower - lower, subTransform, Math.max(0, upper - subUpper));
             }
         }
         /*
@@ -679,7 +679,7 @@ reduce:     for (int j=0; j <= numTgt; j
      * @return {@code true} if the full range was found in the sequence.
      */
     private static boolean containsAll(final int[] sequence, final int lower, int upper) {
-        if (lower == upper) {
+        if (lower >= upper) {
             return true;
         }
         if (sequence != null) {

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -23,6 +23,7 @@ import java.util.List;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.io.IOException;
+import javax.measure.Unit;
 import org.opengis.util.FactoryException;
 import org.opengis.util.GenericName;
 import org.opengis.metadata.extent.GeographicBoundingBox;
@@ -46,6 +47,7 @@ import org.apache.sis.referencing.CRS;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.Characters;
 import org.apache.sis.util.Numbers;
+import org.apache.sis.util.Version;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.JDK8;
@@ -166,16 +168,24 @@ public strictfp class CoordinateOperatio
         rangeFormat = new RangeFormat(LOCALE);
         final int header = openTag("header");
         println("h1", "Apache SIS™ Coordinate Operation Methods");
-        openTag("p");
-        println("The following tables summarize the coordinate operation methods known to Apache SIS, together with the recognized parameters.");
-        println("Unless otherwise noticed, all parameters are mandatory");
-        println("(in the sense that they should always be shown in forms, regardless of whether they have default value),");
-        println("but two of them are handled in a special way: the <code>semi-major</code> and <code>semi-minor</code> parameters.");
-        println("Those two parameters are needed for all map projections, but usually do not need to be specified explicitely since they are inferred from the ellipsoid.");
-        println("The only exception is when <a href=\"http://sis.apache.org/apidocs/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.html\">creating parameterized transforms directly</a>.");
-        reopenTag("p");
-        println("All map projections support also implicit <code>earth_radius</code> and <code>inverse_flattening</code> parameters (not shown below).");
-        println("Read and write operations on those implicit parameters are delegated to the <code>semi-major</code> and <code>semi-minor</code> parameters.");
+        int item = openTag("p");
+        println("The following tables summarize the coordinate operation methods known to Apache SIS " + Version.SIS);
+        println("together with the recognized parameters. There is three kinds of parameters:");
+        closeTags(item);
+        openTag("ul", "verbose");
+        openTag("li");
+        println("The <code>semi-major</code> and <code>semi-minor</code> parameters are needed for all map projections,");
+        println("but usually do not need to be specified explicitely since they are inferred from the ellipsoid");
+        println("(unless <a href=\"http://sis.apache.org/apidocs/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.html\">creating parameterized transforms directly</a>).");
+        println("For this reason, those parameters are usually not shown in <a href=\"http://www.epsg-registry.org\">EPSG registry</a>");
+        println("or <a href=\"http://docs.opengeospatial.org/is/12-063r5/12-063r5.html\">Well Known Text</a> (WKT) definitions.");
+        reopenTag("li");
+        println("The <code>earth_radius</code> and <code>inverse_flattening</code> parameters (not shown below) are implicitly supported by all map projections.");
+        println("They are other ways to specify the ellipsoid (actually rarely used).");
+        println("Read and write operations on those implicit parameters are converted into equivalent operations on <code>semi-major</code> and <code>semi-minor</code> parameters.");
+        reopenTag("li");
+        println("Unless otherwise noticed, all other parameters are mandatory");
+        println("(in the sense that they should always be shown in forms, regardless of whether they have default value).");
         closeTags(header);
     }
 
@@ -187,7 +197,7 @@ public strictfp class CoordinateOperatio
      */
     public void writeIndex(final Iterable<? extends OperationMethod> methods) throws IOException {
         final int nav = openTag("nav");
-        println("p", "<b>Table of content:</b>");
+        println("h2", "Table of content:");
         int innerUL  = openTag("ul") + 1;
         int category = 0;
         for (final OperationMethod method : methods) {
@@ -318,8 +328,13 @@ public strictfp class CoordinateOperatio
      */
     private void writeParameters(final ParameterDescriptorGroup group) throws IOException {
         int table = openTag("table class=\"param\"");
-        println("caption", "Operation parameters:");
+        println("caption", "Operation parameters:");
         openTag("tr");
+        if (group.descriptors().isEmpty()) {
+            println("td", "None");
+            closeTags(table);
+            return;
+        }
         println("th", "EPSG");
         println("th class=\"sep\"", "Name");
         println("th class=\"sep\"", "Remarks");
@@ -387,8 +402,8 @@ public strictfp class CoordinateOperatio
         if (Constants.EPSG.equalsIgnoreCase(codeSpace)) {
             println("summary", escape(name.getCode()));
         } else {
-            println("summary", "<span class=\"non-epsg\">" + codeSpace
-                    + ":</span><code>" + name.getCode() + "</code>");
+            println("summary", "<span class=\"non-epsg\">" + codeSpace + ":</span>" +
+                               "<code>" + name.getCode() + "</code>");
         }
         openTag("table class=\"aliases\"");
         for (final GenericName alias : param.getAlias()) {
@@ -492,12 +507,15 @@ public strictfp class CoordinateOperatio
      * or an empty string (never {@code null}) if none.
      */
     private static String getUnit(final ParameterDescriptor<?> param) {
-        final String unit = param.getUnit().toString();
-        if (!unit.isEmpty()) {
-            if (unit.equals("°")) {
-                return unit;
+        final Unit<?> unit = param.getUnit();
+        if (unit != null) {
+            final String symbol = unit.toString();
+            if (!symbol.isEmpty()) {
+                if (symbol.equals("°")) {
+                    return symbol;
+                }
+                return " " + symbol;
             }
-            return " " + unit;
         }
         return "";
     }
@@ -548,7 +566,7 @@ public strictfp class CoordinateOperatio
         if (id == null) {
             id = method.getName().getCode();
         }
-        return id;
+        return id.replace(" ", "_");
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -156,9 +156,26 @@ abstract strictfp class HTMLGenerator im
      * @throws IOException if an error occurred while writing to the file.
      */
     final int openTag(final String tag) throws IOException {
+        return openTag(tag, null);
+    }
+
+    /**
+     * Opens a new HTML tag of the given class and increase the indentation.
+     *
+     * @param  tag     the HTML tag without brackets (e.g. {@code "h2"}).
+     * @param  classe  the CSS class, or {@code null} if none.
+     * @return the value to give to {@link #closeTags(int)} for closing the tags.
+     * @throws IOException if an error occurred while writing to the file.
+     */
+    final int openTag(final String tag, final String classe) throws IOException {
         out.write(margin);
         out.write('<');
         out.write(tag);
+        if (classe != null) {
+            out.write(" class=\"");
+            out.write(classe);
+            out.write('"');
+        }
         out.write('>');
         out.newLine();
         margin = CharSequences.spaces(margin.length() + INDENTATION).toString();

Added: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/ISOCalendar.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/ISOCalendar.java?rev=1799452&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/ISOCalendar.java (added)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/ISOCalendar.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.util;
+
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.Locale;
+import java.util.TimeZone;
+
+
+/**
+ * A calendar that simulates the ISO 8601 rules used by {@code java.time} packages.
+ * This is used for compatibility on the JDK7 branch only.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 0.8
+ * @since   0.8
+ * @module
+ */
+final class ISOCalendar extends GregorianCalendar {
+    /**
+     * For cross-version compatibility.
+     * This number must be different between the JDK8 branch and pre-JDK8 branches.
+     */
+    private static final long serialVersionUID = 9109360831315522569L;
+
+    /**
+     * Creates a new calendar.
+     */
+    ISOCalendar(final Locale locale, final TimeZone zone) {
+        super(zone, locale);
+        setGregorianChange(new Date(Long.MIN_VALUE));       // Set pure Gregorian calendar (no change date).
+    }
+
+    /**
+     * Returns the value of the given calendar field.
+     */
+    @Override
+    public int get(final int field) {
+        int value = super.get(field);
+        if (field == YEAR && super.get(ERA) == BC) {
+            value = 1 - value;
+        }
+        return value;
+    }
+}

Propchange: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/ISOCalendar.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/ISOCalendar.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -144,7 +144,7 @@ public final class StandardDateFormat ex
      */
     public StandardDateFormat(final Locale locale, final TimeZone zone) {
         super(PATTERN, locale);
-        super.setTimeZone(zone);
+        calendar = new ISOCalendar(locale, zone);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/SequenceVector.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/SequenceVector.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/SequenceVector.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/SequenceVector.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -19,6 +19,7 @@ package org.apache.sis.math;
 import java.util.Arrays;
 import java.io.Serializable;
 import org.apache.sis.measure.NumberRange;
+import org.apache.sis.util.Numbers;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
 
@@ -36,7 +37,12 @@ abstract class SequenceVector extends Ve
     /**
      * For cross-version compatibility.
      */
-    private static final long serialVersionUID = 7980737287789566091L;
+    private static final long serialVersionUID = 2544089499300079707L;
+
+    /**
+     * The type of values in the vector.
+     */
+    final Class<? extends Number> type;
 
     /**
      * The length of this vector.
@@ -46,7 +52,8 @@ abstract class SequenceVector extends Ve
     /**
      * Creates a sequence of numbers of the given length.
      */
-    SequenceVector(final int length) {
+    SequenceVector(final Class<? extends Number> type, final int length) {
+        this.type   = type;
         this.length = length;
         if (length < 0) {
             throw new IllegalArgumentException(Errors.format(
@@ -55,6 +62,14 @@ abstract class SequenceVector extends Ve
     }
 
     /**
+     * Returns the type of elements.
+     */
+    @Override
+    public final Class<? extends Number> getElementType() {
+        return type;
+    }
+
+    /**
      * {@code SequenceVector} values are always interpreted as signed values.
      */
     @Override
@@ -137,24 +152,20 @@ abstract class SequenceVector extends Ve
         /**
          * Creates a sequence of numbers in a given range of values using the given increment.
          *
+         * @param  type       the type of elements in the sequence.
          * @param  first      the first value, inclusive.
          * @param  increment  the difference between the values at two adjacent indexes.
          * @param  length     the length of the vector.
          */
-        Doubles(final Number first, final Number increment, final int length) {
-            super(length);
+        Doubles(final Class<? extends Number> type, final Number first, final Number increment, final int length) {
+            super(type, length);
             this.first     = first.doubleValue();
             this.increment = increment.doubleValue();
         }
 
         /** Creates a new sequence for a subrange of this vector. */
         @Override Vector createSubSampling(final int offset, final int step, final int n) {
-            return new Doubles(doubleValue(offset), increment*step, n);
-        }
-
-        /** Returns the type of elements. */
-        @Override public Class<Double> getElementType() {
-            return Double.class;
+            return new Doubles(type, doubleValue(offset), increment*step, n);
         }
 
         /** Returns {@code true} if this vector contains only integer values. */
@@ -187,23 +198,24 @@ abstract class SequenceVector extends Ve
 
         /** Computes the value at the given index. */
         @Override public Number get(final int index) {
-            return doubleValue(index);
+            return Numbers.wrap(doubleValue(index), type);
         }
 
         /** Returns the increment between all consecutive values */
         @Override public Number increment(final double tolerance) {
-            return increment;
+            return Numbers.wrap(increment, type);
         }
 
         /** Computes the minimal and maximal values in this vector. */
-        @Override public NumberRange<Double> range() {
+        @SuppressWarnings({"unchecked","rawtypes"})
+        @Override public NumberRange<?> range() {
             double min = first;
             double max = first + increment * (length - 1);
             if (max < min) {
                 min = max;
                 max = first;
             }
-            return NumberRange.create(min, true, max, true);
+            return new NumberRange(type, Numbers.wrap(min, type), true, Numbers.wrap(max, type), true);
         }
     }
 
@@ -231,24 +243,20 @@ abstract class SequenceVector extends Ve
         /**
          * Creates a sequence of numbers in a given range of values using the given increment.
          *
+         * @param  type       the type of elements in the sequence.
          * @param  first      the first value, inclusive.
          * @param  increment  the difference between the values at two adjacent indexes.
          * @param  length     the length of the vector.
          */
-        Longs(final Number first, final Number increment, final int length) {
-            super(length);
+        Longs(final Class<? extends Number> type, final Number first, final Number increment, final int length) {
+            super(type, length);
             this.first     = first.longValue();
             this.increment = increment.longValue();
         }
 
         /** Creates a new sequence for a subrange of this vector. */
         @Override Vector createSubSampling(final int offset, final int step, final int n) {
-            return new Longs(longValue(offset), increment*step, n);
-        }
-
-        /** Returns the type of elements. */
-        @Override public Class<Long> getElementType() {
-            return Long.class;
+            return new Longs(type, longValue(offset), increment*step, n);
         }
 
         /** Returns {@code true} since this vector contains only integer values. */
@@ -284,23 +292,24 @@ abstract class SequenceVector extends Ve
 
         /** Computes the value at the given index. */
         @Override public Number get(final int index) {
-            return longValue(index);
+            return Numbers.wrap(longValue(index), type);
         }
 
         /** Returns the increment between all consecutive values */
         @Override public Number increment(final double tolerance) {
-            return increment;
+            return Numbers.wrap(increment, type);
         }
 
         /** Computes the minimal and maximal values in this vector. */
-        @Override public NumberRange<Long> range() {
+        @SuppressWarnings({"unchecked","rawtypes"})
+        @Override public NumberRange<?> range() {
             long min = first;
             long max = first + increment * (length - 1);
             if (max < min) {
                 min = max;
                 max = first;
             }
-            return NumberRange.create(min, true, max, true);
+            return new NumberRange(type, Numbers.wrap(min, type), true, Numbers.wrap(max, type), true);
         }
     }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -175,12 +175,19 @@ public abstract class Vector extends Abs
         type = Numbers.widestClass(first, increment);
         type = Numbers.widestClass(type,
                Numbers.narrowestClass(first.doubleValue() + increment.doubleValue() * (length-1)));
+        return createSequence(type, first, increment, length);
+    }
+
+    /**
+     * Creates a sequence of the given type.
+     */
+    static Vector createSequence(final Class<? extends Number> type, final Number first, final Number increment, final int length) {
         final int t = Numbers.getEnumConstant(type);
         if (t >= Numbers.BYTE && t <= Numbers.LONG) {
             // Use the long type if possible because not all long values can be represented as double.
-            return new SequenceVector.Longs(first, increment, length);
+            return new SequenceVector.Longs(type, first, increment, length);
         } else {
-            return new SequenceVector.Doubles(first, increment, length);
+            return new SequenceVector.Doubles(type, first, increment, length);
         }
     }
 
@@ -982,7 +989,7 @@ public abstract class Vector extends Abs
         final int length = size();
         final Number inc = increment(tolerance);
         if (inc != null) {
-            return createSequence(get(0), inc, length);
+            return createSequence(getElementType(), get(0), inc, length);
         }
         /*
          * Verify if the vector contains only NaN values. This extra check is useful because 'increment()'
@@ -993,7 +1000,7 @@ public abstract class Vector extends Abs
             if (!isNaN(i)) return this;
         }
         final Double NaN = Numerics.valueOf(Double.NaN);
-        return new SequenceVector.Doubles(NaN, NaN, length);
+        return new SequenceVector.Doubles(getElementType(), NaN, NaN, length);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -85,6 +85,12 @@ public class UnitFormat extends Format i
     private static final long serialVersionUID = -3064428584419360693L;
 
     /**
+     * The unit name for degrees (not necessarily angular), to be handled in a special way.
+     * Must contain only ASCII lower case letters ([a … z]).
+     */
+    private static final String DEGREES = "degrees";
+
+    /**
      * The unit name for dimensionless unit.
      */
     static final String UNITY = "unity";
@@ -453,8 +459,9 @@ public class UnitFormat extends Format i
      *
      * <p>While we said that {@code UnitFormat} is not thread safe, we make an exception for this method
      * for allowing the singleton {@link #INSTANCE} to parse symbols in a multi-threads environment.</p>
+     *
+     * @param  uom  the unit symbol, without leading or trailing spaces.
      */
-    @SuppressWarnings("fallthrough")
     private Unit<?> fromName(String uom) {
         /*
          * Before to search in resource bundles, check for degrees units. The "deg" unit can be both angular
@@ -462,20 +469,38 @@ public class UnitFormat extends Format i
          * special case for the degrees units because SI symbols are case-sentive and unit names in resource
          * bundles are case-insensitive, but the "deg" case is a mix of both.
          */
-        if (uom.regionMatches(true, 0, "deg", 0, 3)) {
-            final int length = uom.length();
-            switch (length) {
-                case 3: return Units.DEGREE;                    // Exactly "deg"  (ignoring case)
-                case 5: final char c = uom.charAt(3);
-                        if (c != '_' && !Character.isSpaceChar(c)) break;
-                        // else fallthrough
-                case 4: switch (uom.charAt(length - 1)) {
-                            case 'K':                           // Unicode U+212A
-                            case 'K': return Units.KELVIN;      // Exactly "degK" (ignoring case except for 'K')
-                            case 'C': return Units.CELSIUS;
-                        }
+        final int length = uom.length();
+        for (int i=0; ; i++) {
+            if (i != DEGREES.length()) {
+                if (i != length && (uom.charAt(i) | ('a' - 'A')) == DEGREES.charAt(i)) {
+                    continue;                           // Loop as long as the characters are the same, ignoring case.
+                }
+                if (i != 3 && i != 6) {
+                    break;                              // Exit if not "deg" (3) or "degree" (6 characters).
+                }
+            }
+            if (length == i) {
+                return Units.DEGREE;                    // Exactly "deg", "degree" or "degrees" (ignoring case).
+            }
+            final int c = uom.codePointAt(i);
+            if (c == '_' || Character.isSpaceChar(c)) {
+                i += Character.charCount(c);            // Ignore space in "degree C", "deg C", "deg K", etc.
+            }
+            if (length - i == 1) {
+                switch (uom.charAt(i)) {
+                    case 'K':                           // Unicode U+212A
+                    case 'K': return Units.KELVIN;      // "degK" (ignoring case except for 'K')
+                    case 'C': return Units.CELSIUS;
+                    case 'N':                           // degree_N, degrees_N, degreeN, degreesN.
+                    case 'E': return Units.DEGREE;      // degree_E, degrees_E, degreeE, degreesE.
+                }
             }
+            break;
         }
+        /*
+         * At this point, we determined that the given unit symbol is not degrees (of angle or of temperature).
+         * Remaining code is generic to all other kinds of units: a check in a HashMap loaded when first needed.
+         */
         Map<String,Unit<?>> map = nameToUnit;
         if (map == null) {
             map = SHARED.get(locale);
@@ -520,7 +545,7 @@ public class UnitFormat extends Format i
         uom = CharSequences.replace(CharSequences.replace(CharSequences.replace(CharSequences.toASCII(uom),
                 "meters",  "meter"),
                 "metres",  "metre"),
-                "degrees", "degree").toString();
+                 DEGREES,  "degree").toString();
         return map.get(uom);
     }
 
@@ -782,14 +807,32 @@ public class UnitFormat extends Format i
     }
 
     /**
-     * Returns {@code true} if the {@code '*'} character at the given index is surrounded by digits
-     * or a sign on its right side. For example this method returns {@code true} for "10*-6", which
-     * means 1E-6 in UCUM syntax. This check is used for heuristic rules at parsing time.
-     */
-    private static boolean isExponentOperator(final CharSequence symbols, int i, final int length) {
-        char c;
-        return (i != 0) && isDigit(symbols.charAt(i-1)) &&
-               (++i < length) && (isDigit(c = symbols.charAt(i)) || isSign(c));
+     * Returns {@code 0} or {@code 1} if the {@code '*'} character at the given index stands for exponentiation
+     * instead than multiplication, or a negative value if the character stands for multiplication. This check
+     * is used for heuristic rules at parsing time. Current implementation applies the following rules:
+     *
+     * <ul>
+     *   <li>The operation is presumed an exponentiation if the '*' symbol is doubled, as in {@code "m**s-1"}.</li>
+     *   <li>The operation is presumed an exponentiation if it is surrounded by digits or a sign on its right side.
+     *       Example: {@code "10*-6"}, which means 1E-6 in UCUM syntax.</li>
+     *   <li>All other cases are currently presumed multiplication.
+     *       Example: {@code "m*s"}.</li>
+     * </ul>
+     *
+     * @return -1 for parsing as a multiplication, or a positive value for exponentiation.
+     *         If positive, this is the number of characters in the exponent symbol minus 1.
+     */
+    private static int exponentOperator(final CharSequence symbols, int i, final int length) {
+        if (i >= 0 && ++i < length) {
+            final char c = symbols.charAt(i);
+            if (c == Style.EXPONENT_OR_MULTIPLY) {
+                return 1;                               // "**" operator: need to skip one character after '*'.
+            }
+            if ((isDigit(c) || isSign(c)) && isDigit(symbols.charAt(i-2))) {
+                return 0;                               // "*" operator surrounded by digits: no character to skip.
+            }
+        }
+        return -1;
     }
 
     /**
@@ -986,10 +1029,12 @@ scan:   for (int n; i < end; i += n) {
                  * a unit symbol.
                  */
                 case Style.EXPONENT_OR_MULTIPLY: {
-                    if (!isExponentOperator(symbols, i, end)) {
+                    final int w = exponentOperator(symbols, i, end);
+                    if (w < 0) {
                         next = MULTIPLY;
                         break;
                     }
+                    i += w;
                     // else fall through.
                 }
                 case Style.EXPONENT: {
@@ -1039,7 +1084,7 @@ scan:   for (int n; i < end; i += n) {
              * the above 'switch' statement all cases that end with 'break', not 'break scan' or 'continue').
              */
             if (operation != IMPLICIT) {
-                unit = apply(operation, unit, parseSymbol(symbols, start, i));
+                unit = apply(operation, unit, parseTerm(symbols, start, i));
             }
             hasSpaces = false;
             operation = next;
@@ -1085,7 +1130,7 @@ search:     while ((i = CharSequences.sk
             }
         }
         if (component == null) {
-            component = parseSymbol(symbols, start, i);
+            component = parseTerm(symbols, start, i);
         }
         unit = apply(operation, unit, component);
         position.setIndex(endOfURI >= 0 ? endOfURI : i);
@@ -1125,7 +1170,8 @@ search:     while ((i = CharSequences.sk
      * @return the parsed unit symbol (never {@code null}).
      * @throws ParserException if a problem occurred while parsing the given symbols.
      */
-    private Unit<?> parseSymbol(final CharSequence symbols, final int lower, final int upper) throws ParserException {
+    @SuppressWarnings("fallthrough")
+    private Unit<?> parseTerm(final CharSequence symbols, final int lower, final int upper) throws ParserException {
         final String uom = CharSequences.trimWhitespaces(symbols, lower, upper).toString();
         /*
          * Check for labels explicitly given by users. Those labels have precedence over the Apache SIS hard-coded
@@ -1157,11 +1203,11 @@ search:     while ((i = CharSequences.sk
                                 final int next = CharSequences.skipLeadingWhitespaces(uom, s, length);
                                 if (next < length && AbstractUnit.isSymbolChar(uom.codePointAt(next))) {
                                     multiplier = Double.parseDouble(uom.substring(0, s));
-                                    return parseSymbol(uom, s, length).multiply(multiplier);
+                                    return parseTerm(uom, s, length).multiply(multiplier);
                                 }
                             }
-                            s = uom.lastIndexOf(Style.EXPONENT_OR_MULTIPLY);
-                            if (s >= 0) {
+                            s = uom.lastIndexOf(Style.EXPONENT_OR_MULTIPLY);      // Check standard UCUM symbol first.
+                            if (s >= 0 || (s = uom.lastIndexOf(Style.EXPONENT)) >= 0) {
                                 final int base = Integer.parseInt(uom.substring(0, s));
                                 final int exp  = Integer.parseInt(uom.substring(s+1));
                                 multiplier = Math.pow(base, exp);
@@ -1209,7 +1255,24 @@ search:     while ((i = CharSequences.sk
                         } while (i != 0);
                     }
                     if (canApply) {
-                        unit = getPrefixed(CharSequences.trimWhitespaces(uom, 0, i).toString());
+                        /*
+                         * At this point we have parsed the exponent. Before to parse the raw unit symbol,
+                         * skip the exponent symbol (^, * or **) if any.
+                         */
+                        i = CharSequences.skipTrailingWhitespaces(uom, 0, i);
+                        if (i != 0) {
+                            switch (uom.charAt(i-1)) {
+                                case Style.EXPONENT_OR_MULTIPLY: {
+                                    if (i != 1 && uom.charAt(i-2) == Style.EXPONENT_OR_MULTIPLY) i--;
+                                    // Fallthrough for skipping the next character and whitespaces.
+                                }
+                                case Style.EXPONENT: {
+                                    i = CharSequences.skipTrailingWhitespaces(uom, 0, i - 1);
+                                    break;
+                                }
+                            }
+                        }
+                        unit = getPrefixed(uom.substring(CharSequences.skipLeadingWhitespaces(uom, 0, i), i));
                         if (unit != null) {
                             return unit.pow(power);
                         }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -651,7 +651,7 @@ search:     for (; fromIndex <= toIndex;
         }
         if (separator == '\n' || separator == '\r') {
             final CharSequence[] splitted = splitOnEOL(text);
-            for (int i=0; i<splitted.length; i++) {
+            for (int i=0; i < splitted.length; i++) {
                 // For consistency with the rest of this method.
                 splitted[i] = trimWhitespaces(splitted[i]);
             }
@@ -1006,7 +1006,7 @@ search:     for (; fromIndex <= toIndex;
         if (text != null) {
             lower = skipLeadingWhitespaces (text, lower, upper);
             upper = skipTrailingWhitespaces(text, lower, upper);
-            if (lower != 0 || upper != length) { // Safety in case subSequence doesn't make the check.
+            if (lower != 0 || upper != length) {                  // Safety in case subSequence doesn't make the check.
                 text = text.subSequence(lower, upper);
             }
         }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -37,7 +37,7 @@ import static java.lang.Double.doubleToL
  * Static methods working with {@link Number} objects, and a few primitive types by extension.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.3
+ * @version 0.8
  *
  * @see org.apache.sis.math.MathFunctions
  *
@@ -559,7 +559,7 @@ public final class Numbers extends Stati
     }
 
     /**
-     * Wraps the given value in a {@code Number} of the specified class.
+     * Wraps the given floating-point value in a {@code Number} of the specified class.
      * The given type shall be one of {@link Byte}, {@link Short}, {@link Integer}, {@link Long},
      * {@link Float}, {@link Double}, {@link BigInteger} and {@link BigDecimal} classes.
      * Furthermore, the given value shall be convertible to the given class without precision lost,
@@ -592,6 +592,44 @@ public final class Numbers extends Stati
             throw new IllegalArgumentException(Errors.format(Errors.Keys.CanNotConvertValue_2, value, type));
         }
         return number;
+    }
+
+    /**
+     * Wraps the given integer value in a {@code Number} of the specified class.
+     * The given type shall be one of {@link Byte}, {@link Short}, {@link Integer}, {@link Long},
+     * {@link Float}, {@link Double}, {@link BigInteger} and {@link BigDecimal} classes.
+     * Furthermore, the given value shall be convertible to the given class without precision lost,
+     * otherwise an {@link IllegalArgumentException} will be thrown.
+     *
+     * @param  <N>    the wrapper class.
+     * @param  value  the value to wrap.
+     * @param  type   the desired wrapper class.
+     * @return the value wrapped in an object of the given class.
+     * @throws IllegalArgumentException if the given type is not one of the primitive wrappers for numeric types,
+     *         or if the given value can not be wrapped in an instance of the given class without precision lost.
+     *
+     * @since 0.8
+     */
+    @SuppressWarnings("unchecked")
+    public static <N extends Number> N wrap(final long value, final Class<N> type)
+            throws IllegalArgumentException
+    {
+        final N number;
+        switch (getEnumConstant(type)) {
+            case BYTE:        number = (N) Byte      .valueOf((byte)   value); break;
+            case SHORT:       number = (N) Short     .valueOf((short)  value); break;
+            case INTEGER:     number = (N) Integer   .valueOf((int)    value); break;
+            case LONG:        return   (N) Long      .valueOf(value);  // No need to verify.
+            case FLOAT:       number = (N) Float     .valueOf((float)  value); break;
+            case DOUBLE:      number = (N) Numerics  .valueOf((double) value); break;
+            case BIG_INTEGER: return   (N) BigInteger.valueOf(value);  // No need to verify.
+            case BIG_DECIMAL: return   (N) BigDecimal.valueOf(value);  // No need to verify.
+            default: throw unknownType(type);
+        }
+        if (number.longValue() != value) {
+            throw new IllegalArgumentException(Errors.format(Errors.Keys.CanNotConvertValue_2, value, type));
+        }
+        return number;
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -316,9 +316,11 @@ public abstract class AbstractName imple
             }
             asString = buffer.toString();
         }
-        // Note: there is no need to invoke InternationalString.toString(Locale.ROOT) for
-        // the unlocalized version, because our International inner class is implemented in
-        // such a way that InternationalString.toString() returns AbstractName.toString().
+        /*
+         * Note: there is no need to invoke InternationalString.toString(Locale.ROOT) for
+         * the unlocalized version, because our International inner class is implemented in
+         * such a way that InternationalString.toString() returns AbstractName.toString().
+         */
         return asString.toString();
     }
 



Mime
View raw message