sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1652014 - in /sis/branches/JDK8/core: sis-feature/src/main/java/org/apache/sis/feature/ sis-referencing/src/main/java/org/apache/sis/referencing/ sis-utility/src/main/java/org/apache/sis/internal/simple/
Date Thu, 15 Jan 2015 09:50:19 GMT
Author: desruisseaux
Date: Thu Jan 15 09:50:19 2015
New Revision: 1652014

URL: http://svn.apache.org/r1652014
Log:
Update for GeoAPI change: Attribute[Type].characteristics() now provided in the interfaces.

Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttributeType.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java?rev=1652014&r1=1652013&r2=1652014&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
[UTF-8] Thu Jan 15 09:50:19 2015
@@ -277,8 +277,12 @@ public abstract class AbstractAttribute<
      * all the "standard" characteristics and need no special processing.</div>
      *
      * {@section Reading a characteristic}
-     * If an attribute is known to be a measurement with a characteristic named "accuracy"
of type {@link Float},
-     * then the accuracy value could be read as below:
+     * The characteristic values are enumerated in the {@linkplain Map#values() map values}.
+     * The {@linkplain Map#keySet() map keys} are the {@code String} representations of characteristics
+     * {@linkplain DefaultAttributeType#getName() name}, for more convenient lookups.
+     *
+     * <p>If an attribute is known to be a measurement with a characteristic named
"accuracy"
+     * of type {@link Float}, then the accuracy value could be read as below:</p>
      *
      * {@preformat java
      *     Float getAccuracy(Attribute<?> measurement) {
@@ -325,10 +329,11 @@ public abstract class AbstractAttribute<
      *     }</li>
      * </ol>
      *
-     * @return Other attribute types that describes this attribute type, or an empty set
if none.
+     * @return Other attribute types that describes this attribute type, or an empty map
if none.
      *
      * @see DefaultAttributeType#characteristics()
      */
+    @Override
     public Map<String,Attribute<?>> characteristics() {
         if (characteristics == null) {
             characteristics = newCharacteristicsMap();

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java?rev=1652014&r1=1652013&r2=1652014&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
[UTF-8] Thu Jan 15 09:50:19 2015
@@ -129,6 +129,7 @@ public abstract class AbstractFeature im
      * @throws IllegalArgumentException If the given argument is not a property name of this
feature.
      *
      * @see #getPropertyValue(String)
+     * @see DefaultFeatureType#getProperty(String)
      */
     @Override
     public abstract Property getProperty(final String name) throws IllegalArgumentException;

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttributeType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttributeType.java?rev=1652014&r1=1652013&r2=1652014&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttributeType.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttributeType.java
[UTF-8] Thu Jan 15 09:50:19 2015
@@ -65,6 +65,8 @@ import org.opengis.feature.AttributeType
  * (e.g. air temperature) may have another attribute that holds the measurement accuracy
(e.g. ±0.1°C).
  * The accuracy value is often constant for all instances of that attribute
  * (e.g. for all temperature measurements in the same dataset), but this is not mandatory.
+ *
+ * <div class="note"><b>Design note:</b>
  * Such accuracy could be stored as an ordinary, independent, attribute (like an other column
in a table),
  * but storing accuracy as a {@linkplain #characteristics() characteristic} of the measurement
attribute instead
  * provides the following advantages:
@@ -77,6 +79,7 @@ import org.opengis.feature.AttributeType
  *   <li>In the common case of a {@linkplain DefaultFeatureType#isSimple() simple feature}
with characteristics
  *       that are constants, declaring them as attribute characteristics allows to specify
the constants only once.</li>
  * </ul>
+ * </div>
  *
  * Constant values of characteristics are given by their {@linkplain #getDefaultValue() default
value}.
  * It is still possible for any specific {@code Attribute} instance to specify their own
value,
@@ -291,10 +294,15 @@ public class DefaultAttributeType<V> ext
      * shall hold that constant.
      * </div>
      *
-     * @return Other attribute types that describes this attribute type, or an empty set
if none.
+     * The characteristics are enumerated in the {@linkplain Map#values() map values}.
+     * The {@linkplain Map#keySet() map keys} are the {@code String} representations
+     * of characteristics {@linkplain #getName() name}, for more convenient lookups.
+     *
+     * @return Other attribute types that describes this attribute type, or an empty map
if none.
      *
      * @see AbstractAttribute#characteristics()
      */
+    @Override
     public Map<String,AttributeType<?>> characteristics() {
         return (characteristics != null) ? characteristics : Collections.emptyMap();
     }

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java?rev=1652014&r1=1652013&r2=1652014&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
[UTF-8] Thu Jan 15 09:50:19 2015
@@ -654,6 +654,8 @@ public class DefaultFeatureType extends
      * @param  name The name of the property to search.
      * @return The property for the given name, or {@code null} if none.
      * @throws IllegalArgumentException If the given argument is not a property name of this
feature.
+     *
+     * @see AbstractFeature#getProperty(String)
      */
     @Override
     public PropertyType getProperty(final String name) throws IllegalArgumentException {

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1652014&r1=1652013&r2=1652014&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
[UTF-8] Thu Jan 15 09:50:19 2015
@@ -466,7 +466,7 @@ public class AbstractIdentifiedObject ex
         if (identifiers != null) {
             for (final Identifier identifier : identifiers) {
                 if (appendUnicodeIdentifier(id, '-', identifier.getCodeSpace(), ":", true)
| // Really |, not ||
-appendUnicodeIdentifier(id, '-', NameMeaning.toObjectType(getClass()), ":", false) |
+                    appendUnicodeIdentifier(id, '-', NameMeaning.toObjectType(getClass()),
":", false) |
                     appendUnicodeIdentifier(id, '-', identifier.getCode(), ":", true))
                 {
                     /*

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java?rev=1652014&r1=1652013&r2=1652014&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java
[UTF-8] Thu Jan 15 09:50:19 2015
@@ -16,6 +16,8 @@
  */
 package org.apache.sis.internal.simple;
 
+import java.util.Map;
+import java.util.Collections;
 import java.io.Serializable;
 import org.opengis.util.Type;
 import org.opengis.feature.Attribute;
@@ -155,6 +157,16 @@ public final class SimpleAttributeType<V
     }
 
     /**
+     * Not used for this simple attribute type.
+     *
+     * @return Always empty.
+     */
+    @Override
+    public Map<String, AttributeType<?>> characteristics() {
+        return Collections.emptyMap();
+    }
+
+    /**
      * Unsupported operation.
      */
     @Override



Mime
View raw message