sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1594961 - in /sis/branches/JDK8/core/sis-feature/src: main/java/org/apache/sis/feature/ test/java/org/apache/sis/feature/
Date Thu, 15 May 2014 16:03:44 GMT
Author: desruisseaux
Date: Thu May 15 16:03:44 2014
New Revision: 1594961

URL: http://svn.apache.org/r1594961
Log:
Renamed 'properties(boolean)' as 'getProperties(boolean)' and 'superTypes()' as 'getSuperTypes()'
for consistency with other feature classes, and also for analogy with java.lang.Class.

Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.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/DefaultAssociationRole.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java?rev=1594961&r1=1594960&r2=1594961&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java
[UTF-8] Thu May 15 16:03:44 2014
@@ -138,7 +138,7 @@ public class DefaultAssociationRole exte
         String p = titleProperty; // No synchronization - not a big deal if computed twice.
         if (p == null) {
             p = "";
-            for (final AbstractIdentifiedType type : valueType.properties(true)) {
+            for (final AbstractIdentifiedType type : valueType.getProperties(true)) {
                 if (type instanceof DefaultAttributeType<?>) {
                     final DefaultAttributeType<?> pt = (DefaultAttributeType<?>)
type;
                     if (pt.getMaximumOccurs() != 0 && CharSequence.class.isAssignableFrom(pt.getValueClass()))
{

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=1594961&r1=1594960&r2=1594961&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 15 16:03:44 2014
@@ -56,7 +56,7 @@ import org.apache.sis.internal.util.Unmo
  * Names can be {@linkplain org.apache.sis.util.iso.DefaultScopedName scoped} for avoiding
name collision.
  *
  * {@section Properties and inheritance}
- * Each feature type can provide descriptions for the following {@linkplain #properties(boolean)
properties}:
+ * Each feature type can provide descriptions for the following {@link #getProperties(boolean)
properties}:
  *
  * <ul>
  *   <li>{@linkplain DefaultAttributeType    Attributes}</li>
@@ -66,7 +66,7 @@ import org.apache.sis.internal.util.Unmo
  *
  * In addition, a feature type can inherit the properties of one or more other feature types.
  * Properties defined in the sub-type can override properties of the same name defined in
the
- * {@linkplain #superTypes() super-types}, provided that values of the sub-type property
are
+ * {@link #getSuperTypes() super-types}, provided that values of the sub-type property are
  * assignable to the super-type property.
  *
  * <div class="note"><b>Analogy:</b> compared to the Java language, the
above rule is similar to overriding a method
@@ -111,7 +111,7 @@ public class DefaultFeatureType extends 
     /**
      * The direct parents of this feature type, or an empty set if none.
      *
-     * @see #superTypes()
+     * @see #getSuperTypes()
      */
     private final Set<DefaultFeatureType> superTypes;
 
@@ -126,6 +126,8 @@ public class DefaultFeatureType extends 
     /**
      * Any feature operation, any feature attribute type and any feature association role
      * that carries characteristics of a feature type.
+     *
+     * @see #getProperties(boolean)
      */
     private final List<PropertyType> properties;
 
@@ -249,7 +251,7 @@ public class DefaultFeatureType extends 
          * Process all super-types before to process the given type. The intend is to have
the
          * super-types properties indexed before the sub-types ones in the 'indices' map.
          */
-        for (final DefaultFeatureType parent : source.superTypes()) {
+        for (final DefaultFeatureType parent : source.getSuperTypes()) {
             if (assignableTo.add(parent.getName())) {
                 scanPropertiesFrom(parent);
             }
@@ -466,14 +468,14 @@ public class DefaultFeatureType extends 
      *
      * @return The parents of this feature type, or an empty set if none.
      */
-    public Set<DefaultFeatureType> superTypes() {
+    public Set<DefaultFeatureType> getSuperTypes() {
         return superTypes;
     }
 
     /**
      * Returns any feature operation, any feature attribute type and any feature association
role that
      * carries characteristics of a feature type. The returned collection will include the
properties
-     * inherited from the {@linkplain #superTypes() super-types} only if {@code includeSuperTypes}
is
+     * inherited from the {@link #getSuperTypes() super-types} only if {@code includeSuperTypes}
is
      * {@code true}.
      *
      * <div class="warning"><b>Warning:</b>
@@ -485,7 +487,7 @@ public class DefaultFeatureType extends 
      * @return Feature operation, attribute type and association role that carries characteristics
of this
      *         feature type (not including parent types).
      */
-    public Collection<AbstractIdentifiedType> properties(final boolean includeSuperTypes)
{
+    public Collection<AbstractIdentifiedType> getProperties(final boolean includeSuperTypes)
{
         // TODO: temporary cast to be removed after we upgraded GeoAPI.
         return (Collection) (includeSuperTypes ? byName.values() : properties);
     }

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=1594961&r1=1594960&r2=1594961&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 15 16:03:44 2014
@@ -26,7 +26,7 @@
  *       {@linkplain org.apache.sis.feature.DefaultAttributeType attributes},
  *       {@linkplain org.apache.sis.feature.DefaultOperation operations} or
  *       {@linkplain org.apache.sis.feature.DefaultAssociationRole associations to other
features}
- *       (collectively called “{@linkplain org.apache.sis.feature.DefaultFeatureType#properties(boolean)
properties}”
+ *       (collectively called “{@linkplain org.apache.sis.feature.DefaultFeatureType#getProperties(boolean)
properties}”
  *       or “characteristics”) that a feature can have.</p>
  *
  *       <div class="note"><b>Analogy:</b> a {@code FeatureType} in a Spatial
Information System is equivalent to a
@@ -46,7 +46,7 @@
  *
  * In addition, a feature type can inherit the properties of one or more other feature types.
  * Properties defined in the sub-type can override properties of the same name defined in
the
- * {@linkplain org.apache.sis.feature.DefaultFeatureType#superTypes() super-types}, provided
+ * {@linkplain org.apache.sis.feature.DefaultFeatureType#getSuperTypes() super-types}, provided
  * that values of the sub-type property are assignable to the super-type property.
  *
  * {@section Naming}

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=1594961&r1=1594960&r2=1594961&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 15 16:03:44 2014
@@ -123,9 +123,9 @@ public final strictfp class DefaultFeatu
      * This method does <strong>not</strong> check recursively the properties.
      */
     private static void assertUnmodifiable(final DefaultFeatureType feature) {
-        final Collection<?> superTypes         = feature.superTypes();
-        final Collection<?> declaredProperties = feature.properties(false);
-        final Collection<?> allProperties      = feature.properties(true);
+        final Collection<?> superTypes         = feature.getSuperTypes();
+        final Collection<?> declaredProperties = feature.getProperties(false);
+        final Collection<?> allProperties      = feature.getProperties(true);
         if (!superTypes.isEmpty()) try {
             superTypes.clear();
             fail("Super-types collection shall not be modifiable.");
@@ -154,7 +154,7 @@ public final strictfp class DefaultFeatu
      * This method tests the following {@code FeatureType} methods:
      *
      * <ul>
-     *   <li>{@link DefaultFeatureType#properties(boolean)}</li>
+     *   <li>{@link DefaultFeatureType#getProperties(boolean)}</li>
      *   <li>{@link DefaultFeatureType#getProperty(String)}</li>
      * </ul>
      *
@@ -167,7 +167,7 @@ public final strictfp class DefaultFeatu
             final String... expected)
     {
         int index = 0;
-        for (final AbstractIdentifiedType property : feature.properties(includeSuperTypes))
{
+        for (final AbstractIdentifiedType property : feature.getProperties(includeSuperTypes))
{
             assertTrue("Found more properties than expected.", index < expected.length);
             final String name = expected[index++];
             assertNotNull(name, property);
@@ -189,7 +189,7 @@ public final strictfp class DefaultFeatu
         final DefaultFeatureType simple = city();
         assertUnmodifiable(simple);
         assertEquals("name", "City",     simple.getName().toString());
-        assertTrue  ("superTypes",       simple.superTypes().isEmpty());
+        assertTrue  ("superTypes",       simple.getSuperTypes().isEmpty());
         assertFalse ("isAbstract",       simple.isAbstract());
         assertTrue  ("isSimple",         simple.isSimple());
         assertTrue  ("isAssignableFrom", simple.isAssignableFrom(simple));
@@ -232,11 +232,11 @@ public final strictfp class DefaultFeatu
                 false, null, city, population, festival);
 
         assertUnmodifiable(complex);
-        final Collection<AbstractIdentifiedType> properties = complex.properties(false);
+        final Collection<AbstractIdentifiedType> properties = complex.getProperties(false);
         final Iterator<AbstractIdentifiedType> it = properties.iterator();
 
         assertEquals("name",            "Festival",                     complex.getName().toString());
-        assertTrue  ("superTypes",                                      complex.superTypes().isEmpty());
+        assertTrue  ("superTypes",                                      complex.getSuperTypes().isEmpty());
         assertTrue  ("isAssignableFrom",                                complex.isAssignableFrom(complex));
         assertFalse ("isAbstract",                                      complex.isAbstract());
         assertEquals("isSimple",        maximumOccurs == minimumOccurs, complex.isSimple());
@@ -286,7 +286,7 @@ public final strictfp class DefaultFeatu
         final DefaultFeatureType capital = capital();
         assertUnmodifiable(capital);
         assertEquals("name", "Capital", capital.getName().toString());
-        assertEquals("superTypes",      city, getSingleton(capital.superTypes()));
+        assertEquals("superTypes",      city, getSingleton(capital.getSuperTypes()));
         assertFalse ("isAbstract",      capital.isAbstract());
         assertTrue  ("isSimple",        capital.isSimple());
         assertEquals("instanceSize", 3, capital.getInstanceSize());
@@ -320,7 +320,7 @@ public final strictfp class DefaultFeatu
 
         assertUnmodifiable(metroCapital);
         assertEquals     ("name", "Metropolis and capital", metroCapital.getName().toString());
-        assertArrayEquals("superTypes", new Object[] {metropolis, capital}, metroCapital.superTypes().toArray());
+        assertArrayEquals("superTypes", new Object[] {metropolis, capital}, metroCapital.getSuperTypes().toArray());
         assertFalse      ("isAbstract",      metroCapital.isAbstract());
         assertTrue       ("isSimple",        metroCapital.isSimple());
         assertEquals     ("instanceSize", 6, metroCapital.getInstanceSize());
@@ -361,7 +361,7 @@ public final strictfp class DefaultFeatu
         final DefaultFeatureType worldMetropolis = worldMetropolis(metropolis, InternationalString.class);
         assertUnmodifiable(worldMetropolis);
         assertEquals     ("name", "World metropolis", worldMetropolis.getName().toString());
-        assertArrayEquals("superTypes", new Object[] {metropolis}, worldMetropolis.superTypes().toArray());
+        assertArrayEquals("superTypes", new Object[] {metropolis}, worldMetropolis.getSuperTypes().toArray());
         assertFalse      ("isAbstract",      worldMetropolis.isAbstract());
         assertTrue       ("isSimple",        worldMetropolis.isSimple());
         assertEquals     ("instanceSize", 4, worldMetropolis.getInstanceSize());



Mime
View raw message