sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1593420 - in /sis/branches/JDK8/core/sis-feature/src: main/java/org/apache/sis/feature/ test/java/org/apache/sis/feature/
Date Thu, 08 May 2014 21:15:10 GMT
Author: desruisseaux
Date: Thu May  8 21:15:10 2014
New Revision: 1593420

URL: http://svn.apache.org/r1593420
Log:
Consolidation: add package-internal class as place-holders for GeoAPI interfaces not yet standardized.
The intend is to allow us to write the code in a way that anticipate the fact that Attributes
will not
be the only kind of Properties in a Feature (other properties will be Associations and Operations).

Added:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
  (with props)
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/PropertyType.java
  (with props)
Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttribute.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/DefaultFeature.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/package-info.java
    sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java?rev=1593420&r1=1593419&r2=1593420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
[UTF-8] Thu May  8 21:15:10 2014
@@ -213,7 +213,7 @@ public class AbstractIdentifiedType impl
 
     /**
      * Returns a natural language designator for the element.
-     * This can be used as an alternative to the {@linkplain #getName()} in user interfaces.
+     * This can be used as an alternative to the {@linkplain #getName() name} in user interfaces.
      *
      * @return Natural language designator for the element.
      */

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttribute.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttribute.java?rev=1593420&r1=1593419&r2=1593420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttribute.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttribute.java
[UTF-8] Thu May  8 21:15:10 2014
@@ -46,7 +46,7 @@ import java.util.Objects;
  * @version 0.5
  * @module
  */
-public class DefaultAttribute<T> implements Cloneable, Serializable {
+public class DefaultAttribute<T> extends Property implements Cloneable, Serializable
{
     /**
      * For cross-version compatibility.
      */
@@ -90,6 +90,9 @@ public class DefaultAttribute<T> impleme
     /**
      * Returns information about the attribute (base Java class, domain of values, <i>etc.</i>).
      *
+     * <div class="warning"><b>Warning:</b> In a future SIS version, the
return type may be changed
+     * to {@code org.opengis.feature.AttrbuteType}. This change is pending GeoAPI revision.</div>
+     *
      * @return Information about the attribute.
      */
     public DefaultAttributeType<T> getType() {

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=1593420&r1=1593419&r2=1593420&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 May  8 21:15:10 2014
@@ -74,7 +74,7 @@ import java.util.Objects;
  * @version 0.5
  * @module
  */
-public class DefaultAttributeType<T> extends AbstractIdentifiedType {
+public class DefaultAttributeType<T> extends PropertyType {
     /**
      * For cross-version compatibility.
      */

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeature.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeature.java?rev=1593420&r1=1593419&r2=1593420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeature.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeature.java
[UTF-8] Thu May  8 21:15:10 2014
@@ -32,7 +32,7 @@ import org.apache.sis.util.collection.Co
  *
  * <ul>
  *   <li>{@linkplain DefaultAttribute   Attributes}</li>
- *   <li>{@linkplain DefaultAssociation Associations to other feature types}</li>
+ *   <li>{@linkplain DefaultAssociation Associations to other features}</li>
  *   <li>{@linkplain DefaultOperation   Operations}</li>
  * </ul>
  *
@@ -88,6 +88,9 @@ public class DefaultFeature implements S
     /**
      * Returns information about the feature (name, characteristics, <i>etc.</i>).
      *
+     * <div class="warning"><b>Warning:</b> In a future SIS version, the
return type may be changed
+     * to {@code org.opengis.feature.FeatureType}. This change is pending GeoAPI revision.</div>
+     *
      * @return Information about the feature.
      */
     public DefaultFeatureType getType() {
@@ -101,8 +104,8 @@ public class DefaultFeature implements S
      * @return The type for the property of the given name (never {@code null}).
      * @throws IllegalArgumentException If the given argument is not a property name of this
feature.
      */
-    private DefaultAttributeType<?> getPropertyType(final String name) throws IllegalArgumentException
{
-        final DefaultAttributeType<?> pt = type.getProperty(name);
+    private PropertyType getPropertyType(final String name) throws IllegalArgumentException
{
+        final PropertyType pt = type.getProperty(name);
         if (pt != null) {
             return pt;
         }
@@ -119,7 +122,7 @@ public class DefaultFeature implements S
      * @return The property of the given name.
      * @throws IllegalArgumentException If the given argument is not a property name of this
feature.
      */
-    public DefaultAttribute<?> getProperty(final String name) throws IllegalArgumentException
{
+    public Object getProperty(final String name) throws IllegalArgumentException {
         ArgumentChecks.ensureNonNull("name", name);
         /*
          * Wraps values in Property objects for all entries in the properties map,
@@ -127,11 +130,20 @@ public class DefaultFeature implements S
          */
         if (!asPropertyInstances) {
             asPropertyInstances = true;
-            for (final Map.Entry<String, Object> entry : properties.entrySet()) {
-                final String key   = entry.getKey();
-                final Object value = entry.getValue();
-                if (entry.setValue(new DefaultAttribute<>(getPropertyType(key), value))
!= value) {
-                    throw new ConcurrentModificationException(key);
+            if (!properties.isEmpty()) { // The map is typically empty when this method is
first invoked.
+                for (final Map.Entry<String, Object> entry : properties.entrySet())
{
+                    final String key      = entry.getKey();
+                    final Object value    = entry.getValue();
+                    final PropertyType pt = getPropertyType(key);
+                    final Property property;
+                    if (pt instanceof DefaultAttributeType<?>) {
+                        property = new DefaultAttribute<>((DefaultAttributeType<?>)
pt, value);
+                    } else {
+                        throw new UnsupportedOperationException(); // TODO
+                    }
+                    if (entry.setValue(property) != value) {
+                        throw new ConcurrentModificationException(key);
+                    }
                 }
             }
         }
@@ -139,13 +151,18 @@ public class DefaultFeature implements S
     }
 
     /**
-     * Implementation of {@link #getProperty(String)} invoked when we known that the {@link
#properties}
+     * Implementation of {@link #getProperty(String)} invoked when we know that the {@link
#properties}
      * map contains {@code Property} instances (as opposed to their value).
      */
-    private DefaultAttribute<?> getPropertyInstance(final String name) throws IllegalArgumentException
{
-        DefaultAttribute<?> property = (DefaultAttribute<?>) properties.get(name);
+    private Property getPropertyInstance(final String name) throws IllegalArgumentException
{
+        Property property = (Property) properties.get(name);
         if (property == null) {
-            property = new DefaultAttribute<>(getPropertyType(name));
+            final PropertyType pt = getPropertyType(name);
+            if (pt instanceof DefaultAttributeType<?>) {
+                property = new DefaultAttribute<>((DefaultAttributeType<?>) pt);
+            } else {
+                throw new UnsupportedOperationException(); // TODO
+            }
             replace(name, null, property);
         }
         return property;
@@ -156,7 +173,7 @@ public class DefaultFeature implements S
      * This convenience method is equivalent to the following code,
      * except that this method is potentially more efficient:
      *
-     * {@preformat
+     * {@preformat java
      *     return getProperty(name).getValue();
      * }
      *
@@ -178,7 +195,12 @@ public class DefaultFeature implements S
         } else if (properties.containsKey(name)) {
             return null; // Null has been explicitely set.
         } else {
-            return getPropertyType(name).getDefaultValue();
+            final PropertyType pt = getPropertyType(name);
+            if (pt instanceof DefaultAttributeType<?>) {
+                return ((DefaultAttributeType<?>) pt).getDefaultValue();
+            } else {
+                throw new UnsupportedOperationException(); // TODO
+            }
         }
     }
 
@@ -210,8 +232,8 @@ public class DefaultFeature implements S
              * a new value or a value of a different type, then we need to check the name
and type validity.
              */
             if (previous == null || (value != null && previous.getClass() != value.getClass()))
{
-                final DefaultAttributeType<?> pt = type.getProperty(name);
-                if (pt == null || (value != null && !pt.getValueClass().isInstance(value)))
{
+                final PropertyType pt = type.getProperty(name);
+                if (!isValidAttributeValue(pt, value)) {
                     replace(name, value, previous); // Restore the previous value.
                     if (pt == null) {
                         throw new IllegalArgumentException(Errors.format(
@@ -223,7 +245,12 @@ public class DefaultFeature implements S
                 }
             }
         } else {
-            setAttributeValue(getPropertyInstance(name), value);
+            final Property property = getPropertyInstance(name);
+            if (property instanceof DefaultAttribute<?>) {
+                setAttributeValue((DefaultAttribute<?>) property, value);
+            } else {
+                throw new UnsupportedOperationException();
+            }
         }
     }
 
@@ -241,6 +268,20 @@ public class DefaultFeature implements S
     }
 
     /**
+     * Returns {@code true} if the given type is an attribute type, and if the given value
+     * is valid for that attribute type.
+     */
+    private static boolean isValidAttributeValue(final PropertyType type, final Object value)
{
+        if (!(type instanceof DefaultAttributeType<?>)) {
+            return false;
+        }
+        if (value == null) {
+            return true;
+        }
+        return ((DefaultAttributeType<?>) type).getValueClass().isInstance(value);
+    }
+
+    /**
      * Sets the attribute value after verification of its type. This method is invoked only
for checking
      * that we are not violating the Java parameterized type contract. For a more exhaustive
validation,
      * use {@link Validator} instead.
@@ -311,15 +352,15 @@ public class DefaultFeature implements S
         final StringBuilder sb = new StringBuilder();
         final String lineSeparator = System.lineSeparator();
         for (final Map.Entry<String,Object> entry : properties.entrySet()) {
-            final DefaultAttributeType<?> at;
+            final PropertyType pt;
             Object element = entry.getValue();
             if (asPropertyInstances) {
-                at = ((DefaultAttribute<?>) element).getType();
+                pt = ((DefaultAttribute<?>) element).getType();
                 element = ((DefaultAttribute<?>) element).getValue();
             } else {
-                at = type.getProperty(entry.getKey());
+                pt = type.getProperty(entry.getKey());
             }
-            sb.append(at.getName()).append(": ").append(element).append(lineSeparator);
+            sb.append(pt.getName()).append(": ").append(element).append(lineSeparator);
         }
         return sb.toString();
     }

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=1593420&r1=1593419&r2=1593420&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 May  8 21:15:10 2014
@@ -46,9 +46,9 @@ import org.apache.sis.internal.util.Unmo
  * Each feature type can provide descriptions for the following properties:
  *
  * <ul>
- *   <li>{@linkplain DefaultAttributeType   Attributes}</li>
- *   <li>{@linkplain DefaultAssociationRole Associations to other feature types}</li>
- *   <li>{@linkplain DefaultOperationType   Operations}</li>
+ *   <li>{@linkplain DefaultAttributeType    Attributes}</li>
+ *   <li>{@linkplain DefaultAssociationRole  Associations to other feature types}</li>
+ *   <li>{@linkplain DefaultFeatureOperation Operations}</li>
  * </ul>
  *
  * The description of all those properties are collectively called {@linkplain #characteristics()
characteristics}.
@@ -91,7 +91,7 @@ public class DefaultFeatureType extends 
      * Any feature operation, any feature attribute type and any feature association role
      * that carries characteristics of a feature type.
      */
-    private final List<DefaultAttributeType<?>> characteristics;
+    private final List<PropertyType> characteristics;
 
     /**
      * A lookup table for fetching properties by name.
@@ -99,7 +99,7 @@ public class DefaultFeatureType extends 
      *
      * @see #getProperty(String)
      */
-    private final transient Map<String, DefaultAttributeType<?>> byName;
+    private final transient Map<String, PropertyType> byName;
 
     /**
      * Constructs a feature type from the given properties. The properties map is given unchanged
to
@@ -136,8 +136,10 @@ public class DefaultFeatureType extends 
      * </table>
      *
      * <div class="warning"><b>Warning:</b> In a future SIS version, the
type of array elements may be
-     * changed to {@code org.opengis.feature.FeatureType} {@code org.opengis.feature.PropertyType}.
-     * This change is pending GeoAPI revision.</div>
+     * changed to {@code org.opengis.feature.FeatureType} and {@code org.opengis.feature.PropertyType}.
+     * This change is pending GeoAPI revision. In the meantime, make sure that the {@code
characteristics}
+     * array contains only attribute types, association roles or operations, <strong>not</strong>
other
+     * feature types since the later are not properties in the ISO sense.</div>
      *
      * @param properties The name and other properties to be given to this feature type.
      * @param isAbstract If {@code true}, the feature type acts as an abstract super-type.
@@ -146,7 +148,7 @@ public class DefaultFeatureType extends 
      *        association role that carries characteristics of a feature type.
      */
     public DefaultFeatureType(final Map<String,?> properties, final boolean isAbstract,
-            final DefaultFeatureType[] superTypes, final DefaultAttributeType<?>...
characteristics)
+            final DefaultFeatureType[] superTypes, final AbstractIdentifiedType... characteristics)
     {
         super(properties);
         ArgumentChecks.ensureNonNull("characteristics", characteristics);
@@ -154,7 +156,7 @@ public class DefaultFeatureType extends 
         this.superTypes = (superTypes == null) ? Collections.<DefaultFeatureType>emptySet()
:
                           CollectionsExt.<DefaultFeatureType>immutableSet(true, superTypes);
         this.characteristics = UnmodifiableArrayList.wrap(Arrays.copyOf(
-                characteristics, characteristics.length, DefaultAttributeType[].class));
+                characteristics, characteristics.length, PropertyType[].class));
         byName = byName(this.characteristics);
     }
 
@@ -168,11 +170,11 @@ public class DefaultFeatureType extends 
      * @return The map of properties.
      * @throws IllegalArgumentException if two properties have the same name.
      */
-    private static Map<String, DefaultAttributeType<?>> byName(final List<DefaultAttributeType<?>>
characteristics) {
+    private static Map<String, PropertyType> byName(final List<PropertyType>
characteristics) {
         final int length = characteristics.size();
-        final Map<String, DefaultAttributeType<?>> byName = new HashMap<>(Containers.hashMapCapacity(length));
+        final Map<String, PropertyType> byName = new HashMap<>(Containers.hashMapCapacity(length));
         for (int i=0; i<length; i++) {
-            final DefaultAttributeType<?> c = characteristics.get(i);
+            final PropertyType c = characteristics.get(i);
             ArgumentChecks.ensureNonNullElement("characteristics", i, c);
             final GenericName name = c.getName();
             if (name == null) {
@@ -237,8 +239,8 @@ public class DefaultFeatureType extends 
      *
      * @return Feature operation, attribute type and association role that carries characteristics
of a feature type.
      */
-    public List<DefaultAttributeType<?>> characteristics() {
-        return characteristics;
+    public List<AbstractIdentifiedType> characteristics() {
+        return (List) characteristics; // Cast is safe because the list is read-only.
     }
 
     /**
@@ -247,7 +249,7 @@ 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.
      */
-    final DefaultAttributeType<?> getProperty(final String name) {
+    final PropertyType getProperty(final String name) {
         return byName.get(name);
     }
 

Added: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java?rev=1593420&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
(added)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
[UTF-8] Thu May  8 21:15:10 2014
@@ -0,0 +1,33 @@
+/*
+ * 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.feature;
+
+
+/**
+ * Place-holder for an interface not available in GeoAPI 3.0.
+ * This place-holder will be removed after we upgrade to a later GeoAPI version.
+ *
+ * <p><strong>Do not put this type in public API</strong>. We need to prevent
users from using
+ * this type in order to reduce compatibility breaks when we will upgrade the GeoAPI version.</p>
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.5
+ * @version 0.5
+ * @module
+ */
+abstract class Property {
+}

Propchange: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/PropertyType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/PropertyType.java?rev=1593420&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/PropertyType.java
(added)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/PropertyType.java
[UTF-8] Thu May  8 21:15:10 2014
@@ -0,0 +1,46 @@
+/*
+ * 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.feature;
+
+import java.util.Map;
+
+
+/**
+ * Place-holder for an interface not available in GeoAPI 3.0.
+ * This place-holder will be removed after we upgrade to a later GeoAPI version.
+ *
+ * <p><strong>Do not put this type in public API</strong>. We need to prevent
users from using
+ * this type in order to reduce compatibility breaks when we will upgrade the GeoAPI version.</p>
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.5
+ * @version 0.5
+ * @module
+ */
+class PropertyType extends AbstractIdentifiedType {
+    /**
+     * For cross-version compatibility.
+     */
+    private static final long serialVersionUID = 7178390307956818666L;
+
+    /**
+     * Passes the given properties unchanged to the super-class constructor.
+     */
+    PropertyType(final Map<String,?> properties) throws IllegalArgumentException {
+        super(properties);
+    }
+}

Propchange: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/PropertyType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/PropertyType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/package-info.java?rev=1593420&r1=1593419&r2=1593420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/package-info.java
[UTF-8] Thu May  8 21:15:10 2014
@@ -23,19 +23,18 @@
  * <ul>
  *   <li>{@linkplain org.apache.sis.feature.DefaultFeatureType Feature types} define
the <em>structure</em> of
  *       real-world representations. A feature type lists the attributes, operations, or
associations to other
- *       features (collectively called “properties”) that a feature can have.</li>
+ *       features (collectively called “characteristics”) that a feature can have.
  *
- *   <li>{@linkplain org.apache.sis.feature.DefaultFeature Feature instances} (often
called only {@code Feature}s)
- *       hold the <em>content</em> (or values) that describe one specific real-world
object.</li>
- * </ul>
+ *       <p style="font-size:small"><b>Analogy:</b> a {@code FeatureType}
in a Spatial Information System is equivalent
+ *       to a {@link java.lang.Class} in the Java language. By extension, {@code AttributeType}
and {@code Operation}
+ *       are equivalent to {@link java.lang.reflect.Field} and {@link java.lang.reflect.Method}
respectively.</p></li>
  *
- * <div class="note"><b>Note:</b> a {@code FeatureType} in a Spatial Information
System is equivalent to a
- * {@link java.lang.Class} in the Java language, while a {@code Feature} instance is equivalent
to a Java
- * {@link java.lang.Object} of that class. By extension, {@code AttributeType} and {@code
Operation} are
- * equivalent to {@link java.lang.reflect.Field} and {@link java.lang.reflect.Method} respectively.</div>
+ *   <li>{@linkplain org.apache.sis.feature.DefaultFeature Feature instances} (often
called only {@code Feature}s)
+ *       hold the <em>content</em> (or values) that describe one specific real-world
object.
  *
- * <div class="note"><b>Example:</b> the “Eiffel tower” is a feature
<em>instance</em> belonging
- * to the “Tower” feature <em>type</em>.</div>
+ *       <p style="font-size:small"><b>Example:</b> the “Eiffel tower”
is a <em>feature instance</em> belonging
+ *       to the “Tower” <em>feature type</em>.</p></li>
+ * </ul>
  *
  * {@section Class hierarchy}
  * The class hierarchy for feature <cite>types</cite> is derived from ISO 19109
specification.
@@ -47,16 +46,17 @@
  *   <th>Types</th>
  *   <th class="sep">Instances</th>
  * </tr><tr><td style="width: 50%; white-space: nowrap">
- *                 {@linkplain org.apache.sis.feature.AbstractIdentifiedType    Identified
type}<br>
- * {@code  ├─}     {@linkplain org.apache.sis.feature.DefaultFeatureType        Feature
type}<br>
- * {@code  └─}     {@linkplain org.apache.sis.feature.AbstractPropertyType      Property
type}<br>
- * {@code      ├─} {@linkplain org.apache.sis.feature.DefaultAttributeType     
Attribute type}<br>
- * {@code      ├─} {@linkplain org.apache.sis.feature.DefaultOperationType     
Operation}<br>
- * {@code      └─} {@linkplain org.apache.sis.feature.DefaultFeatureAssociation
Feature association role}<br>
+ *                 {@linkplain org.apache.sis.feature.AbstractIdentifiedType  Identified
type}<br>
+ * {@code  ├─}     {@linkplain org.apache.sis.feature.DefaultFeatureType      Feature
type}<br>
+ * {@code  └─}                                                                Property
type<br>
+ * {@code      ├─} {@linkplain org.apache.sis.feature.DefaultAttributeType    Attribute
type}<br>
+ * {@code      ├─} {@linkplain org.apache.sis.feature.DefaultAssociationRole  Feature
association role}<br>
+ * {@code      └─} {@linkplain org.apache.sis.feature.DefaultFeatureOperation Operation}<br>
  * </td><td class="sep" style="width: 50%; white-space: nowrap">
- *             {@linkplain org.apache.sis.feature.DefaultFeature    Feature}<br>
- *             {@linkplain org.apache.sis.feature.AbstractProperty  Property}<br>
- * {@code  └─} {@linkplain org.apache.sis.feature.DefaultAttribute  Attribute}<br>
+ *             {@linkplain org.apache.sis.feature.DefaultFeature     Feature}<br>
+ *                                                                   Property<br>
+ * {@code  ├─} {@linkplain org.apache.sis.feature.DefaultAttribute   Attribute}<br>
+ * {@code  └─} {@linkplain org.apache.sis.feature.DefaultAssociation Feature association}<br>
  * </td></tr></table>
  *
  * @author  Travis L. Pinney

Modified: sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java?rev=1593420&r1=1593419&r2=1593420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
[UTF-8] Thu May  8 21:15:10 2014
@@ -19,7 +19,6 @@ package org.apache.sis.feature;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.List;
-import org.apache.sis.measure.NumberRange;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -62,7 +61,7 @@ public final strictfp class DefaultFeatu
         /*
          * Verify content.
          */
-        final List<DefaultAttributeType<?>> characteristics = simple.characteristics();
+        final List<AbstractIdentifiedType> characteristics = simple.characteristics();
         assertEquals("characteristics.size", 2, characteristics.size());
         assertEquals("characteristics[0]", "city",       characteristics.get(0).getName().toString());
         assertEquals("characteristics[1]", "population", characteristics.get(1).getName().toString());



Mime
View raw message