sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1764119 [6/11] - in /sis/trunk: ./ 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-metadat...
Date Mon, 10 Oct 2016 15:24:06 GMT
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java?rev=1764119&r1=1764118&r2=1764119&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java [UTF-8] Mon Oct 10 15:24:03 2016
@@ -120,11 +120,11 @@ public class NumberRange<E extends Numbe
      * Constructs a range of {@code byte} values.
      * This method may return a shared instance, at implementation choice.
      *
-     * @param  minValue       The minimal value.
+     * @param  minValue       the minimal value.
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
-     * @param  maxValue       The maximal value.
+     * @param  maxValue       the maximal value.
      * @param  isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
-     * @return The new range of numeric values for the given endpoints.
+     * @return the new range of numeric values for the given endpoints.
      */
     public static NumberRange<Byte> create(final byte minValue, final boolean isMinIncluded,
                                            final byte maxValue, final boolean isMaxIncluded)
@@ -138,11 +138,11 @@ public class NumberRange<E extends Numbe
      * Constructs a range of {@code short} values.
      * This method may return a shared instance, at implementation choice.
      *
-     * @param  minValue       The minimal value.
+     * @param  minValue       the minimal value.
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
-     * @param  maxValue       The maximal value.
+     * @param  maxValue       the maximal value.
      * @param  isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
-     * @return The new range of numeric values for the given endpoints.
+     * @return the new range of numeric values for the given endpoints.
      */
     public static NumberRange<Short> create(final short minValue, final boolean isMinIncluded,
                                             final short maxValue, final boolean isMaxIncluded)
@@ -156,11 +156,11 @@ public class NumberRange<E extends Numbe
      * Constructs a range of {@code int} values.
      * This method may return a shared instance, at implementation choice.
      *
-     * @param  minValue       The minimal value.
+     * @param  minValue       the minimal value.
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
-     * @param  maxValue       The maximal value.
+     * @param  maxValue       the maximal value.
      * @param  isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
-     * @return The new range of numeric values for the given endpoints.
+     * @return the new range of numeric values for the given endpoints.
      *
      * @see #createLeftBounded(int, boolean)
      */
@@ -176,11 +176,11 @@ public class NumberRange<E extends Numbe
      * Constructs a range of {@code long} values.
      * This method may return a shared instance, at implementation choice.
      *
-     * @param  minValue       The minimal value.
+     * @param  minValue       the minimal value.
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
-     * @param  maxValue       The maximal value.
+     * @param  maxValue       the maximal value.
      * @param  isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
-     * @return The new range of numeric values for the given endpoints.
+     * @return the new range of numeric values for the given endpoints.
      */
     public static NumberRange<Long> create(final long minValue, final boolean isMinIncluded,
                                            final long maxValue, final boolean isMaxIncluded)
@@ -195,11 +195,11 @@ public class NumberRange<E extends Numbe
      * The values can not be {@link Float#NaN}.
      * This method may return a shared instance, at implementation choice.
      *
-     * @param  minValue       The minimal value, or {@link Float#NEGATIVE_INFINITY} if none.
+     * @param  minValue       the minimal value, or {@link Float#NEGATIVE_INFINITY} if none.
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
-     * @param  maxValue       The maximal value, or {@link Float#POSITIVE_INFINITY} if none.
+     * @param  maxValue       the maximal value, or {@link Float#POSITIVE_INFINITY} if none.
      * @param  isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
-     * @return The new range of numeric values for the given endpoints.
+     * @return the new range of numeric values for the given endpoints.
      */
     public static NumberRange<Float> create(final float minValue, final boolean isMinIncluded,
                                             final float maxValue, final boolean isMaxIncluded)
@@ -225,11 +225,11 @@ public class NumberRange<E extends Numbe
      * The values can not be {@link Double#NaN}.
      * This method may return a shared instance, at implementation choice.
      *
-     * @param  minValue       The minimal value, or {@link Double#NEGATIVE_INFINITY} if none.
+     * @param  minValue       the minimal value, or {@link Double#NEGATIVE_INFINITY} if none.
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
-     * @param  maxValue       The maximal value, or {@link Double#POSITIVE_INFINITY} if none.
+     * @param  maxValue       the maximal value, or {@link Double#POSITIVE_INFINITY} if none.
      * @param  isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
-     * @return The new range of numeric values for the given endpoints.
+     * @return the new range of numeric values for the given endpoints.
      */
     public static NumberRange<Double> create(final double minValue, final boolean isMinIncluded,
                                              final double maxValue, final boolean isMaxIncluded)
@@ -259,9 +259,9 @@ public class NumberRange<E extends Numbe
      * We do not provide variants for other integer types because this method is typically invoked for
      * defining the {@linkplain org.apache.sis.feature.DefaultFeatureType cardinality of an attribute}.</div>
      *
-     * @param  minValue       The minimal value.
+     * @param  minValue       the minimal value.
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
-     * @return The new range of numeric values from {@code minValue} to positive infinity.
+     * @return the new range of numeric values from {@code minValue} to positive infinity.
      *
      * @see #create(int, boolean, int, boolean)
      *
@@ -272,10 +272,10 @@ public class NumberRange<E extends Numbe
     }
 
     /**
-     * Constructs a range using the smallest type of {@link Number} that can hold the
-     * given values. The given numbers don't need to be of the same type since they will
-     * be {@linkplain Numbers#cast(Number, Class) casted} as needed. More specifically
-     * this method returns:
+     * Constructs a range using the smallest type of {@link Number} that can hold the given values.
+     * The given numbers don't need to be of the same type since they will
+     * be {@linkplain Numbers#cast(Number, Class) casted} as needed.
+     * More specifically this method returns:
      *
      * <ul>
      *   <li>{@code NumberRange<Byte>} if the given values are integers between
@@ -291,11 +291,11 @@ public class NumberRange<E extends Numbe
      *
      * This method may return a shared instance, at implementation choice.
      *
-     * @param  minValue       The minimal value, or {@code null} if none.
+     * @param  minValue       the minimal value, or {@code null} if none.
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
-     * @param  maxValue       The maximal value, or {@code null} if none.
+     * @param  maxValue       the maximal value, or {@code null} if none.
      * @param  isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
-     * @return The new range, or {@code null} if both {@code minValue} and {@code maxValue} are {@code null}.
+     * @return the new range, or {@code null} if both {@code minValue} and {@code maxValue} are {@code null}.
      */
     @SuppressWarnings({"rawtypes","unchecked"})
     public static NumberRange<?> createBestFit(final Number minValue, final boolean isMinIncluded,
@@ -309,14 +309,13 @@ public class NumberRange<E extends Numbe
     }
 
     /**
-     * Returns the specified {@link Range} as a {@code NumberRange} object. If the specified
-     * range is already an instance of {@code NumberRange}, then it is returned unchanged.
-     * Otherwise a new number range is created using the {@linkplain #NumberRange(Range)
-     * copy constructor}.
-     *
-     * @param  <N> The type of elements in the given range.
-     * @param  range The range to cast or copy.
-     * @return The same range than {@code range} as a {@code NumberRange} object.
+     * Returns the specified {@link Range} as a {@code NumberRange} object.
+     * If the specified range is already an instance of {@code NumberRange}, then it is returned unchanged.
+     * Otherwise a new number range is created using the {@linkplain #NumberRange(Range) copy constructor}.
+     *
+     * @param  <N>    the type of elements in the given range.
+     * @param  range  the range to cast or copy.
+     * @return the same range than {@code range} as a {@code NumberRange} object.
      */
     public static <N extends Number & Comparable<? super N>> NumberRange<N> castOrCopy(final Range<N> range) {
         if (range instanceof NumberRange<?>) {
@@ -331,7 +330,7 @@ public class NumberRange<E extends Numbe
      * Constructs a range with the same type and the same values than the specified range.
      * This is a copy constructor.
      *
-     * @param range The range to copy. The elements must be {@link Number} instances.
+     * @param range the range to copy. The elements must be {@link Number} instances.
      */
     public NumberRange(final Range<E> range) {
         super(range);
@@ -344,11 +343,10 @@ public class NumberRange<E extends Numbe
      * the given type is not wide enough, then the values are truncated in the same way
      * than the Java language casts primitive types.
      *
-     * @param  type  The element type, restricted to one of {@link Byte}, {@link Short},
-     *               {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
-     * @param  range The range of values.
-     * @throws IllegalArgumentException If the given type is not one of the primitive
-     *         wrappers for numeric types.
+     * @param  type   the element type, restricted to one of {@link Byte}, {@link Short},
+     *                {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
+     * @param  range  the range of values.
+     * @throws IllegalArgumentException if the given type is not one of the primitive wrappers for numeric types.
      */
     public NumberRange(final Class<E> type, final ValueRange range) throws IllegalArgumentException {
         super(type, Numbers.cast(valueOf("minimum", range.minimum(), Double.NEGATIVE_INFINITY), type), range.isMinIncluded(),
@@ -358,12 +356,12 @@ public class NumberRange<E extends Numbe
     /**
      * Constructs a range of {@link Number} objects.
      *
-     * @param type           The element type, usually one of {@link Byte}, {@link Short},
-     *                       {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
-     * @param minValue       The minimal value, or {@code null} if none.
-     * @param isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
-     * @param maxValue       The maximal value, or {@code null} if none.
-     * @param isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
+     * @param  type           the element type, usually one of {@link Byte}, {@link Short},
+     *                        {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
+     * @param  minValue       the minimal value, or {@code null} if none.
+     * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
+     * @param  maxValue       the maximal value, or {@code null} if none.
+     * @param  isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
      */
     public NumberRange(final Class<E> type,
                        final E minValue, final boolean isMinIncluded,
@@ -373,14 +371,12 @@ public class NumberRange<E extends Numbe
     }
 
     /**
-     * Constructs a range with the same values than the specified range,
-     * casted to the specified type.
+     * Constructs a range with the same values than the specified range, casted to the specified type.
      *
-     * @param  type  The element type, usually one of {@link Byte}, {@link Short},
-     *               {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
-     * @param  range The range to copy. The elements must be {@link Number} instances.
-     * @throws IllegalArgumentException If the given type is not one of the primitive
-     *         wrappers for numeric types.
+     * @param  type   the element type, usually one of {@link Byte}, {@link Short},
+     *                {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
+     * @param  range  the range to copy. The elements must be {@link Number} instances.
+     * @throws IllegalArgumentException if the given type is not one of the primitive wrappers for numeric types.
      */
     NumberRange(final Class<E> type, final Range<? extends Number> range)
             throws IllegalArgumentException
@@ -401,16 +397,14 @@ public class NumberRange<E extends Numbe
     }
 
     /**
-     * Casts the specified range to the specified type.  If this class is associated to a unit of
-     * measurement, then this method converts the {@code range} unit to the same unit than this
-     * instance. This method is overridden by {@link MeasurementRange} only in the way described
-     * above.
-     *
-     * @param  type The class to cast to. Must be one of {@link Byte}, {@link Short},
-     *              {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
-     * @return The casted range, or {@code range} if no cast is needed.
-     * @throws IllegalArgumentException If the given type is not one of the primitive
-     *         wrappers for numeric types.
+     * Casts the specified range to the specified type.  If this class is associated to a unit of measurement,
+     * then this method converts the {@code range} unit to the same unit than this instance.
+     * This method is overridden by {@link MeasurementRange} only in the way described above.
+     *
+     * @param  type  the class to cast to. Must be one of {@link Byte}, {@link Short},
+     *               {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
+     * @return the casted range, or {@code range} if no cast is needed.
+     * @throws IllegalArgumentException if the given type is not one of the primitive wrappers for numeric types.
      */
     @SuppressWarnings("unchecked")
     <N extends Number & Comparable<? super N>>
@@ -428,12 +422,11 @@ public class NumberRange<E extends Numbe
      * type is a narrowing conversion, then the cast is performed according the rules of the
      * Java language: the high-order bytes are silently dropped.
      *
-     * @param  <N>   The class to cast to.
-     * @param  type  The class to cast to. Must be one of {@link Byte}, {@link Short},
+     * @param  <N>   the class to cast to.
+     * @param  type  the class to cast to. Must be one of {@link Byte}, {@link Short},
      *               {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
-     * @return The casted range, or {@code this} if this range already uses the specified type.
-     * @throws IllegalArgumentException If the given type is not one of the primitive
-     *         wrappers for numeric types.
+     * @return the casted range, or {@code this} if this range already uses the specified type.
+     * @throws IllegalArgumentException if the given type is not one of the primitive wrappers for numeric types.
      */
     @SuppressWarnings("unchecked")
     public <N extends Number & Comparable<? super N>> NumberRange<N> castTo(final Class<N> type)
@@ -458,22 +451,21 @@ public class NumberRange<E extends Numbe
      * Returns the {@linkplain #getMinValue() minimum value} as a {@code double}.
      * If this range is unbounded, then {@link Double#NEGATIVE_INFINITY} is returned.
      *
-     * @return The minimum value.
+     * @return the minimum value.
      */
     @SuppressWarnings("unchecked")
     public double getMinDouble() {
-        final Number value = (Number) getMinValue();
+        final Number value = getMinValue();
         return (value != null) ? value.doubleValue() : Double.NEGATIVE_INFINITY;
     }
 
     /**
-     * Returns the {@linkplain #getMinDouble() minimum value} with the specified inclusive or
-     * exclusive state. If this range is unbounded, then {@link Double#NEGATIVE_INFINITY} is
-     * returned.
-     *
-     * @param  inclusive {@code true} for the minimum value inclusive,
-     *         or {@code false} for the minimum value exclusive.
-     * @return The minimum value, inclusive or exclusive as requested.
+     * Returns the {@linkplain #getMinDouble() minimum value} with the specified inclusive or exclusive state.
+     * If this range is unbounded, then {@link Double#NEGATIVE_INFINITY} is returned.
+     *
+     * @param  inclusive  {@code true} for the minimum value inclusive, or
+     *                    {@code false} for the minimum value exclusive.
+     * @return the minimum value, inclusive or exclusive as requested.
      */
     public double getMinDouble(final boolean inclusive) {
         double value = getMinDouble();
@@ -487,22 +479,21 @@ public class NumberRange<E extends Numbe
      * Returns the {@linkplain #getMaxValue() maximum value} as a {@code double}.
      * If this range is unbounded, then {@link Double#POSITIVE_INFINITY} is returned.
      *
-     * @return The maximum value.
+     * @return the maximum value.
      */
     @SuppressWarnings("unchecked")
     public double getMaxDouble() {
-        final Number value = (Number) getMaxValue();
+        final Number value = getMaxValue();
         return (value != null) ? value.doubleValue() : Double.POSITIVE_INFINITY;
     }
 
     /**
-     * Returns the {@linkplain #getMaxDouble() maximum value} with the specified inclusive or
-     * exclusive state. If this range is unbounded, then {@link Double#POSITIVE_INFINITY} is
-     * returned.
-     *
-     * @param  inclusive {@code true} for the maximum value inclusive,
-     *         or {@code false} for the maximum value exclusive.
-     * @return The maximum value, inclusive or exclusive as requested.
+     * Returns the {@linkplain #getMaxDouble() maximum value} with the specified inclusive or exclusive state.
+     * If this range is unbounded, then {@link Double#POSITIVE_INFINITY} is returned.
+     *
+     * @param  inclusive  {@code true} for the maximum value inclusive, or
+     *                    {@code false} for the maximum value exclusive.
+     * @return the maximum value, inclusive or exclusive as requested.
      */
     public double getMaxDouble(final boolean inclusive) {
         double value = getMaxDouble();
@@ -515,10 +506,10 @@ public class NumberRange<E extends Numbe
     /**
      * Returns the next value for the given type.
      *
-     * @param  type  The element type.
-     * @param  value The value to increment or decrement.
-     * @param  up    {@code true} for incrementing, or {@code false} for decrementing.
-     * @return The adjacent value.
+     * @param  type   the element type.
+     * @param  value  the value to increment or decrement.
+     * @param  up     {@code true} for incrementing, or {@code false} for decrementing.
+     * @return the adjacent value.
      */
     private static double next(final Class<?> type, double value, final boolean up) {
         if (!up) {
@@ -546,7 +537,7 @@ public class NumberRange<E extends Numbe
      * This method converts {@code this} or the given argument to the widest numeric type,
      * then performs the same work than {@link #contains(Comparable)}.
      *
-     * @param  value The value to check for inclusion in this range.
+     * @param  value  the value to check for inclusion in this range.
      * @return {@code true} if the given value is included in this range.
      * @throws IllegalArgumentException if the given range can not be converted to a valid type
      *         through widening conversion.
@@ -579,7 +570,7 @@ public class NumberRange<E extends Numbe
      * This method converts {@code this} or the given argument to the widest numeric type,
      * then delegates to {@link #contains(Range)}.
      *
-     * @param  range The range to check for inclusion in this range.
+     * @param  range  the range to check for inclusion in this range.
      * @return {@code true} if the given range is included in this range.
      * @throws IllegalArgumentException if the given range can not be converted to a valid type
      *         through widening conversion, or if the units of measurement are not convertible.
@@ -600,7 +591,7 @@ public class NumberRange<E extends Numbe
      * This method converts {@code this} or the given argument to the widest numeric type,
      * then delegates to {@link #intersects(Range)}.
      *
-     * @param  range The range to check for inclusion in this range.
+     * @param  range  the range to check for inclusion in this range.
      * @return {@code true} if the given range is included in this range.
      * @throws IllegalArgumentException if the given range can not be converted to a valid type
      *         through widening conversion, or if the units of measurement are not convertible.
@@ -616,7 +607,7 @@ public class NumberRange<E extends Numbe
      * This method converts {@code this} or the given argument to the widest numeric type,
      * then delegates to {@link #intersect(Range)}.
      *
-     * @param  range The range to add to this range.
+     * @param  range  the range to add to this range.
      * @return The union of this range with the given range.
      * @throws IllegalArgumentException if the given range can not be converted to a valid type
      *         through widening conversion, or if the units of measurement are not convertible.
@@ -641,8 +632,8 @@ public class NumberRange<E extends Numbe
      * This method converts {@code this} or the given argument to the widest numeric type,
      * then delegates to {@link #union(Range)}.
      *
-     * @param  range The range to add to this range.
-     * @return The union of this range with the given range.
+     * @param  range  the range to add to this range.
+     * @return the union of this range with the given range.
      * @throws IllegalArgumentException if the given range can not be converted to a valid type
      *         through widening conversion, or if the units of measurement are not convertible.
      */
@@ -657,8 +648,8 @@ public class NumberRange<E extends Numbe
      * This method converts {@code this} or the given argument to the widest numeric type,
      * then delegates to {@link #subtract(Range)}.
      *
-     * @param  range The range to subtract.
-     * @return This range without the given range, as an array of length 0, 1 or 2.
+     * @param  range  the range to subtract.
+     * @return this range without the given range, as an array of length 0, 1 or 2.
      * @throws IllegalArgumentException if the given range can not be converted to a valid type
      *         through widening conversion, or if the units of measurement are not convertible.
      */

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java?rev=1764119&r1=1764118&r2=1764119&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java [UTF-8] Mon Oct 10 15:24:03 2016
@@ -119,7 +119,7 @@ public class Range<E extends Comparable<
      * Constructs a range with the same type and the same values than the specified range.
      * This is a copy constructor.
      *
-     * @param range The range to copy.
+     * @param  range  the range to copy.
      */
     public Range(final Range<E> range) {
         elementType   = range.elementType;
@@ -138,11 +138,11 @@ public class Range<E extends Comparable<
      * are enabled. This verification is not performed in normal execution because theoretically unnecessary
      * unless Java generic types have been tricked.</div>
      *
-     * @param elementType    The base type of the range elements.
-     * @param minValue       The minimal value, or {@code null} if none.
-     * @param isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
-     * @param maxValue       The maximal value, or {@code null} if none.
-     * @param isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
+     * @param  elementType    the base type of the range elements.
+     * @param  minValue       the minimal value, or {@code null} if none.
+     * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
+     * @param  maxValue       the maximal value, or {@code null} if none.
+     * @param  isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
      */
     public Range(final Class<E> elementType,
             final E minValue, final boolean isMinIncluded,
@@ -193,7 +193,7 @@ public class Range<E extends Comparable<
     /**
      * To be overridden by {@link MeasurementRange} only.
      *
-     * @return The unit of measurement, or {@code null}.
+     * @return the unit of measurement, or {@code null}.
      */
     Unit<?> unit() {
         return null;
@@ -224,7 +224,7 @@ public class Range<E extends Comparable<
      * If non-null, the returned value is either inclusive or exclusive depending on
      * the boolean returned by {@link #isMinIncluded()}.
      *
-     * @return The minimal value, or {@code null} if this range is unbounded on the lower side.
+     * @return the minimal value, or {@code null} if this range is unbounded on the lower side.
      */
     public E getMinValue() {
         return minValue;
@@ -246,7 +246,7 @@ public class Range<E extends Comparable<
      * If non-null, the returned value is either inclusive or exclusive depending on
      * the boolean returned by {@link #isMaxIncluded()}.
      *
-     * @return The maximal value, or {@code null} if this range is unbounded on the upper side.
+     * @return the maximal value, or {@code null} if this range is unbounded on the upper side.
      */
     public E getMaxValue() {
         return maxValue;
@@ -278,11 +278,11 @@ public class Range<E extends Comparable<
     @Override
     public final boolean isEmpty() {
         if (minValue == null || maxValue == null) {
-            return false; // Unbounded: can not be empty.
+            return false;                               // Unbounded: can not be empty.
         }
         final int c = minValue.compareTo(maxValue);
         if (c < 0) {
-            return false; // Minimum is smaller than maximum.
+            return false;                               // Minimum is smaller than maximum.
         }
         // If min and max are equal, then the range is empty if at least one of them is exclusive.
         return (c != 0) || !isMinIncluded || !isMaxIncluded;
@@ -294,7 +294,7 @@ public class Range<E extends Comparable<
      * stating that null {@linkplain #getMinValue() minimum} or {@linkplain #getMaxValue() maximum}
      * values are exclusive.
      *
-     * @param  value The value to check for inclusion in this range.
+     * @param  value  the value to check for inclusion in this range.
      * @return {@code true} if the given value is included in this range.
      */
     public boolean contains(final E value) {
@@ -332,9 +332,9 @@ public class Range<E extends Comparable<
     /**
      * Returns {@code true} if the supplied range is fully contained within this range.
      *
-     * @param  range The range to check for inclusion in this range.
+     * @param  range  the range to check for inclusion in this range.
      * @return {@code true} if the given range is included in this range.
-     * @throws IllegalArgumentException is the given range is incompatible,
+     * @throws IllegalArgumentException if the given range is incompatible,
      *         for example because of incommensurable units of measurement.
      */
     public boolean contains(final Range<? extends E> range) {
@@ -366,9 +366,9 @@ public class Range<E extends Comparable<
     /**
      * Returns {@code true} if this range intersects the given range.
      *
-     * @param  range The range to check for intersection with this range.
+     * @param  range  the range to check for intersection with this range.
      * @return {@code true} if the given range intersects this range.
-     * @throws IllegalArgumentException is the given range is incompatible,
+     * @throws IllegalArgumentException if the given range is incompatible,
      *         for example because of incommensurable units of measurement.
      */
     public boolean intersects(final Range<? extends E> range) {
@@ -379,12 +379,14 @@ public class Range<E extends Comparable<
     /**
      * Returns the intersection between this range and the given range.
      *
-     * @param  range The range to intersect.
-     * @return The intersection of this range with the given range.
-     * @throws IllegalArgumentException is the given range is incompatible,
+     * @param  range  the range to intersect.
+     * @return the intersection of this range with the given range.
+     * @throws IllegalArgumentException if the given range is incompatible,
      *         for example because of incommensurable units of measurement.
      */
     public Range<E> intersect(final Range<E> range) {
+        if (range.isEmpty()) return range;
+        if (this .isEmpty()) return this;
         /*
          * For two ranges [L₁ … H₁] and [L₂ … H₂], the intersection is given by
          * ([max(L₁, L₂) … min(H₁, H₂)]). Only two comparisons is needed.
@@ -411,12 +413,15 @@ public class Range<E extends Comparable<
     /**
      * Returns the union of this range with the given range.
      *
-     * @param  range The range to add to this range.
-     * @return The union of this range with the given range.
-     * @throws IllegalArgumentException is the given range is incompatible,
+     * @param  range  the range to add to this range.
+     * @return the union of this range with the given range.
+     * @throws IllegalArgumentException if the given range is incompatible,
      *         for example because of incommensurable units of measurement.
      */
     public Range<E> union(final Range<E> range) {
+        if (range.isEmpty()) return this;
+        if (this .isEmpty()) return range;
+
         final Range<E> union, min, max;
         min = compareMinTo(range.minValue, range.isMinIncluded ? 0 : -1) > 0 ? range : this;
         max = compareMaxTo(range.maxValue, range.isMaxIncluded ? 0 : +1) < 0 ? range : this;
@@ -441,9 +446,9 @@ public class Range<E extends Comparable<
      *   <li>Otherwise returns an array of length 1.</li>
      * </ul>
      *
-     * @param  range The range to subtract.
-     * @return This range without the given range, as an array of length 0, 1 or 2.
-     * @throws IllegalArgumentException is the given range is incompatible,
+     * @param  range  the range to subtract.
+     * @return this range without the given range, as an array of length 0, 1 or 2.
+     * @throws IllegalArgumentException if the given range is incompatible,
      *         for example because of incommensurable units of measurement.
      */
     public Range<E>[] subtract(final Range<E> range) {
@@ -494,9 +499,9 @@ public class Range<E extends Comparable<
      *
      * Note that the non-zero position shall be exactly -1 or +1, not arbitrary negative or positive.
      *
-     * @param  value    An endpoint value of the other range to be compared to the minimal value of this range.
-     * @param  position The position of {@code value} relative to the inclusive values of the other range.
-     * @return Position (-, + or 0) of the inclusive values of this range compared to the other range.
+     * @param  value     an endpoint value of the other range to be compared to the minimal value of this range.
+     * @param  position  the position of {@code value} relative to the inclusive values of the other range.
+     * @return position (-, + or 0) of the inclusive values of this range compared to the other range.
      *
      * @see #contains(Range)
      */
@@ -572,7 +577,7 @@ public class Range<E extends Comparable<
      *
      * Note that subclasses may add other requirements, for example on units of measurement.
      *
-     * @param  object The object to compare with this range for equality.
+     * @param  object  the object to compare with this range for equality.
      * @return {@code true} if the given object is equal to this range.
      */
     @Override
@@ -696,10 +701,10 @@ public class Range<E extends Comparable<
      * be formatted using the {@linkplain RangeFormat#isAlternateForm() alternate form}
      * for exclusive bounds.</p>
      *
-     * @param formatter The formatter in which to format this angle.
-     * @param flags     {@link FormattableFlags#LEFT_JUSTIFY} for left alignment, or 0 for right alignment.
-     * @param width     Minimal number of characters to write, padding with {@code ' '} if necessary.
-     * @param precision Maximal number of characters to write, or -1 if no limit.
+     * @param  formatter  the formatter in which to format this angle.
+     * @param  flags      {@link FormattableFlags#LEFT_JUSTIFY} for left alignment, or 0 for right alignment.
+     * @param  width      minimal number of characters to write, padding with {@code ' '} if necessary.
+     * @param  precision  maximal number of characters to write, or -1 if no limit.
      */
     @Override
     public void formatTo(final Formatter formatter, final int flags, final int width, int precision) {

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java?rev=1764119&r1=1764118&r2=1764119&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java [UTF-8] Mon Oct 10 15:24:03 2016
@@ -95,8 +95,8 @@ public final class ArgumentChecks extend
      * Makes sure that an argument is non-null. If the given {@code object} is null, then a
      * {@link NullArgumentException} is thrown with a localized message containing the given name.
      *
-     * @param  name The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  object The user argument to check against null value.
+     * @param  name    the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  object  the user argument to check against null value.
      * @throws NullArgumentException if {@code object} is null.
      */
     public static void ensureNonNull(final String name, final Object object)
@@ -121,9 +121,9 @@ public final class ArgumentChecks extend
      *       then the formatted message will contain {@code "axes[2]"}.</li>
      * </ul>
      *
-     * @param  name    The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  index   The Index of the element to check in an array or a list. Used only if an exception is thrown.
-     * @param  element The array or list element to check against null value.
+     * @param  name     the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  index    the Index of the element to check in an array or a list. Used only if an exception is thrown.
+     * @param  element  the array or list element to check against null value.
      * @throws NullArgumentException if {@code element} is null.
      */
     public static void ensureNonNullElement(final String name, final int index, final Object element)
@@ -148,8 +148,8 @@ public final class ArgumentChecks extend
      * a {@linkplain CharSequence#length() length} equals to 0, then an {@link IllegalArgumentException}
      * is thrown.
      *
-     * @param  name The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  text The user argument to check against null value and empty sequences.
+     * @param  name  the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  text  the user argument to check against null value and empty sequences.
      * @throws NullArgumentException if {@code text} is null.
      * @throws IllegalArgumentException if {@code text} is empty.
      */
@@ -169,10 +169,10 @@ public final class ArgumentChecks extend
      * If this method does not thrown an exception, then the value can be casted to the class
      * represented by {@code expectedType} without throwing a {@link ClassCastException}.
      *
-     * @param  name The name of the argument to be checked, used only if an exception is thrown.
+     * @param  name  the name of the argument to be checked, used only if an exception is thrown.
      *         Can be {@code null} if the name is unknown.
      * @param  expectedType the expected type (class or interface).
-     * @param  value The value to check, or {@code null}.
+     * @param  value  the value to check, or {@code null}.
      * @throws IllegalArgumentException if {@code value} is non-null and is not assignable to the given type.
      *
      * @see org.apache.sis.util.collection.Containers#property(Map, Object, Class)
@@ -202,9 +202,9 @@ public final class ArgumentChecks extend
      * upper value. This method is designed for methods that expect an index value as the only
      * argument. For this reason, this method does not take the argument name.
      *
-     * @param  upper The maximal index value, exclusive.
-     * @param  index The index to check.
-     * @throws IndexOutOfBoundsException If the given index is negative or not lower than the
+     * @param  upper  the maximal index value, exclusive.
+     * @param  index  the index to check.
+     * @throws IndexOutOfBoundsException if the given index is negative or not lower than the
      *         given upper value.
      *
      * @see #ensurePositive(String, int)
@@ -225,10 +225,10 @@ public final class ArgumentChecks extend
      * because this information is assumed to be provided by the implementation rather than
      * the user.</p>
      *
-     * @param  length The length of the sequence (array, {@link CharSequence}, <i>etc.</i>).
-     * @param  lower  The user-specified lower index, inclusive.
-     * @param  upper  The user-specified upper index, exclusive.
-     * @throws IndexOutOfBoundsException If the given [{@code lower} … {@code upper}]
+     * @param  length  the length of the sequence (array, {@link CharSequence}, <i>etc.</i>).
+     * @param  lower   the user-specified lower index, inclusive.
+     * @param  upper   the user-specified upper index, exclusive.
+     * @throws IndexOutOfBoundsException if the given [{@code lower} … {@code upper}]
      *         range is out of the sequence index range.
      *
      * @see #ensureSizeBetween(String, int, int, int)
@@ -244,8 +244,8 @@ public final class ArgumentChecks extend
      * This method is used for checking values that are <strong>not</strong> index.
      * For checking index values, use {@link #ensureValidIndex(int, int)} instead.
      *
-     * @param  name   The name of the argument to be checked, used only if an exception is thrown.
-     * @param  value  The user argument to check.
+     * @param  name   the name of the argument to be checked, used only if an exception is thrown.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is negative.
      *
      * @see #ensureValidIndex(int, int)
@@ -263,8 +263,8 @@ public final class ArgumentChecks extend
     /**
      * Ensures that the given long value is greater than or equals to zero.
      *
-     * @param  name   The name of the argument to be checked, used only if an exception is thrown.
-     * @param  value  The user argument to check.
+     * @param  name   the name of the argument to be checked, used only if an exception is thrown.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is negative.
      *
      * @see #ensureStrictlyPositive(String, long)
@@ -283,8 +283,8 @@ public final class ArgumentChecks extend
      * {@linkplain Float#isNaN(float) NaN} and is greater than or equals to zero. Note that
      * {@linkplain Float#POSITIVE_INFINITY positive infinity} is considered a valid value.
      *
-     * @param  name   The name of the argument to be checked, used only if an exception is thrown.
-     * @param  value  The user argument to check.
+     * @param  name   the name of the argument to be checked, used only if an exception is thrown.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is NaN or negative.
      *
      * @see #ensureStrictlyPositive(String, float)
@@ -292,7 +292,7 @@ public final class ArgumentChecks extend
     public static void ensurePositive(final String name, final float value)
             throws IllegalArgumentException
     {
-        if (!(value >= 0)) { // Use '!' for catching NaN.
+        if (!(value >= 0)) {                                                // Use '!' for catching NaN.
             throw new IllegalArgumentException(Float.isNaN(value) ?
                     Errors.format(Errors.Keys.NotANumber_1, name) :
                     Errors.format(Errors.Keys.NegativeArgument_2, name, value));
@@ -304,8 +304,8 @@ public final class ArgumentChecks extend
      * {@linkplain Double#isNaN(double) NaN} and is greater than or equals to zero. Note that
      * {@linkplain Double#POSITIVE_INFINITY positive infinity} is considered a valid value.
      *
-     * @param  name   The name of the argument to be checked, used only if an exception is thrown.
-     * @param  value  The user argument to check.
+     * @param  name   the name of the argument to be checked, used only if an exception is thrown.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is NaN or negative.
      *
      * @see #ensureStrictlyPositive(String, double)
@@ -313,7 +313,7 @@ public final class ArgumentChecks extend
     public static void ensurePositive(final String name, final double value)
             throws IllegalArgumentException
     {
-        if (!(value >= 0)) { // Use '!' for catching NaN.
+        if (!(value >= 0)) {                                                // Use '!' for catching NaN.
             throw new IllegalArgumentException(Double.isNaN(value) ?
                     Errors.format(Errors.Keys.NotANumber_1, name)  :
                     Errors.format(Errors.Keys.NegativeArgument_2, name, value));
@@ -323,8 +323,8 @@ public final class ArgumentChecks extend
     /**
      * Ensures that the given integer value is greater than zero.
      *
-     * @param  name   The name of the argument to be checked, used only if an exception is thrown.
-     * @param  value  The user argument to check.
+     * @param  name   the name of the argument to be checked, used only if an exception is thrown.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is negative or equals to zero.
      *
      * @see #ensurePositive(String, int)
@@ -341,8 +341,8 @@ public final class ArgumentChecks extend
     /**
      * Ensures that the given long value is greater than zero.
      *
-     * @param  name   The name of the argument to be checked, used only if an exception is thrown.
-     * @param  value  The user argument to check.
+     * @param  name   the name of the argument to be checked, used only if an exception is thrown.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is negative or equals to zero.
      *
      * @see #ensurePositive(String, long)
@@ -361,8 +361,8 @@ public final class ArgumentChecks extend
      * {@linkplain Float#isNaN(float) NaN} and is greater than zero. Note that
      * {@linkplain Float#POSITIVE_INFINITY positive infinity} is considered a valid value.
      *
-     * @param  name   The name of the argument to be checked, used only if an exception is thrown.
-     * @param  value  The user argument to check.
+     * @param  name   the name of the argument to be checked, used only if an exception is thrown.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is NaN, zero or negative.
      *
      * @see #ensurePositive(String, float)
@@ -370,7 +370,7 @@ public final class ArgumentChecks extend
     public static void ensureStrictlyPositive(final String name, final float value)
             throws IllegalArgumentException
     {
-        if (!(value > 0)) { // Use '!' for catching NaN.
+        if (!(value > 0)) {                                                 // Use '!' for catching NaN.
             throw new IllegalArgumentException(Float.isNaN(value) ?
                     Errors.format(Errors.Keys.NotANumber_1, name) :
                     Errors.format(Errors.Keys.ValueNotGreaterThanZero_2, name, value));
@@ -382,8 +382,8 @@ public final class ArgumentChecks extend
      * {@linkplain Double#isNaN(double) NaN} and is greater than zero. Note that
      * {@linkplain Double#POSITIVE_INFINITY positive infinity} is considered a valid value.
      *
-     * @param  name   The name of the argument to be checked, used only if an exception is thrown.
-     * @param  value  The user argument to check.
+     * @param  name   the name of the argument to be checked, used only if an exception is thrown.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is NaN, zero or negative.
      *
      * @see #ensurePositive(String, double)
@@ -391,7 +391,7 @@ public final class ArgumentChecks extend
     public static void ensureStrictlyPositive(final String name, final double value)
             throws IllegalArgumentException
     {
-        if (!(value > 0)) { // Use '!' for catching NaN.
+        if (!(value > 0)) {                                                 // Use '!' for catching NaN.
             throw new IllegalArgumentException(Double.isNaN(value) ?
                     Errors.format(Errors.Keys.NotANumber_1, name)  :
                     Errors.format(Errors.Keys.ValueNotGreaterThanZero_2, name, value));
@@ -403,8 +403,8 @@ public final class ArgumentChecks extend
      * {@linkplain Float#isNaN(float) NaN} neither {@linkplain Float#isInfinite(float)}.
      * The value can be negative, zero or positive.
      *
-     * @param  name   The name of the argument to be checked, used only if an exception is thrown.
-     * @param  value  The user argument to check.
+     * @param  name   the name of the argument to be checked, used only if an exception is thrown.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is NaN or infinite.
      */
     public static void ensureFinite(final String name, final float value) {
@@ -420,8 +420,8 @@ public final class ArgumentChecks extend
      * {@linkplain Double#isNaN(double) NaN} neither {@linkplain Double#isInfinite(double)}.
      * The value can be negative, zero or positive.
      *
-     * @param  name   The name of the argument to be checked, used only if an exception is thrown.
-     * @param  value  The user argument to check.
+     * @param  name   the name of the argument to be checked, used only if an exception is thrown.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is NaN or infinite.
      */
     public static void ensureFinite(final String name, final double value) {
@@ -445,10 +445,10 @@ public final class ArgumentChecks extend
      *       argument is an index in a list or an array.</li>
      * </ul>
      *
-     * @param  name  The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  min   The minimal value, inclusive.
-     * @param  max   The maximal value, inclusive.
-     * @param  value The user argument to check.
+     * @param  name   the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  min    the minimal value, inclusive.
+     * @param  max    the maximal value, inclusive.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is not in the given range.
      *
      * @see #ensureSizeBetween(String, int, int, int)
@@ -467,10 +467,10 @@ public final class ArgumentChecks extend
     /**
      * Ensures that the given long value is between the given bounds, inclusive.
      *
-     * @param  name  The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  min   The minimal value, inclusive.
-     * @param  max   The maximal value, inclusive.
-     * @param  value The user argument to check.
+     * @param  name   the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  min    the minimal value, inclusive.
+     * @param  max    the maximal value, inclusive.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is not in the given range.
      */
     public static void ensureBetween(final String name, final long min, final long max, final long value)
@@ -485,10 +485,10 @@ public final class ArgumentChecks extend
     /**
      * Ensures that the given floating point value is between the given bounds, inclusive.
      *
-     * @param  name  The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  min   The minimal value, inclusive.
-     * @param  max   The maximal value, inclusive.
-     * @param  value The user argument to check.
+     * @param  name   the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  min    the minimal value, inclusive.
+     * @param  max    the maximal value, inclusive.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is NaN or not in the given range.
      */
     public static void ensureBetween(final String name, final float min, final float max, final float value)
@@ -504,10 +504,10 @@ public final class ArgumentChecks extend
     /**
      * Ensures that the given floating point value is between the given bounds, inclusive.
      *
-     * @param  name  The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  min   The minimal value, inclusive.
-     * @param  max   The maximal value, inclusive.
-     * @param  value The user argument to check.
+     * @param  name   the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  min    the minimal value, inclusive.
+     * @param  max    the maximal value, inclusive.
+     * @param  value  the user argument to check.
      * @throws IllegalArgumentException if the given value is NaN or not in the given range.
      */
     public static void ensureBetween(final String name, final double min, final double max, final double value)
@@ -525,10 +525,10 @@ public final class ArgumentChecks extend
      * This method performs the same check than {@link #ensureBetween(String, int, int, int)
      * ensureBetween(…)}, but the error message is different in case of failure.
      *
-     * @param  name  The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  min   The minimal size (inclusive), or 0 if none.
-     * @param  max   The maximal size (inclusive), or {@link Integer#MAX_VALUE} if none.
-     * @param  size  The user collection size or array length to be checked.
+     * @param  name  the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  min   the minimal size (inclusive), or 0 if none.
+     * @param  max   the maximal size (inclusive), or {@link Integer#MAX_VALUE} if none.
+     * @param  size  the user collection size or array length to be checked.
      * @throws IllegalArgumentException if the given value is not in the given range.
      *
      * @see #ensureBetween(String, int, int, int)
@@ -556,8 +556,8 @@ public final class ArgumentChecks extend
      * Ensures that the given integer is a valid Unicode code point. The range of valid code points goes
      * from {@link Character#MIN_CODE_POINT U+0000} to {@link Character#MAX_CODE_POINT U+10FFFF} inclusive.
      *
-     * @param  name The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  code The Unicode code point to verify.
+     * @param  name  the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  code  the Unicode code point to verify.
      * @throws IllegalArgumentException if the given value is not a valid Unicode code point.
      *
      * @since 0.4
@@ -573,9 +573,9 @@ public final class ArgumentChecks extend
      * Ensures that the given CRS, if non-null, has the expected number of dimensions.
      * This method does nothing if the given coordinate reference system is null.
      *
-     * @param  name     The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  expected The expected number of dimensions.
-     * @param  crs      The coordinate reference system to check for its dimension, or {@code null}.
+     * @param  name      the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  expected  the expected number of dimensions.
+     * @param  crs       the coordinate reference system to check for its dimension, or {@code null}.
      * @throws MismatchedDimensionException if the given coordinate reference system is non-null
      *         and does not have the expected number of dimensions.
      */
@@ -598,9 +598,9 @@ public final class ArgumentChecks extend
      * Ensures that the given coordinate system, if non-null, has the expected number of dimensions.
      * This method does nothing if the given coordinate system is null.
      *
-     * @param  name     The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  expected The expected number of dimensions.
-     * @param  cs       The coordinate system to check for its dimension, or {@code null}.
+     * @param  name      the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  expected  the expected number of dimensions.
+     * @param  cs        the coordinate system to check for its dimension, or {@code null}.
      * @throws MismatchedDimensionException if the given coordinate system is non-null
      *         and does not have the expected number of dimensions.
      *
@@ -622,10 +622,10 @@ public final class ArgumentChecks extend
      * Ensures that the given vector, if non-null, has the expected number of dimensions
      * (taken as its length). This method does nothing if the given vector is null.
      *
-     * @param  name     The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  expected The expected number of dimensions.
-     * @param  vector   The vector to check for its number of dimensions, or {@code null}.
-     * @throws MismatchedDimensionException If the given vector is non-null and does not have the
+     * @param  name      the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  expected  the expected number of dimensions.
+     * @param  vector    the vector to check for its number of dimensions, or {@code null}.
+     * @throws MismatchedDimensionException if the given vector is non-null and does not have the
      *         expected number of dimensions (taken as its length).
      */
     public static void ensureDimensionMatches(final String name, final int expected, final double[] vector)
@@ -644,10 +644,10 @@ public final class ArgumentChecks extend
      * Ensures that the given direct position, if non-null, has the expected number of dimensions.
      * This method does nothing if the given direct position is null.
      *
-     * @param  name     The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  expected The expected number of dimensions.
-     * @param  position The direct position to check for its dimension, or {@code null}.
-     * @throws MismatchedDimensionException If the given direct position is non-null and does
+     * @param  name      the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  expected  the expected number of dimensions.
+     * @param  position  the direct position to check for its dimension, or {@code null}.
+     * @throws MismatchedDimensionException if the given direct position is non-null and does
      *         not have the expected number of dimensions.
      */
     public static void ensureDimensionMatches(final String name, final int expected, final DirectPosition position)
@@ -666,10 +666,10 @@ public final class ArgumentChecks extend
      * Ensures that the given envelope, if non-null, has the expected number of dimensions.
      * This method does nothing if the given envelope is null.
      *
-     * @param  name     The name of the argument to be checked. Used only if an exception is thrown.
-     * @param  expected The expected number of dimensions.
-     * @param  envelope The envelope to check for its dimension, or {@code null}.
-     * @throws MismatchedDimensionException If the given envelope is non-null and does
+     * @param  name      the name of the argument to be checked. Used only if an exception is thrown.
+     * @param  expected  the expected number of dimensions.
+     * @param  envelope  the envelope to check for its dimension, or {@code null}.
+     * @throws MismatchedDimensionException if the given envelope is non-null and does
      *         not have the expected number of dimensions.
      */
     public static void ensureDimensionMatches(final String name, final int expected, final Envelope envelope)

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1764119&r1=1764118&r2=1764119&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] Mon Oct 10 15:24:03 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/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java?rev=1764119&r1=1764118&r2=1764119&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8] Mon Oct 10 15:24:03 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/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java?rev=1764119&r1=1764118&r2=1764119&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java [UTF-8] Mon Oct 10 15:24:03 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();




Mime
View raw message