You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2015/01/15 11:06:21 UTC
svn commit: r1652023 - in /sis/branches/JDK6: ./
core/sis-feature/src/main/java/org/apache/sis/feature/
core/sis-referencing/src/main/java/org/apache/sis/referencing/
core/sis-utility/src/main/java/org/apache/sis/internal/simple/
Author: desruisseaux
Date: Thu Jan 15 10:06:20 2015
New Revision: 1652023
URL: http://svn.apache.org/r1652023
Log:
Update for GeoAPI change: Attribute[Type].characteristics() now provided in the interfaces.
Modified:
sis/branches/JDK6/ (props changed)
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttributeType.java
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java
Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 15 10:06:20 2015
@@ -1,4 +1,4 @@
/sis/branches/Android:1430670-1480699
-/sis/branches/JDK7:1394913-1651598
-/sis/branches/JDK8:1584960-1651592
+/sis/branches/JDK7:1394913-1652022
+/sis/branches/JDK8:1584960-1652019
/sis/trunk:1394364-1508466,1519089-1519674
Modified: sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java?rev=1652023&r1=1652022&r2=1652023&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java [UTF-8] Thu Jan 15 10:06:20 2015
@@ -278,8 +278,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) {
@@ -326,10 +330,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/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java?rev=1652023&r1=1652022&r2=1652023&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java [UTF-8] Thu Jan 15 10:06:20 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/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttributeType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttributeType.java?rev=1652023&r1=1652022&r2=1652023&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttributeType.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttributeType.java [UTF-8] Thu Jan 15 10:06:20 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.<String,AttributeType<?>>emptyMap();
}
Modified: sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java?rev=1652023&r1=1652022&r2=1652023&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java [UTF-8] Thu Jan 15 10:06:20 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/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1652023&r1=1652022&r2=1652023&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] Thu Jan 15 10:06:20 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/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java?rev=1652023&r1=1652022&r2=1652023&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java [UTF-8] Thu Jan 15 10:06:20 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