You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2012/09/26 11:24:00 UTC
svn commit: r1390346 - in
/sis/trunk/sis-utility/src/main/java/org/apache/sis/util:
ArgumentChecks.java Debug.java
Author: desruisseaux
Date: Wed Sep 26 09:24:00 2012
New Revision: 1390346
URL: http://svn.apache.org/viewvc?rev=1390346&view=rev
Log:
More accurate documentation.
Modified:
sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java
sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Debug.java
Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java?rev=1390346&r1=1390345&r2=1390346&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java Wed Sep 26 09:24:00 2012
@@ -24,20 +24,23 @@ import org.apache.sis.resources.Errors;
/**
* Provides static methods for performing argument checks.
- * The methods in this class throw one of the following exceptions:
+ * Every methods in this class can throw one of the following exceptions:
* <p>
* <table class="sis">
* <tr><th>Exception</th><th class="sep">Thrown by</th></tr>
* <tr><td>{@link NullArgumentException}</td>
- * <td class="sep">{@link #ensureNonNull(String, Object) ensureNonNull}</td></tr>
- *
- * <tr><td>{@link IndexOutOfBoundsException}</td>
- * <td class="sep">{@link #ensureValidIndex(int, int) ensureValidIndex}</td></tr>
+ * <td class="sep">{@link #ensureNonNull(String, Object) ensureNonNull},
+ * {@link #ensureNonEmpty(String, CharSequence) ensureNonEmpty}</td></tr>
*
* <tr><td>{@link IllegalArgumentException}</td>
- * <td class="sep">{@link #ensurePositive(String, int) ensurePositive},
+ * <td class="sep">{@link #ensureNonEmpty(String, CharSequence) ensureNonEmpty},
+ * {@link #ensurePositive(String, int) ensurePositive},
* {@link #ensureStrictlyPositive(String, int) ensureStrictlyPositive},
- * {@link #ensureBetween(String, int, int, int) ensureBetween}</td></tr>
+ * {@link #ensureBetween(String, int, int, int) ensureBetween},
+ * {@link #ensureCanCast(String, Class, Object) ensureCanCast}</td></tr>
+ *
+ * <tr><td>{@link IndexOutOfBoundsException}</td>
+ * <td class="sep">{@link #ensureValidIndex(int, int) ensureValidIndex}</td></tr>
*
* <tr><td>{@link MismatchedDimensionException}</td>
* <td class="sep">{@link #ensureDimensionMatches(String, DirectPosition, int) ensureDimensionMatches}</td></tr>
@@ -155,7 +158,7 @@ public final class ArgumentChecks extend
/**
* Ensures that the given index is equals or greater than zero and lower than the given
- * upper value. This method is primarily designed for methods that expect only an index
+ * 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.
@@ -171,6 +174,8 @@ public final class ArgumentChecks extend
/**
* Ensures that the given integer value is greater than or equals to zero.
+ * 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.
@@ -202,7 +207,9 @@ public final class ArgumentChecks extend
}
/**
- * Ensures that the given floating point value is greater than or equals to zero.
+ * Ensures that the given floating point value is not
+ * {@linkplain Float#NaN 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.
@@ -219,7 +226,9 @@ public final class ArgumentChecks extend
}
/**
- * Ensures that the given floating point value is greater than or equals to zero.
+ * Ensures that the given floating point value is not
+ * {@linkplain Double#NaN 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.
@@ -268,7 +277,9 @@ public final class ArgumentChecks extend
}
/**
- * Ensures that the given floating point value is greater than zero.
+ * Ensures that the given floating point value is not
+ * {@linkplain Float#NaN 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.
@@ -286,7 +297,9 @@ public final class ArgumentChecks extend
}
/**
- * Ensures that the given floating point value is greater than zero.
+ * Ensures that the given floating point value is not
+ * {@linkplain Double#NaN 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.
@@ -305,15 +318,12 @@ public final class ArgumentChecks extend
/**
* Ensures that the given integer value is between the given bounds, inclusive.
- * This method is used for checking values that are <strong>not</strong> index.
*
* @param name The name of the argument to be checked. Used only in case an exception is thrown.
* @param min The minimal value, inclusive.
* @param max The maximal value, inclusive.
* @param value The value to be tested.
* @throws IllegalArgumentException if the given value is not in the given range.
- *
- * @see #ensureValidIndex(int, int)
*/
public static void ensureBetween(final String name, final int min, final int max, final int value)
throws IllegalArgumentException
Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Debug.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Debug.java?rev=1390346&r1=1390345&r2=1390346&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Debug.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Debug.java Wed Sep 26 09:24:00 2012
@@ -28,11 +28,6 @@ import java.lang.annotation.RetentionPol
* is defined in order to make easier to find which debugging tools are available in case of
* problem. See the "<cite>Use</cite>" javadoc link for a list of annotated classes and methods.
*
- * {@section <code>toString()</code> policy}
- * Note that many {@link Object#toString()} methods are overridden for debugging purpose.
- * This {@code Debug} annotation does not apply to those {@code toString()} methods,
- * because they are too numerous and their policy usage can change at any time.
- *
* @author Martin Desruisseaux (Geomatys)
* @since 0.3 (derived from geotk-3.19)
* @version 0.3