sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1763840 [6/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/measure/MeasurementRange.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java?rev=1763840&r1=1763839&r2=1763840&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java [UTF-8] Fri Oct  7 21:35:43 2016
@@ -74,12 +74,12 @@ public class MeasurementRange<E extends
      * Constructs a range of {@code float} values.
      * 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.
-     * @param  unit           The unit of measurement, or {@code null} if unknown.
-     * @return The new range of numeric values for the given endpoints and unit of measurement.
+     * @param  unit           the unit of measurement, or {@code null} if unknown.
+     * @return the new range of numeric values for the given endpoints and unit of measurement.
      */
     public static MeasurementRange<Float> create(float minValue, boolean isMinIncluded,
                                                  float maxValue, boolean isMaxIncluded, Unit<?> unit)
@@ -93,12 +93,12 @@ public class MeasurementRange<E extends
      * Constructs a range of {@code double} values.
      * 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.
-     * @param  unit           The unit of measurement, or {@code null} if unknown.
-     * @return The new range of numeric values for the given endpoints and unit of measurement.
+     * @param  unit           the unit of measurement, or {@code null} if unknown.
+     * @return the new range of numeric values for the given endpoints and unit of measurement.
      */
     public static MeasurementRange<Double> create(double minValue, boolean isMinIncluded,
                                                   double maxValue, boolean isMaxIncluded, Unit<?> unit)
@@ -113,9 +113,9 @@ public class MeasurementRange<E extends
      * The {@code minValue} is often zero for creating a range of strictly positive values.
      * This method may return a shared instance, at implementation choice.
      *
-     * @param  minValue The minimal value (exclusive), or {@link Double#NEGATIVE_INFINITY} if none.
-     * @param  unit The unit of measurement, or {@code null} if unknown.
-     * @return The new range of numeric values greater than the given value.
+     * @param  minValue  the minimal value (exclusive), or {@link Double#NEGATIVE_INFINITY} if none.
+     * @param  unit      the unit of measurement, or {@code null} if unknown.
+     * @return the new range of numeric values greater than the given value.
      *
      * @since 0.6
      */
@@ -131,12 +131,12 @@ public class MeasurementRange<E extends
      *
      * <p>This method may return a shared instance, at implementation choice.</p>
      *
-     * @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.
-     * @param  unit           The unit of measurement, or {@code null} if unknown.
-     * @return The new range, or {@code null} if both {@code minValue} and {@code maxValue} are {@code null}.
+     * @param  unit           the unit of measurement, or {@code null} if unknown.
+     * @return the new range, or {@code null} if both {@code minValue} and {@code maxValue} are {@code null}.
      *
      * @see NumberRange#createBestFit(Number, boolean, Number, boolean)
      */
@@ -158,8 +158,8 @@ public class MeasurementRange<E extends
      * Constructs a range with the same values than the specified range and the given unit.
      * This is a copy constructor, with the addition of a unit of measurement.
      *
-     * @param range The range to copy. The elements must be {@link Number} instances.
-     * @param unit  The unit of measurement, or {@code null} if unknown.
+     * @param  range  the range to copy. The elements must be {@link Number} instances.
+     * @param  unit   the unit of measurement, or {@code null} if unknown.
      */
     public MeasurementRange(final Range<E> range, final Unit<?> unit) {
         super(range);
@@ -173,12 +173,11 @@ public class MeasurementRange<E extends
      * 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.
-     * @param  unit  The unit of measurement, or {@code null} if unknown.
-     * @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.
+     * @param  unit   the unit of measurement, or {@code null} if unknown.
+     * @throws IllegalArgumentException if the given type is not one of the primitive wrappers for numeric types.
      */
     public MeasurementRange(final Class<E> type, final ValueRange range, final Unit<?> unit) throws IllegalArgumentException {
         super(type, range);
@@ -188,12 +187,12 @@ public class MeasurementRange<E extends
     /**
      * Constructs a range of {@link Number} objects.
      *
-     * @param type          The element type, usually one of {@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 unit          The unit of measurement, or {@code null} if unknown.
+     * @param type           the element type, usually one of {@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 unit           the unit of measurement, or {@code null} if unknown.
      */
     public MeasurementRange(final Class<E> type,
                             final E minValue, final boolean isMinIncluded,
@@ -205,13 +204,12 @@ public class MeasurementRange<E extends
     }
 
     /**
-     * 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.
-     * @param unit  The unit of measurement, or {@code null} if unknown.
+     * @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.
+     * @param  unit   the unit of measurement, or {@code null} if unknown.
      */
     private MeasurementRange(final Class<E> type, final Range<? extends Number> range, final Unit<?> unit) {
         super(type, range);
@@ -231,7 +229,7 @@ public class MeasurementRange<E extends
     /**
      * Returns the unit of measurement, or {@code null} if unknown.
      *
-     * @return The unit of measurement, or {@code null}.
+     * @return the unit of measurement, or {@code null}.
      */
     @Override
     public Unit<?> unit() {
@@ -243,10 +241,9 @@ public class MeasurementRange<E extends
      * then the specified target unit are simply assigned to the returned range with no
      * other changes.
      *
-     * @param  targetUnit the target unit, or {@code null} for keeping the unit unchanged.
-     * @return The converted range, or {@code this} if no conversion is needed.
-     * @throws ConversionException if the target unit are not compatible with
-     *         this {@linkplain #unit() range unit}.
+     * @param  targetUnit  the target unit, or {@code null} for keeping the unit unchanged.
+     * @return the converted range, or {@code this} if no conversion is needed.
+     * @throws ConversionException if the target unit are not compatible with this {@linkplain #unit() range unit}.
      */
     public MeasurementRange<E> convertTo(final Unit<?> targetUnit) throws ConversionException {
         return convertAndCast(elementType, targetUnit);
@@ -271,10 +268,9 @@ public class MeasurementRange<E extends
      * If the given range is an instance of {@code MeasurementRange}, converts that
      * range to the unit of this range. Otherwise returns the given range unchanged.
      *
-     * @param  range The range to convert.
-     * @return The converted range.
-     * @throws IllegalArgumentException if the given target unit is not compatible with
-     *         the unit of this range.
+     * @param  range  the range to convert.
+     * @return the converted range.
+     * @throws IllegalArgumentException if the given target unit is not compatible with the unit of this range.
      */
     private <N extends E> Range<N> convert(final Range<N> range) throws IllegalArgumentException {
         if (range instanceof MeasurementRange<?>) try {
@@ -291,9 +287,9 @@ public class MeasurementRange<E extends
      * measurement, then this method convert the {@code range} unit to the same unit than this
      * instance.
      *
-     * @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.
+     * @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.
      */
     @Override
     <N extends Number & Comparable<? super N>>
@@ -314,12 +310,11 @@ public class MeasurementRange<E extends
      * This method is invoked on the {@code other} instance in expressions like
      * {@code this.operation(other)}.
      *
-     * @param  type The class to cast to. Must be one of {@link Byte}, {@link Short},
-     *             {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
+     * @param  type  the class to cast to. Must be one of {@link Byte}, {@link Short},
+     *               {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
      * @param  targetUnit the target unit, or {@code null} for no change.
-     * @return The casted range, or {@code this}.
-     * @throws ConversionException if the given target unit is not compatible with
-     *         the unit of this range.
+     * @return the casted range, or {@code this}.
+     * @throws ConversionException if the given target unit is not compatible with the unit of this range.
      */
     @SuppressWarnings("unchecked")
     private <N extends Number & Comparable<? super N>> MeasurementRange<N>
@@ -369,7 +364,7 @@ public class MeasurementRange<E extends
      * the operation.
      *
      * @return {@inheritDoc}
-     * @throws IllegalArgumentException is the given range is an instance of
+     * @throws IllegalArgumentException if the given range is an instance of
      *         {@code MeasurementRange} using incommensurable unit of measurement.
      */
     @Override
@@ -384,7 +379,7 @@ public class MeasurementRange<E extends
      * the operation.
      *
      * @return {@inheritDoc}
-     * @throws IllegalArgumentException is the given range is an instance of
+     * @throws IllegalArgumentException if the given range is an instance of
      *         {@code MeasurementRange} using incommensurable unit of measurement.
      */
     @Override
@@ -399,7 +394,7 @@ public class MeasurementRange<E extends
      * the operation.
      *
      * @return {@inheritDoc}
-     * @throws IllegalArgumentException is the given range is an instance of
+     * @throws IllegalArgumentException if the given range is an instance of
      *         {@code MeasurementRange} using incommensurable unit of measurement.
      */
     @Override
@@ -414,7 +409,7 @@ public class MeasurementRange<E extends
      * the operation.
      *
      * @return {@inheritDoc}
-     * @throws IllegalArgumentException is the given range is an instance of
+     * @throws IllegalArgumentException if the given range is an instance of
      *         {@code MeasurementRange} using incommensurable unit of measurement.
      */
     @Override
@@ -429,7 +424,7 @@ public class MeasurementRange<E extends
      * the operation.
      *
      * @return {@inheritDoc}
-     * @throws IllegalArgumentException is the given range is an instance of
+     * @throws IllegalArgumentException if the given range is an instance of
      *         {@code MeasurementRange} using incommensurable unit of measurement.
      */
     @Override

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java?rev=1763840&r1=1763839&r2=1763840&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java [UTF-8] Fri Oct  7 21:35:43 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/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java?rev=1763840&r1=1763839&r2=1763840&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java [UTF-8] Fri Oct  7 21:35:43 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/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java?rev=1763840&r1=1763839&r2=1763840&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java [UTF-8] Fri Oct  7 21:35:43 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)



Mime
View raw message