sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1448622 - in /sis/branches/JDK7/sis-utility/src: main/java/org/apache/sis/measure/ test/java/org/apache/sis/measure/
Date Thu, 21 Feb 2013 12:24:23 GMT
Author: desruisseaux
Date: Thu Feb 21 12:24:22 2013
New Revision: 1448622

URL: http://svn.apache.org/r1448622
Log:
Documentation update: replaced "bounds" by "endpoints" for conformance with the vocabulary
used on the Wikipedia page.

Modified:
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/Range.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
    sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/NumberRangeTest.java
    sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
    sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java?rev=1448622&r1=1448621&r2=1448622&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java
(original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java
Thu Feb 21 12:24:22 2013
@@ -75,7 +75,7 @@ public class MeasurementRange<E extends 
      * @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 bounds and unit of measurement.
+     * @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,7 +93,7 @@ public class MeasurementRange<E extends 
      * @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 bounds and unit of measurement.
+     * @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)

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java?rev=1448622&r1=1448621&r2=1448622&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java Thu
Feb 21 12:24:22 2013
@@ -87,7 +87,7 @@ public class NumberRange<E extends Numbe
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false}
if exclusive.
      * @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 bounds.
+     * @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)
@@ -104,7 +104,7 @@ public class NumberRange<E extends Numbe
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false}
if exclusive.
      * @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 bounds.
+     * @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)
@@ -121,7 +121,7 @@ public class NumberRange<E extends Numbe
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false}
if exclusive.
      * @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 bounds.
+     * @return The new range of numeric values for the given endpoints.
      */
     public static NumberRange<Integer> create(final int minValue, final boolean isMinIncluded,
                                               final int maxValue, final boolean isMaxIncluded)
@@ -138,7 +138,7 @@ public class NumberRange<E extends Numbe
      * @param  isMinIncluded  {@code true} if the minimal value is inclusive, or {@code false}
if exclusive.
      * @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 bounds.
+     * @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)
@@ -156,7 +156,7 @@ public class NumberRange<E extends Numbe
      * @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  isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false}
if exclusive.
-     * @return The new range of numeric values for the given bounds.
+     * @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)
@@ -185,7 +185,7 @@ public class NumberRange<E extends Numbe
      * @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  isMaxIncluded  {@code true} if the maximal value is inclusive, or {@code false}
if exclusive.
-     * @return The new range of numeric values for the given bounds.
+     * @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)

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/Range.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/Range.java?rev=1448622&r1=1448621&r2=1448622&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/Range.java (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/Range.java Thu Feb
21 12:24:22 2013
@@ -32,10 +32,16 @@ import java.util.Objects;
  * a user to determine if a value of the same class is contained inside the range.
  * The minimum and maximum values do not have to be included in the range, and
  * can be null.  If the minimum or maximum values are null, the range is said to
- * be unbounded on that extreme. If both the minimum and maximum are null,
+ * be unbounded on that endpoint. If both the minimum and maximum are null,
  * the range is completely unbounded and all values of that class are contained
  * within the range. Null values are always considered <em>exclusive</em>,
- * since iterations over the values will never reach the infinite bound.
+ * since iterations over the values will never reach the infinite endpoint.
+ *
+ * <p>The minimal and maximal values (the <cite>endpoints</cite>) may be
inclusive or exclusive.
+ * Numeric ranges where both endpoints are inclusive are called <cite>closed intervals</cite>
+ * and are represented by square brackets, for example "{@code [0 … 255]}".
+ * Numeric ranges where both endpoints are exclusive are called <cite>open intervals</cite>
+ * and are represented by parenthesis, for example "{@code (0 … 256)}".</p>
  *
  * {@section Type and value of range elements}
  * To be a member of a {@code Range}, the {@code <E>} type defining the range must
implement the
@@ -116,7 +122,7 @@ public class Range<E extends Comparable<
     }
 
     /**
-     * Creates a new range bounded by the given values.
+     * Creates a new range bounded by the given endpoint values.
      *
      * @param elementType    The base type of the range elements.
      * @param minValue       The minimal value, or {@code null} if none.
@@ -210,7 +216,7 @@ public class Range<E extends Comparable<
 
     /**
      * Returns {@code true} if the {@linkplain #getMinValue() minimal value} is inclusive,
-     * or {@code false} is exclusive. Note that {@code null} values are always considered
+     * or {@code false} if exclusive. Note that {@code null} values are always considered
      * exclusive.
      *
      * @return {@code true} if the minimal value is inclusive, or {@code false} if exclusive.
@@ -232,7 +238,7 @@ public class Range<E extends Comparable<
 
     /**
      * Returns {@code true} if the {@linkplain #getMaxValue() maximal value} is inclusive,
-     * or {@code false} is exclusive. Note that {@code null} values are always considered
+     * or {@code false} if exclusive. Note that {@code null} values are always considered
      * exclusive.
      *
      * @return {@code true} if the maximal value is inclusive, or {@code false} if exclusive.
@@ -458,7 +464,7 @@ public class Range<E extends Comparable<
     }
 
     /**
-     * Compares the {@linkplain #getMinValue() minimum value} of this range with the given
bound of
+     * Compares the {@linkplain #getMinValue() minimum value} of this range with the given
endpoint of
      * another range. Since the given value is either the minimal or maximal value of another
range,
      * it may be inclusive or exclusive. The later is specified by {@code position} as below:
      *
@@ -470,7 +476,7 @@ 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    A bound value of the other range to be compared to the minimal value
of this 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.
      *
@@ -516,8 +522,8 @@ public class Range<E extends Comparable<
     }
 
     /**
-     * Compares the {@linkplain #getMaxValue() maximum value} of this range with the given
bound of
-     * another range. See the comment in {@link #compareMinTo(Comparable, int)} for more
details.
+     * Compares the {@linkplain #getMaxValue() maximum value} of this range with the given
endpoint
+     * of another range. See the comment in {@link #compareMinTo(Comparable, int)} for more
details.
      */
     private int compareMaxTo(final E value, int position) {
         if (maxValue == null) {
@@ -602,8 +608,8 @@ public class Range<E extends Comparable<
      *   <li>Otherwise if the minimal value is equals to the maximal value, then the
string
      *       representation of that value is returned inside braces as in "{@code {value}}".</li>
      *   <li>Otherwise the string representation of the minimal and maximal values
are formatted
-     *       like "{@code [min … max]}" for inclusive bounds or "{@code (min …
max)}" for exclusive
-     *       bounds, or a mix of both styles. The "{@code ∞}" symbol is used in place
of
+     *       like "{@code [min … max]}" for inclusive endpoints or "{@code (min …
max)}" for exclusive
+     *       endpoints, or a mix of both styles. The "{@code ∞}" symbol is used in place
of
      *       {@code min} or {@code max} for unbounded ranges.</li>
      * </ul>
      *

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java?rev=1448622&r1=1448621&r2=1448622&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java Thu
Feb 21 12:24:22 2013
@@ -49,11 +49,11 @@ import org.apache.sis.util.resources.Err
  *       {@linkplain Range#getMaxValue() maximal value}, then that single value is formatted
  *       inside braces as in "{@code {value}}".</li>
  *   <li>Otherwise the minimal and maximal values are formatted inside bracket or parenthesis,
- *       depending on whether each bound is inclusive or exclusive:
+ *       depending on whether each endpoint is inclusive or exclusive:
  *     <ul>
- *       <li>"{@code [min … max]}" if both bounds are inclusive;</li>
- *       <li>"{@code (min … max)}" if both bounds are exclusive;</li>
- *       <li>or a mix of both styles if a bound is inclusive while the other is exclusive.</li>
+ *       <li>"{@code [min … max]}" if both endpoints are inclusive (<cite>closed
interval</cite>);</li>
+ *       <li>"{@code (min … max)}" if both endpoints are exclusive (<cite>open
interval</cite>);</li>
+ *       <li>or a mix of both styles if an endpoint is inclusive while the other is
exclusive.</li>
  *     </ul>
  *     The "{@code ∞}" symbol is used in place of {@code min} or {@code max} for unbounded
ranges.</li>
  * </ul>

Modified: sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/NumberRangeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/NumberRangeTest.java?rev=1448622&r1=1448621&r2=1448622&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/NumberRangeTest.java
(original)
+++ sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/NumberRangeTest.java
Thu Feb 21 12:24:22 2013
@@ -34,10 +34,10 @@ import static org.junit.Assert.*;
 @DependsOn(RangeTest.class)
 public final strictfp class NumberRangeTest extends TestCase {
     /**
-     * Tests the bounds values of a range of integers.
+     * Tests the endpoint values of a range of integers.
      */
     @Test
-    public void testIntegerBounds() {
+    public void testIntegerEndpoints() {
         final NumberRange<Integer> range = NumberRange.create(10, true, 20, true);
         assertEquals(10, range.getMinDouble(     ), 0);
         assertEquals(10, range.getMinDouble(true ), 0);

Modified: sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java?rev=1448622&r1=1448621&r2=1448622&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
(original)
+++ sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
Thu Feb 21 12:24:22 2013
@@ -306,7 +306,7 @@ public final strictfp class RangeFormatT
         assertEquals(26, maxPos.getEndIndex());
         assertEquals(range, parse(text));
         /*
-         * Try again with the infinity symbol in one bounds.
+         * Try again with the infinity symbol in one endpoint.
          */
         range = new Range<>(Date.class, (Date) null, true, new Date(20*YEAR), true);
         it    = format.formatToCharacterIterator(range);

Modified: sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java?rev=1448622&r1=1448621&r2=1448622&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java (original)
+++ sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java Thu
Feb 21 12:24:22 2013
@@ -142,10 +142,10 @@ public final strictfp class RangeTest ex
     }
 
     /**
-     * Tests the {@link Range#contains(Comparable)} method without lower bound.
+     * Tests the {@link Range#contains(Comparable)} method without lower endpoint.
      */
     @Test
-    public void testContainsNoLowerBound() {
+    public void testContainsNoLowerEndpoint() {
         final Range<Integer> range = new Range<>(Integer.class, null, true, 5,
true);
         assertTrue (range.contains(-555));
         assertTrue (range.contains(5));
@@ -153,10 +153,10 @@ public final strictfp class RangeTest ex
     }
 
     /**
-     * Tests the {@link Range#contains(Comparable)} method without upper bound.
+     * Tests the {@link Range#contains(Comparable)} method without upper endpoint.
      */
     @Test
-    public void testContainsNoUpperBound() {
+    public void testContainsNoUpperEndpoint() {
         final Range<Integer> range = new Range<>(Integer.class, 3, true, null,
true);
         assertFalse(range.contains(1));
         assertTrue (range.contains(3));
@@ -164,10 +164,10 @@ public final strictfp class RangeTest ex
     }
 
     /**
-     * Tests the {@link Range#contains(Comparable)} method without lower or upper bounds.
+     * Tests the {@link Range#contains(Comparable)} method without lower or upper endpoints.
      */
     @Test
-    public void testContainsNoBounds() {
+    public void testContainsNoEndpoints() {
         final Range<Integer> range = new Range<>(Integer.class, null, true, null,
true);
         assertTrue(range.contains(-55555));
         assertTrue(range.contains(100000));
@@ -186,10 +186,10 @@ public final strictfp class RangeTest ex
     }
 
     /**
-     * Tests the {@link Range#contains(Range)} method without lower bound.
+     * Tests the {@link Range#contains(Range)} method without lower endpoint.
      */
     @Test
-    public void testContainsRangeNoLowerBound() {
+    public void testContainsRangeNoLowerEndpoint() {
         final Range<Integer> range  = new Range<>(Integer.class,  null, true,
500, true);
         final Range<Integer> inside = new Range<>(Integer.class, -2500, true,
305, true);
 
@@ -198,10 +198,10 @@ public final strictfp class RangeTest ex
     }
 
     /**
-     * Tests the {@link Range#contains(Range)} method without upper bound.
+     * Tests the {@link Range#contains(Range)} method without upper endpoint.
      */
     @Test
-    public void testContainsRangeNoUpperBound() {
+    public void testContainsRangeNoUpperEndpoint() {
         final Range<Integer> range  = new Range<>(Integer.class, -2500, true,
null, true);
         final Range<Integer> inside = new Range<>(Integer.class,    17, true,
 305, true);
 



Mime
View raw message