sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1763840 [7/12] - in /sis/branches/JDK7: ./ core/ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-feature/src/main/java/org/apache/sis/feature/builder/ core/sis-feature/src/main/java/org/apache/sis/internal/feature/ core/sis...
Date Fri, 07 Oct 2016 21:35:45 GMT
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1763840&r1=1763839&r2=1763840&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8]
(original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8]
Fri Oct  7 21:35:43 2016
@@ -104,9 +104,9 @@ public final class Classes extends Stati
      *       class augmented by the given amount of dimensions.</li>
      * </ul>
      *
-     * @param  element The type of elements in the array.
-     * @param  dimension The change of dimension, as a negative or positive number.
-     * @return The type of an array of the given element type augmented by the given
+     * @param  element    the type of elements in the array.
+     * @param  dimension  the change of dimension, as a negative or positive number.
+     * @return the type of an array of the given element type augmented by the given
      *         number of dimensions (which may be negative), or {@code null}.
      */
     public static Class<?> changeArrayDimension(Class<?> element, int dimension)
{
@@ -159,8 +159,8 @@ public final class Classes extends Stati
      *   <li>{@code Set} returns {@code null} because that collection is un-parameterized.</li>
      * </ul>
      *
-     * @param  field The field for which to obtain the parameterized type.
-     * @return The upper bound of parameterized type, or {@code null} if the given field
+     * @param  field  the field for which to obtain the parameterized type.
+     * @return the upper bound of parameterized type, or {@code null} if the given field
      *         is not of a parameterized type.
      */
     public static Class<?> boundOfParameterizedProperty(final Field field) {
@@ -178,9 +178,9 @@ public final class Classes extends Stati
      * We do not provide a method working from a {@link Class} instance because of the way
      * parameterized types are implemented in Java (by erasure).</p>
      *
-     * @param  method The getter or setter method for which to obtain the parameterized type.
-     * @return The upper bound of parameterized type, or {@code null} if the given method
-     *         do not operate on an object of a parameterized type.
+     * @param  method  the getter or setter method for which to obtain the parameterized
type.
+     * @return the upper bound of parameterized type, or {@code null} if the given method
+     *         does not operate on an object of a parameterized type.
      */
     public static Class<?> boundOfParameterizedProperty(final Method method) {
         Class<?> c = getActualTypeArgument(method.getGenericReturnType());
@@ -224,7 +224,7 @@ public final class Classes extends Stati
                 if (type instanceof Class<?>) {
                     return changeArrayDimension((Class<?>) type, dimension);
                 }
-                break; // Unknown type.
+                break;                                      // Unknown type.
             }
         }
         return null;
@@ -242,9 +242,9 @@ public final class Classes extends Stati
      *
      * doesn't seem to work if {@link Number} is replaced by a parameterized type {@code
T}.
      *
-     * @param  <T> The type of the given object.
-     * @param  object The object for which to get the class, or {@code null}.
-     * @return The class of the given object, or {@code null} if the given object was null.
+     * @param  <T>     the type of the given object.
+     * @param  object  the object for which to get the class, or {@code null}.
+     * @return the class of the given object, or {@code null} if the given object was null.
      */
     @SuppressWarnings("unchecked")
     @Workaround(library="JDK", version="1.7")
@@ -259,9 +259,9 @@ public final class Classes extends Stati
      *
      * <p>Note that interfaces are not included in the returned set.</p>
      *
-     * @param  <T> The base type of elements in the given collection.
-     * @param  objects The collection of objects.
-     * @return The set of classes of all objects in the given collection.
+     * @param  <T>      the base type of elements in the given collection.
+     * @param  objects  the collection of objects.
+     * @return the set of classes of all objects in the given collection.
      */
     private static <T> Set<Class<? extends T>> getClasses(final Iterable<?
extends T> objects) {
         final Set<Class<? extends T>> types = new LinkedHashSet<>();
@@ -278,10 +278,10 @@ public final class Classes extends Stati
      * the returned set will contains {@link java.util.List} (which is implemented directly)
      * together with its parent interfaces {@link Collection} and {@link Iterable}.
      *
-     * @param  <T>  The compile-time type of the {@code Class} argument.
-     * @param  type The class or interface for which to get all implemented interfaces.
-     * @return All implemented interfaces (not including the given {@code type} if it was
an
-     *         interface), or an empty array if none.
+     * @param  <T>   the compile-time type of the {@code Class} argument.
+     * @param  type  the class or interface for which to get all implemented interfaces.
+     * @return all implemented interfaces (not including the given {@code type} if it was
an interface),
+     *         or an empty array if none.
      *
      * @see Class#getInterfaces()
      */
@@ -304,9 +304,9 @@ public final class Classes extends Stati
      *       while they can not cast {@code Set<Class<? super T>>} to {@code
Set<Class<?>>}.</li>
      * </ul>
      *
-     * @param  type The class or interface for which to get all implemented interfaces.
-     * @return All implemented interfaces (not including the given {@code type} if it was
an
-     *         interface), or {@code null} if none. Callers can freely modify the returned
set.
+     * @param  type  the class or interface for which to get all implemented interfaces.
+     * @return all implemented interfaces (not including the given {@code type} if it was
an interface),
+     *         or {@code null} if none. Callers can freely modify the returned set.
      */
     static Set<Class<?>> getInterfaceSet(Class<?> type) {
         Set<Class<?>> interfaces = null;
@@ -320,9 +320,9 @@ public final class Classes extends Stati
     /**
      * Adds to the given set every interfaces implemented by the given class or interface.
      *
-     * @param  type  The type for which to add the interfaces in the given set.
-     * @param  addTo The set where to add interfaces, or {@code null} if not yet created.
-     * @return The given set (may be {@code null}), or a new set if the given set was null
+     * @param  type   the type for which to add the interfaces in the given set.
+     * @param  addTo  the set where to add interfaces, or {@code null} if not yet created.
+     * @return the given set (may be {@code null}), or a new set if the given set was null
      *         and at least one interface has been found.
      */
     private static Set<Class<?>> getInterfaceSet(final Class<?> type, Set<Class<?>>
addTo) {
@@ -349,10 +349,10 @@ public final class Classes extends Stati
      * {@code getLeafInterfaces(ArrayList.class, Collection.class)} returns an array of length
1
      * containing {@code List.class}.
      *
-     * @param  <T>  The type of the {@code baseInterface} class argument.
-     * @param  type A class for which the implemented interfaces are desired.
-     * @param  baseInterface The base type of the interfaces to search.
-     * @return The leaf interfaces matching the given criterion, or an empty array if none.
+     * @param  <T>   the type of the {@code baseInterface} class argument.
+     * @param  type  a class for which the implemented interfaces are desired, or {@code
null}.
+     * @param  baseInterface  the base type of the interfaces to search.
+     * @return the leaf interfaces matching the given criterion, or an empty array if none.
      */
     @SuppressWarnings("unchecked")
     public static <T> Class<? extends T>[] getLeafInterfaces(Class<?> type,
final Class<T> baseInterface) {
@@ -398,8 +398,8 @@ next:       for (final Class<?> candidat
      *
      * <p>This method searches for classes only, not interfaces.</p>
      *
-     * @param  objects A collection of objects. May contains duplicated values and null values.
-     * @return The most specialized class, or {@code null} if the given collection does not
contain
+     * @param  objects  a collection of objects. May contains duplicated values and null
values.
+     * @return the most specialized class, or {@code null} if the given collection does not
contain
      *         at least one non-null element.
      */
     public static Class<?> findSpecializedClass(final Iterable<?> objects) {
@@ -427,8 +427,8 @@ next:       for (final Class<?> candidat
      * This method is not public in order to make sure that it contains only classes, not
      * interfaces, since our implementation is not designed for multi-inheritances.
      *
-     * @param  types The collection where to search for a common parent.
-     * @return The common parent, or {@code null} if the given collection is empty.
+     * @param  types  the collection where to search for a common parent.
+     * @return the common parent, or {@code null} if the given collection is empty.
      */
     private static Class<?> common(final Set<Class<?>> types) {
         final Iterator<Class<?>> it = types.iterator();
@@ -450,8 +450,8 @@ next:       for (final Class<?> candidat
      *
      * <p>This method searches for classes only, not interfaces.</p>
      *
-     * @param  objects A collection of objects. May contains duplicated values and null values.
-     * @return The most specific class common to all supplied objects, or {@code null} if
the
+     * @param  objects  a collection of objects. May contains duplicated values and null
values.
+     * @return the most specific class common to all supplied objects, or {@code null} if
the
      *         given collection does not contain at least one non-null element.
      */
     public static Class<?> findCommonClass(final Iterable<?> objects) {
@@ -467,9 +467,9 @@ next:       for (final Class<?> candidat
      *
      * <p>This method considers classes only, not the interfaces.</p>
      *
-     * @param  c1 The first class, or {@code null}.
-     * @param  c2 The second class, or {@code null}.
-     * @return The most specific class common to the supplied classes, or {@code null}
+     * @param  c1  the first class, or {@code null}.
+     * @param  c2  the second class, or {@code null}.
+     * @return the most specific class common to the supplied classes, or {@code null}
      *         if both {@code c1} and {@code c2} are null.
      */
     public static Class<?> findCommonClass(Class<?> c1, Class<?> c2) {
@@ -494,9 +494,9 @@ next:       for (final Class<?> candidat
      * {@link Collection} interface, then the returned set will contains the {@code Collection}
      * type but not the {@link Iterable} type, since it is implied by the collection type.
      *
-     * @param  c1 The first class.
-     * @param  c2 The second class.
-     * @return The interfaces common to both classes, or an empty set if none.
+     * @param  c1  the first class.
+     * @param  c2  the second class.
+     * @return the interfaces common to both classes, or an empty set if none.
      *         Callers can freely modify the returned set.
      */
     public static Set<Class<?>> findCommonInterfaces(final Class<?> c1,
final Class<?> c2) {
@@ -534,9 +534,9 @@ next:       for (final Class<?> candidat
      * }
      * </div>
      *
-     * @param object1 The first object to check for interfaces.
-     * @param object2 The second object to check for interfaces.
-     * @param baseInterface The parent of all interfaces to check.
+     * @param object1  the first object to check for interfaces.
+     * @param object2  the second object to check for interfaces.
+     * @param baseInterface  the parent of all interfaces to check.
      * @return {@code true} if both objects implement the same set of interfaces,
      *         considering only sub-interfaces of {@code baseInterface}.
      */
@@ -614,8 +614,8 @@ cmp:    for (final Class<?> c : c1) {
      *   </tr>
      * </table>
      *
-     * @param  classe The object class (may be {@code null}).
-     * @return The simple name with outer class name (if any) of the first non-anonymous
+     * @param  classe  the object class (may be {@code null}).
+     * @return the simple name with outer class name (if any) of the first non-anonymous
      *         class in the hierarchy, or {@code "<*>"} if the given class is null.
      *
      * @see #getShortClassName(Object)
@@ -642,8 +642,8 @@ cmp:    for (final Class<?> c : c1) {
      * {@code null} value. See {@link #getShortName(Class)} for more information on the class
name returned by
      * this method.
      *
-     * @param  object The object (may be {@code null}).
-     * @return The simple class name with outer class name (if any) of the first non-anonymous
+     * @param  object  the object (may be {@code null}).
+     * @return the simple class name with outer class name (if any) of the first non-anonymous
      *         class in the hierarchy, or {@code "<*>"} if the given object is null.
      *
      * @see #getShortName(Class)
@@ -666,8 +666,8 @@ cmp:    for (final Class<?> c : c1) {
      *   <li>Any null element in the {@code allowedTypes} array are silently ignored.</li>
      * </ul>
      *
-     * @param  type The type to be tested, or {@code null}.
-     * @param  allowedTypes The allowed types.
+     * @param  type  the type to be tested, or {@code null}.
+     * @param  allowedTypes  the allowed types.
      * @return {@code true} if the given type is assignable to one of the allowed types.
      */
     public static boolean isAssignableToAny(final Class<?> type, final Class<?>...
allowedTypes) {
@@ -707,7 +707,7 @@ cmp:    for (final Class<?> c : c1) {
      *
      * <p>Those conditions may be updated in any future SIS version.</p>
      *
-     * @param  method The method to inspect.
+     * @param  method  the method to inspect.
      * @return {@code true} if the given method may possibly be a non-deprecated getter method.
      */
     public static boolean isPossibleGetter(final Method method) {

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=1763840&r1=1763839&r2=1763840&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]
Fri Oct  7 21:35:43 2016
@@ -50,6 +50,15 @@ import static java.lang.Double.doubleToL
 public final class Numbers extends Static {
     /**
      * Constant of value {@value} used in {@code switch} statements or as index in arrays.
+     * This enumeration provides the following guarantees (some Apache SIS code rely on them):
+     *
+     * <ul>
+     *   <li>{@code OTHER} value is 0.</li>
+     *   <li>Primitive types are enumerated in this exact order (from lower value to
higher value):
+     *       {@code BYTE}, {@code SHORT}, {@code INTEGER}, {@code LONG}, {@code FLOAT}, {@code
DOUBLE}.</li>
+     *   <li>{@link java.math} types of greater capacity that primitive types ({@code
BIG_DECIMAL}
+     *       and {@code BIG_INTEGER}) have higher enumeration values.</li>
+     * </ul>
      */
     public static final byte
             BIG_DECIMAL=10, BIG_INTEGER=9,
@@ -84,7 +93,7 @@ public final class Numbers extends Stati
     /** The wrapper for the primitive type.     */ private final Class<?> wrapper;
     /** {@code true} for floating point number. */ private final boolean  isFloat;
     /** {@code true} for integer number.        */ private final boolean  isInteger;
-    /** The size in bytes, or -1 if variable.   */ private final byte     size;
+    /** The size in bits, or -1 if variable.    */ private final byte     size;
     /** Constant to be used in switch statement.*/ private final byte     ordinal;
     /** The internal form of the primitive name.*/ private final char     internal;
     /** The null, NaN, 0 or false value.        */ private final Object   nullValue;
@@ -220,8 +229,8 @@ public final class Numbers extends Stati
      * {@link Byte}, {@link Short}, {@link Integer}, {@link Long}, {@link Float}, {@link
Double},
      * {@link BigInteger} or {@link BigDecimal} types.
      *
-     * <p>If one of the given argument is null, then this method returns the class
of the
-     * non-null argument. If both arguments are null, then this method returns {@code null}.</p>
+     * <p>If one of the given argument is null, then this method returns the class
of the non-null argument.
+     * If both arguments are null, then this method returns {@code null}.</p>
      *
      * @param  n1  the first number, or {@code null}.
      * @param  n2  the second number, or {@code null}.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java?rev=1763840&r1=1763839&r2=1763840&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java
[UTF-8] Fri Oct  7 21:35:43 2016
@@ -37,6 +37,8 @@ import org.apache.sis.util.ArgumentCheck
  * @since   0.7
  * @version 0.7
  * @module
+ *
+ * @see org.apache.sis.math.Vector
  */
 public class IntegerList extends AbstractList<Integer> implements RandomAccess, Serializable,
Cloneable {
     /**
@@ -83,8 +85,8 @@ public class IntegerList extends Abstrac
     /**
      * Creates an initially empty list with the given initial capacity.
      *
-     * @param initialCapacity The initial capacity.
-     * @param maximalValue The maximal value to be allowed, inclusive.
+     * @param initialCapacity  the initial capacity.
+     * @param maximalValue     the maximal value to be allowed, inclusive.
      */
     public IntegerList(int initialCapacity, int maximalValue) {
         this(initialCapacity, maximalValue, false);
@@ -94,22 +96,17 @@ public class IntegerList extends Abstrac
      * Creates a new list with the given initial size.
      * The value of all elements are initialized to 0.
      *
-     * @param initialCapacity The initial capacity.
-     * @param maximalValue The maximal value to be allowed, inclusive.
-     * @param fill If {@code true}, the initial {@linkplain #size() size} is set to the initial
capacity
+     * @param initialCapacity  the initial capacity.
+     * @param maximalValue     the maximal value to be allowed, inclusive.
+     * @param fill if {@code true}, the initial {@linkplain #size() size} is set to the initial
capacity
      *        with all values set to 0.
      */
-    public IntegerList(final int initialCapacity, int maximalValue, final boolean fill) {
+    public IntegerList(final int initialCapacity, final int maximalValue, final boolean fill)
{
         ArgumentChecks.ensureStrictlyPositive("initialCapacity", initialCapacity);
         ArgumentChecks.ensureStrictlyPositive("maximalValue",    maximalValue);
-        int bitCount = 0;
-        do {
-            bitCount++;
-            maximalValue >>>= 1;
-        } while (maximalValue != 0);
-        this.bitCount = bitCount;
-        mask = (1 << bitCount) - 1;
-        values = new long[length(initialCapacity)];
+        bitCount = Math.max(1, Integer.SIZE - Integer.numberOfLeadingZeros(maximalValue));
+        mask     = (1 << bitCount) - 1;
+        values   = new long[length(initialCapacity)];
         if (fill) {
             size = initialCapacity;
         }
@@ -118,8 +115,8 @@ public class IntegerList extends Abstrac
     /**
      * Returns the array length required for holding a list of the given size.
      *
-     * @param size The list size.
-     * @return The array length for holding a list of the given size.
+     * @param  size  the list size.
+     * @return the array length for holding a list of the given size.
      */
     private int length(int size) {
         size *= bitCount;
@@ -134,7 +131,7 @@ public class IntegerList extends Abstrac
      * Returns the maximal value that can be stored in this list.
      * May be slightly higher than the value given to the constructor.
      *
-     * @return The maximal value, inclusive.
+     * @return the maximal value, inclusive.
      */
     public int maximalValue() {
         return mask;
@@ -143,7 +140,7 @@ public class IntegerList extends Abstrac
     /**
      * Returns the current number of values in this list.
      *
-     * @return The number of values.
+     * @return the number of values.
      */
     @Override
     public int size() {
@@ -155,7 +152,7 @@ public class IntegerList extends Abstrac
      * then the elements after the new size are discarded. If the new size is greater than
      * the previous one, then the extra elements are initialized to 0.
      *
-     * @param size The new size.
+     * @param  size  the new size.
      */
     public void resize(final int size) {
         ArgumentChecks.ensurePositive("size", size);
@@ -180,7 +177,7 @@ public class IntegerList extends Abstrac
      * Fills the list with the given value.
      * Every existing values are overwritten from index 0 inclusive up to {@link #size} exclusive.
      *
-     * @param value The value to set.
+     * @param  value  the value to set.
      */
     @SuppressWarnings("fallthrough")
     public void fill(int value) {
@@ -197,7 +194,7 @@ public class IntegerList extends Abstrac
             case  8: value |= (value << 8);     // Fall through
             case 16: value |= (value << 16);    // Fall through
             case 32: p = (value & 0xFFFFFFFFL) | ((long) value << 32); break;
-            default: {    // General case (unoptimized)
+            default: {                          // General case (unoptimized)
                 for (int i=0; i<size; i++) {
                     setUnchecked(i, value);
                 }
@@ -218,8 +215,8 @@ public class IntegerList extends Abstrac
     /**
      * Adds the given element to this list.
      *
-     * @param  value The value to add.
-     * @return Always {@code true}.
+     * @param  value  the value to add.
+     * @return always {@code true}.
      * @throws NullPointerException if the given value is null.
      * @throws IllegalArgumentException if the given value is out of bounds.
      */
@@ -232,7 +229,7 @@ public class IntegerList extends Abstrac
     /**
      * Adds the given element as the {@code int} primitive type.
      *
-     * @param  value The value to add.
+     * @param  value  the value to add.
      * @throws IllegalArgumentException if the given value is out of bounds.
      *
      * @see #removeLast()
@@ -250,8 +247,8 @@ public class IntegerList extends Abstrac
     /**
      * Returns the element at the given index.
      *
-     * @param  index The element index.
-     * @return The value at the given index.
+     * @param  index  the element index.
+     * @return the value at the given index.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      */
     @Override
@@ -262,8 +259,8 @@ public class IntegerList extends Abstrac
     /**
      * Returns the element at the given index as the {@code int} primitive type.
      *
-     * @param  index The element index.
-     * @return The value at the given index.
+     * @param  index  the element index.
+     * @return the value at the given index.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      */
     public int getInt(final int index) throws IndexOutOfBoundsException {
@@ -275,8 +272,8 @@ public class IntegerList extends Abstrac
      * Returns the element at the given index as the {@code int} primitive type.
      * This argument does not check argument validity, since it is assumed already done.
      *
-     * @param  index The element index.
-     * @return The value at the given index.
+     * @param  index  the element index.
+     * @return the value at the given index.
      */
     private int getUnchecked(int index) {
         index *= bitCount;
@@ -295,9 +292,9 @@ public class IntegerList extends Abstrac
     /**
      * Sets the element at the given index.
      *
-     * @param  index The element index.
-     * @param  value The value at the given index.
-     * @return The previous value at the given index.
+     * @param  index  the element index.
+     * @param  value  the value at the given index.
+     * @return the previous value at the given index.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      * @throws IllegalArgumentException if the given value is out of bounds.
      * @throws NullPointerException if the given value is null.
@@ -312,8 +309,8 @@ public class IntegerList extends Abstrac
     /**
      * Sets the element at the given index as the {@code int} primitive type.
      *
-     * @param  index The element index.
-     * @param  value The value at the given index.
+     * @param  index  the element index.
+     * @param  value  the value at the given index.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      * @throws IllegalArgumentException if the given value is out of bounds.
      */
@@ -327,8 +324,8 @@ public class IntegerList extends Abstrac
      * Sets the element at the given index as the {@code int} primitive type.
      * This argument does not check argument validity, since it is assumed already done.
      *
-     * @param index The element index.
-     * @param value The value at the given index.
+     * @param  index  the element index.
+     * @param  value  the value at the given index.
      */
     private void setUnchecked(int index, int value) {
         index *= bitCount;
@@ -347,8 +344,8 @@ public class IntegerList extends Abstrac
     /**
      * Removes the element at the given index.
      *
-     * @param  index The index of the element to remove.
-     * @return The previous value of the element at the given index.
+     * @param  index  the index of the element to remove.
+     * @return the previous value of the element at the given index.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      */
     @Override
@@ -361,7 +358,7 @@ public class IntegerList extends Abstrac
     /**
      * Retrieves and remove the last element of this list.
      *
-     * @return The tail of this list.
+     * @return the tail of this list.
      * @throws NoSuchElementException if this list is empty.
      */
     public int removeLast() throws NoSuchElementException {
@@ -375,8 +372,8 @@ public class IntegerList extends Abstrac
      * Removes all values in the given range of index.
      * Shifts any succeeding elements to the left (reduces their index).
      *
-     * @param lower Index of the first element to remove, inclusive.
-     * @param upper Index after the last element to be removed.
+     * @param  lower  index of the first element to remove, inclusive.
+     * @param  upper  index after the last element to be removed.
      */
     @Override
     protected void removeRange(int lower, int upper) {
@@ -410,8 +407,8 @@ public class IntegerList extends Abstrac
     /**
      * Returns the occurrence of the given value in this list.
      *
-     * @param  value The value to search for.
-     * @return The number of time the given value occurs in this list.
+     * @param  value  the value to search for.
+     * @return the number of time the given value occurs in this list.
      */
     public int occurrence(final int value) {
         int count = 0;
@@ -434,7 +431,7 @@ public class IntegerList extends Abstrac
     /**
      * Returns a clone of this list.
      *
-     * @return A clone of this list.
+     * @return a clone of this list.
      */
     @Override
     public IntegerList clone() {
@@ -451,8 +448,8 @@ public class IntegerList extends Abstrac
     /**
      * Invokes {@link #trimToSize()} before serialization in order to make the stream more
compact.
      *
-     * @param  out The output stream where to serialize this list.
-     * @throws IOException If an I/O error occurred while writing.
+     * @param  out  the output stream where to serialize this list.
+     * @throws IOException if an I/O error occurred while writing.
      */
     private void writeObject(final ObjectOutputStream out) throws IOException {
         trimToSize();

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java?rev=1763840&r1=1763839&r2=1763840&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java
[UTF-8] Fri Oct  7 21:35:43 2016
@@ -199,9 +199,9 @@ public class DefaultNameFactory extends
      * Creates a type name from the given character sequence.
      * The default implementation returns a new or an existing {@link DefaultTypeName} instance.
      *
-     * @param  scope  the {@linkplain AbstractName#scope() scope} of the type
-     *         name to be created, or {@code null} for a global namespace.
-     * @param  name  the type name as a string or an international string.
+     * @param  scope  the {@linkplain AbstractName#scope() scope} of the type name to be
created,
+     *                or {@code null} for a global namespace.
+     * @param  name   the type name as a string or an international string.
      * @return the type name for the given character sequence.
      *
      * @see #toTypeName(Class)
@@ -216,11 +216,13 @@ public class DefaultNameFactory extends
      * Creates a member name from the given character sequence and attribute type.
      * The default implementation returns a new or an existing {@link DefaultMemberName}
instance.
      *
-     * @param  scope  the {@linkplain AbstractName#scope() scope} of the member
-     *         name to be created, or {@code null} for a global namespace.
-     * @param  name  the member name as a string or an international string.
+     * @param  scope  the {@linkplain AbstractName#scope() scope} of the member name to be
created,
+     *                or {@code null} for a global namespace.
+     * @param  name   the member name as a string or an international string.
      * @param  attributeType  the type of the data associated with the record member.
      * @return the member name for the given character sequence.
+     *
+     * @see Names#createMemberName(CharSequence, String, CharSequence, Class)
      */
     @Override
     public MemberName createMemberName(final NameSpace scope, final CharSequence name, final
TypeName attributeType) {
@@ -231,9 +233,9 @@ public class DefaultNameFactory extends
      * Creates a local name from the given character sequence.
      * The default implementation returns a new or an existing {@link DefaultLocalName} instance.
      *
-     * @param  scope  the {@linkplain AbstractName#scope() scope} of the local
-     *         name to be created, or {@code null} for a global namespace.
-     * @param  name  the local name as a string or an international string.
+     * @param  scope  the {@linkplain AbstractName#scope() scope} of the local name to be
created,
+     *                or {@code null} for a global namespace.
+     * @param  name   the local name as a string or an international string.
      * @return the local name for the given character sequence.
      *
      * @see Names#createLocalName(CharSequence, String, CharSequence)
@@ -257,10 +259,10 @@ public class DefaultNameFactory extends
      * array is 1, or an instance of {@link DefaultScopedName} if the length of the array
is 2
      * or more.
      *
-     * @param  scope  the {@linkplain AbstractName#scope() scope} of the generic name to
be created,
-     *         or {@code null} for a global namespace.
+     * @param  scope        the {@linkplain AbstractName#scope() scope} of the generic name
to be created,
+     *                      or {@code null} for a global namespace.
      * @param  parsedNames  the local names as an array of {@link String} or {@link InternationalString}
instances.
-     *         This array shall contain at least one element.
+     *                      This array shall contain at least one element.
      * @return the generic name for the given parsed names.
      *
      * @see #parseGenericName(NameSpace, CharSequence)
@@ -280,10 +282,9 @@ public class DefaultNameFactory extends
      * This method splits the given name around a separator inferred from the given scope,
or the
      * {@link DefaultNameSpace#DEFAULT_SEPARATOR ':'} separator if the given scope is null.
      *
-     * @param  scope  the {@linkplain AbstractName#scope() scope} of the generic name to
-     *         be created, or {@code null} for a global namespace.
-     * @param  name  the qualified name, as a sequence of names separated by a scope-dependent
-     *         separator.
+     * @param  scope  the {@linkplain AbstractName#scope() scope} of the generic name to
be created,
+     *                or {@code null} for a global namespace.
+     * @param  name   the qualified name, as a sequence of names separated by a scope-dependent
separator.
      * @return a name parsed from the given string.
      *
      * @see Names#parseGenericName(CharSequence, String, CharSequence)

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java?rev=1763840&r1=1763839&r2=1763840&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java [UTF-8]
(original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java [UTF-8]
Fri Oct  7 21:35:43 2016
@@ -72,7 +72,7 @@ import static org.apache.sis.util.Argume
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
- * @version 0.5
+ * @version 0.8
  * @module
  *
  * @see DefaultNameFactory
@@ -92,10 +92,10 @@ public final class Names extends Static
     /**
      * Creates a namespace for the given name.
      *
-     * @param  factory   The factory to use for creating the namespace.
-     * @param  namespace The namespace string, taken as a whole (not parsed).
-     * @param  separator The separator between the namespace and the local part, or {@code
null} for the default.
-     * @return The namespace object.
+     * @param  factory    the factory to use for creating the namespace.
+     * @param  namespace  the namespace string, taken as a whole (not parsed).
+     * @param  separator  the separator between the namespace and the local part, or {@code
null} for the default.
+     * @return the namespace object.
      */
     private static NameSpace createNameSpace(final NameFactory factory, final CharSequence
namespace, final String separator) {
         if (namespace == null || namespace.length() == 0) {
@@ -108,17 +108,19 @@ public final class Names extends Static
     /**
      * Creates a local or scoped name in the given namespace.
      * The character sequences can be either {@link String} or {@link InternationalString}
instances.
-     * The {@code namespace} character sequences is taken verbatim, while {@code scopedName}
is parsed
-     * as described in {@linkplain DefaultNameFactory#createGenericName(NameSpace, CharSequence...)
name factory}.
+     * The {@code namespace} character sequences is taken verbatim, while {@code scopedName}
is splitted
+     * around the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default separator}, which
is {@code ":"}.
      *
-     * @param  namespace  The namespace, or {@code null} for the global namespace.
-     * @param  separator  The separator between the namespace and the scoped name.
-     * @param  scopedName The name to parse.
-     * @return A local or scoped name in the given namespace.
+     * @param  namespace   the namespace, or {@code null} for the global namespace.
+     * @param  separator   the separator between the namespace and the scoped name, or {@code
null}
+     *                     for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default
separator}.
+     * @param  scopedName  the name to parse using {@code ':'} as the separator between components.
+     * @return a local or scoped name in the given namespace.
+     *
+     * @see DefaultNameFactory#parseGenericName(NameSpace, CharSequence)
      */
     public static GenericName parseGenericName(final CharSequence namespace, final String
separator, final CharSequence scopedName) {
         ensureNonNull("localPart", scopedName);
-        ensureNonNull("separator", separator);
         final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
         return factory.parseGenericName(createNameSpace(factory, namespace, separator), scopedName);
     }
@@ -158,14 +160,16 @@ public final class Names extends Static
      * to be created in the same namespace, then {@link DefaultNameFactory#createLocalName(NameSpace,
CharSequence)}
      * is more efficient since it allows to create the {@code NameSpace} object only once.</div>
      *
-     * @param  namespace The namespace, or {@code null} for the global namespace.
-     * @param  separator The separator between the namespace and the local part.
-     * @param  localPart The name which is locale in the given namespace.
-     * @return A local name in the given namespace.
+     * @param  namespace  the namespace, or {@code null} for the global namespace.
+     * @param  separator  the separator between the namespace and the local part, or {@code
null}
+     *                    for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default
separator}.
+     * @param  localPart  the name which is locale in the given namespace.
+     * @return a local name in the given namespace.
+     *
+     * @see DefaultNameFactory#createLocalName(NameSpace, CharSequence)
      */
     public static LocalName createLocalName(final CharSequence namespace, final String separator,
final CharSequence localPart) {
         ensureNonNull("localPart", localPart);
-        ensureNonNull("separator", separator);
         final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
         return factory.createLocalName(createNameSpace(factory, namespace, separator), localPart);
     }
@@ -182,14 +186,16 @@ public final class Names extends Static
      * to be created in the same namespace, then {@link DefaultNameFactory#createTypeName(NameSpace,
CharSequence)}
      * is more efficient since it allows to create the {@code NameSpace} object only once.</div>
      *
-     * @param  namespace The namespace, or {@code null} for the global namespace.
-     * @param  separator The separator between the namespace and the local part.
-     * @param  localPart The name which is locale in the given namespace.
-     * @return A type name in the given namespace.
+     * @param  namespace  the namespace, or {@code null} for the global namespace.
+     * @param  separator  the separator between the namespace and the local part, or {@code
null}
+     *                    for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default
separator}..
+     * @param  localPart  the name which is locale in the given namespace.
+     * @return a type name in the given namespace.
+     *
+     * @see DefaultNameFactory#createTypeName(NameSpace, CharSequence)
      */
     public static TypeName createTypeName(final CharSequence namespace, final String separator,
final CharSequence localPart) {
         ensureNonNull("localPart", localPart);
-        ensureNonNull("separator", separator);
         final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
         return factory.createTypeName(createNameSpace(factory, namespace, separator), localPart);
     }
@@ -202,17 +208,19 @@ public final class Names extends Static
      * need to be created, then {@link DefaultNameFactory#createMemberName(NameSpace, CharSequence,
TypeName)}
      * is more efficient since it allows to create the {@code NameSpace} and {@code TypeName}
objects only once.</div>
      *
-     * @param  namespace  The namespace, or {@code null} for the global namespace.
-     * @param  separator  The separator between the namespace and the local part.
-     * @param  localPart  The name which is locale in the given namespace.
-     * @param  valueClass The type of values, used for inferring a {@link TypeName} instance.
-     * @return A member name in the given namespace for values of the given type.
+     * @param  namespace  the namespace, or {@code null} for the global namespace.
+     * @param  separator  the separator between the namespace and the local part, or {@code
null}
+     *                    for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default
separator}..
+     * @param  localPart  the name which is locale in the given namespace.
+     * @param  valueClass the type of values, used for inferring a {@link TypeName} instance.
+     * @return a member name in the given namespace for values of the given type.
+     *
+     * @see DefaultNameFactory#createMemberName(NameSpace, CharSequence, TypeName)
      */
     public static MemberName createMemberName(final CharSequence namespace, final String
separator,
             final CharSequence localPart, final Class<?> valueClass)
     {
         ensureNonNull("localPart",  localPart);
-        ensureNonNull("separator",  separator);
         ensureNonNull("valueClass", valueClass);
         final DefaultNameFactory factory = DefaultFactories.forBuildin(NameFactory.class,
DefaultNameFactory.class);
         return factory.createMemberName(createNameSpace(factory, namespace, separator), localPart,
@@ -252,8 +260,8 @@ public final class Names extends Static
      *       namespaces.</li>
      * </ul>
      *
-     * @param  type The type name from which to infer a Java class.
-     * @return The Java class associated to the given {@code TypeName},
+     * @param  type  the type name from which to infer a Java class.
+     * @return the Java class associated to the given {@code TypeName},
      *         or {@code null} if there is no mapping from the given name to a Java class.
      * @throws UnknownNameException if a mapping from the given name to a Java class was
expected to exist
      *         (typically because of the {@linkplain DefaultTypeName#scope() scope}) but
the operation failed.
@@ -294,8 +302,8 @@ public final class Names extends Static
      * NameSpace    ::= name.{@linkplain AbstractName#scope() scope()}.{@linkplain DefaultNameSpace#name()
name()}.toString()
      * LocalPart    ::= name.{@linkplain AbstractName#toString() toString()}</pre></blockquote>
      *
-     * @param  name The generic name to format in expanded form, or {@code null}.
-     * @return Expanded form of the given generic name, or {@code null} if the given name
was null.
+     * @param  name  the generic name to format in expanded form, or {@code null}.
+     * @return expanded form of the given generic name, or {@code null} if the given name
was null.
      *
      * @see DefaultNameSpace#toString()
      */




Mime
View raw message