You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2002/11/16 11:41:04 UTC
cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang SerializationException.java CharRange.java NumberUtils.java SerializationUtils.java NotifierException.java CharSet.java RandomStringUtils.java CharSetUtils.java Notifier.java StringUtils.java ArrayUtils.java ClassUtils.java SystemUtils.java ObjectUtils.java NumberRange.java
scolebourne 2002/11/16 02:41:04
Modified: lang/src/java/org/apache/commons/lang
SerializationException.java CharRange.java
NumberUtils.java SerializationUtils.java
NotifierException.java CharSet.java
RandomStringUtils.java CharSetUtils.java
Notifier.java StringUtils.java ArrayUtils.java
ClassUtils.java SystemUtils.java ObjectUtils.java
NumberRange.java
Log:
Javadoc formatting patch, by Fredrik Westermarck
Revision Changes Path
1.3 +16 -15 jakarta-commons/lang/src/java/org/apache/commons/lang/SerializationException.java
Index: SerializationException.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/SerializationException.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SerializationException.java 31 Aug 2002 11:11:03 -0000 1.2
+++ SerializationException.java 16 Nov 2002 10:41:03 -0000 1.3
@@ -57,8 +57,9 @@
import org.apache.commons.lang.exception.NestableRuntimeException;
/**
- * Exception thrown when the Serialization process fails. The original
- * error is wrapped within this one.
+ * <p>Exception thrown when the Serialization process fails.</p>
+ *
+ * <p>The original error is wrapped within this one.</p>
*
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
* @version $Id$
@@ -66,16 +67,16 @@
public class SerializationException extends NestableRuntimeException {
/**
- * Constructs a new <code>SerializationException</code> without specified
- * detail message.
+ * <p>Constructs a new <code>SerializationException</code> without specified
+ * detail message.</p>
*/
public SerializationException() {
super();
}
/**
- * Constructs a new <code>SerializationException</code> with specified
- * detail message.
+ * <p>Constructs a new <code>SerializationException</code> with specified
+ * detail message.</p>
*
* @param msg The error message.
*/
@@ -84,23 +85,23 @@
}
/**
- * Constructs a new <code>SerializationException</code> with specified
- * nested <code>Throwable</code>.
+ * <p>Constructs a new <code>SerializationException</code> with specified
+ * nested <code>Throwable</code>.</p>
*
- * @param cause The exception or error that caused this exception
- * to be thrown.
+ * @param cause The <code>Exception</code> or <code>Error</code>
+ * that caused this exception to be thrown.
*/
public SerializationException(Throwable cause) {
super(cause);
}
/**
- * Constructs a new <code>SerializationException</code> with specified
- * detail message and nested <code>Throwable</code>.
+ * <p>Constructs a new <code>SerializationException</code> with specified
+ * detail message and nested <code>Throwable</code>.</p>
*
* @param msg The error message.
- * @param cause The exception or error that caused this exception
- * to be thrown.
+ * @param cause The <code>Exception</code> or <code>Error</code>
+ * that caused this exception to be thrown.
*/
public SerializationException(String msg, Throwable cause) {
super(msg, cause);
1.2 +26 -23 jakarta-commons/lang/src/java/org/apache/commons/lang/CharRange.java
Index: CharRange.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/CharRange.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CharRange.java 19 Jul 2002 03:35:54 -0000 1.1
+++ CharRange.java 16 Nov 2002 10:41:03 -0000 1.2
@@ -55,9 +55,10 @@
*/
/**
- * A range of characters. Able to understand the idea of a contiguous
- * sublist of an alphabet, a negated concept, and a set of characters.
- * Used by CharSet to handle sets of characters.
+ * <p>A range of characters. Able to understand the idea of a contiguous
+ * sublist of an alphabet, a negated concept, and a set of characters.</p>
+ *
+ * <p>Used by <code>CharSet</code> to handle sets of characters.</p>
*
* @author <a href="bayard@generationjava.com">Henri Yandell</a>
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
@@ -75,7 +76,7 @@
private boolean negated;
/**
- * Construct a CharRange over a single character.
+ * <p>Construct a <code>CharRange</code> over a single character.</p>
*
* @param start char over which this range is placed
*/
@@ -84,7 +85,7 @@
}
/**
- * Construct a CharRange over a set of characters.
+ * <p>Construct a <code>CharRange</code> over a set of characters.</p>
*
* @param start char start character in this range. inclusive
* @param close char close character in this range. inclusive
@@ -95,11 +96,11 @@
}
/**
- * Construct a CharRange over a set of characters.
+ * <p>Construct a <code>CharRange</code> over a set of characters.</p>
*
* @param start String start first character is in this range (inclusive).
* @param close String first character is close character in this
- * range (inclusive).
+ * range (inclusive).
*/
public CharRange(String start, String close) {
this.start = start.charAt(0);
@@ -107,7 +108,7 @@
}
/**
- * Get the start character for this character range
+ * <p>Get the start character for this character range.</p>
*
* @return start char (inclusive)
*/
@@ -116,7 +117,7 @@
}
/**
- * Get the end character for this character range
+ * <p>Get the end character for this character range.</p>
*
* @return end char (inclusive)
*/
@@ -125,7 +126,7 @@
}
/**
- * Set the start character for this character range
+ * <p>Set the start character for this character range.</p>
*
* @param ch start char (inclusive)
*/
@@ -134,7 +135,7 @@
}
/**
- * Set the end character for this character range
+ * <p>Set the end character for this character range.</p>
*
* @param ch start char (inclusive)
*/
@@ -143,18 +144,19 @@
}
/**
- * Is this CharRange over many characters
+ * <p>Is this <code>CharRange</code> over many characters.</p>
*
- * @return boolean true is many characters
+ * @return boolean <code>true</code> is many characters
*/
public boolean isRange() {
return this.close != UNSET;
}
/**
- * Is the passed in character inside this range
+ * <p>Is the passed in character <code>ch</code> inside
+ * this range.</p>
*
- * @return boolean true is in range
+ * @return boolean <code>true</code> is in range
*/
public boolean inRange(char ch) {
if(isRange()) {
@@ -165,27 +167,28 @@
}
/**
- * Checks if this CharRange is negated.
+ * <p>Checks if this <code>CharRange</code> is negated.</p>
*
- * @return boolean true is negated
+ * @return boolean <code>true</code> is negated
*/
public boolean isNegated() {
return negated;
}
/**
- * Sets this character range to be negated or not.
- * This implies that this CharRange is over all characters except
- * the ones in this range.
+ * <p>Sets this character range to be negated or not.</p>
+ *
+ * <p>This implies that this <code>CharRange</code> is over
+ * all characters except the ones in this range.</p>
*
- * @param negated true to negate the range
+ * @param negated <code>true</code> to negate the range
*/
public void setNegated(boolean negated) {
this.negated = negated;
}
/**
- * Output a string representation of the character range
+ * <p>Output a string representation of the character range.</p>
*
* @return string representation
*/
1.4 +117 -99 jakarta-commons/lang/src/java/org/apache/commons/lang/NumberUtils.java
Index: NumberUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/NumberUtils.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- NumberUtils.java 28 Sep 2002 10:34:54 -0000 1.3
+++ NumberUtils.java 16 Nov 2002 10:41:03 -0000 1.4
@@ -57,7 +57,7 @@
import java.math.BigInteger;
import java.math.BigDecimal;
/**
- * Provides extra functionality for Java Number classes.
+ * <p>Provides extra functionality for Java Number classes</p>.
*
* @author <a href="mailto:bayard@generationjava.com">Henri Yandell</a>
* @author <a href="mailto:rand_mcneely@yahoo.com">Rand McNeely</a>
@@ -68,10 +68,11 @@
public final class NumberUtils {
/**
- * NumberUtils instances should NOT be constructed in standard programming.
- * Instead, the class should be used as <code>NumberUtils.stringToInt("6");</code>.
- * This constructor is public to permit tools that require a JavaBean instance
- * to operate.
+ * <p>NumberUtils instances should NOT be constructed in standard programming.
+ * Instead, the class should be used as <code>NumberUtils.stringToInt("6");</code>.</p>
+ *
+ * <p>This constructor is public to permit tools that require a JavaBean instance
+ * to operate.</p>
*/
public NumberUtils() {
}
@@ -79,18 +80,20 @@
//--------------------------------------------------------------------
/**
- * Convert a String to an int, returning zero if the conversion fails
+ * <p>Convert a <code>String</code> to an <code>int</code>, returning
+ * <code>zero</code> if the conversion fails.</p>
*
* @param str the string to convert
- * @return the int represented by the string, or zero if conversion fails
+ * @return the int represented by the string, or <code>zero</code> if
+ * conversion fails
*/
public static int stringToInt(String str) {
return stringToInt(str, 0);
}
/**
- * Convert a String to an int, returning a default value if the
- * conversion fails.
+ * <p>Convert a <code>String</code> to an <code>int</code>, returning a
+ * default value if the conversion fails.</p>
*
* @param str the string to convert
* @param defaultValue the default value
@@ -142,24 +145,22 @@
// plus minus everything. Prolly more. A lot are not separable.
/**
- * <p>
- * Turns a string value into a java.lang.Number.
- * First, the value is examined for a type qualifier on the end
+ * <p>Turns a string value into a java.lang.Number.</p>
+ *
+ * <p>First, the value is examined for a type qualifier on the end
* (<code>'f','F','d','D','l','L'</code>). If it is found, it starts
* trying to create succissively larger types from the type specified
- * until one is found that can hold the value.
- * </p>
- * <p>
- * If a type specifier is not found, it will check for a decimal point
- * and then try successively larger types from Integer to BigInteger
- * and from Float to BigDecimal.
- * </p>
- * <p>
- * If the string starts with "0x" or "-0x", it will be interpreted as a
- * hexadecimal integer. Values with leading 0's will not be interpreted
- * as octal.
- * </p>
- *
+ * until one is found that can hold the value.</p>
+ *
+ * <p>If a type specifier is not found, it will check for a decimal point
+ * and then try successively larger types from <code>Integer</code> to
+ * <code>BigInteger</code> and from <code>Float</code> to
+ * <code>BigDecimal</code>.</p>
+ *
+ * <p>If the string starts with <code>0x</code> or <code>-0x</code>, it
+ * will be interpreted as a hexadecimal integer. Values with leading
+ * <code>0</code>'s will not be interpreted as octal.</p>
+ *
* @param val String containing a number
* @return Number created from the string
* @throws NumberFormatException if the value cannot be converted
@@ -309,10 +310,12 @@
}
/**
- * Utility method for createNumber. Returns true if s is null
+ * <p>Utility method for {@link #createNumber(java.lang.String)}.</p>
+ *
+ * <p>Returns <code>true</code> if s is <code>null</code>.</p>
*
* @param s the String to check
- * @return if it is all zeros or null
+ * @return if it is all zeros or <code>null</code>
*/
private static boolean isAllZeros(String s) {
if (s == null) {
@@ -329,10 +332,10 @@
//--------------------------------------------------------------------
/**
- * Convert a String to a Float
+ * <p>Convert a <code>String</code> to a <code>Float</code>.</p>
*
- * @param val a String to convert
- * @return converted Float
+ * @param val a <code>String</code> to convert
+ * @return converted <code>Float</code>
* @throws NumberFormatException if the value cannot be converted
*/
public static Float createFloat(String val) {
@@ -340,10 +343,10 @@
}
/**
- * Convert a String to a Double
+ * <p>Convert a <code>String</code> to a <code>Double</code>.</p>
*
- * @param val a String to convert
- * @return converted Double
+ * @param val a <code>String</code> to convert
+ * @return converted <code>Double</code>
* @throws NumberFormatException if the value cannot be converted
*/
public static Double createDouble(String val) {
@@ -351,11 +354,11 @@
}
/**
- * Convert a String to a Integer, handling hex and
- * octal notations.
+ * <p>Convert a <code>String</code> to a <code>Integer</code>, handling
+ * hex and octal notations.</p>
*
- * @param val a String to convert
- * @return converted Integer
+ * @param val a <code>String</code> to convert
+ * @return converted <code>Integer</code>
* @throws NumberFormatException if the value cannot be converted
*/
public static Integer createInteger(String val) {
@@ -364,10 +367,10 @@
}
/**
- * Convert a String to a Long
+ * <p>Convert a <code>String</code> to a <code>Long</code>.</p>
*
- * @param val a String to convert
- * @return converted Long
+ * @param val a <code>String</code> to convert
+ * @return converted <code>Long</code>
* @throws NumberFormatException if the value cannot be converted
*/
public static Long createLong(String val) {
@@ -375,10 +378,10 @@
}
/**
- * Convert a String to a BigInteger
+ * <p>Convert a <code>String</code> to a <code>BigInteger</code>.</p>
*
- * @param val a String to convert
- * @return converted BigInteger
+ * @param val a <code>String</code> to convert
+ * @return converted <code>BigInteger</code>
* @throws NumberFormatException if the value cannot be converted
*/
public static BigInteger createBigInteger(String val) {
@@ -387,10 +390,10 @@
}
/**
- * Convert a String to a BigDecimal
+ * <p>Convert a <code>String</code> to a <code>BigDecimal</code>.</p>
*
- * @param val a String to convert
- * @return converted BigDecimal
+ * @param val a <code>String</code> to convert
+ * @return converted <code>BigDecimal</code>
* @throws NumberFormatException if the value cannot be converted
*/
public static BigDecimal createBigDecimal(String val) {
@@ -401,7 +404,7 @@
//--------------------------------------------------------------------
/**
- * Gets the minimum of three long values.
+ * <p>Gets the minimum of three <code>long</code> values.</p>
*
* @param a value 1
* @param b value 2
@@ -419,7 +422,7 @@
}
/**
- * Gets the minimum of three int values.
+ * <p>Gets the minimum of three <code>int</code> values.</p>
*
* @param a value 1
* @param b value 2
@@ -437,7 +440,7 @@
}
/**
- * Gets the maximum of three long values.
+ * <p>Gets the maximum of three <code>long</code> values.</p>
*
* @param a value 1
* @param b value 2
@@ -455,7 +458,7 @@
}
/**
- * Gets the maximum of three int values.
+ * <p>Gets the maximum of three <code>int</code> values.</p>
*
* @param a value 1
* @param b value 2
@@ -475,31 +478,38 @@
//--------------------------------------------------------------------
/**
- * Compares two doubles for order.
- * <p>
- * This method is more comprhensive than the standard Java greater than,
- * less than and equals operators.
- * It returns -1 if the first value is less than the second.
- * It returns +1 if the first value is greater than the second.
- * It returns 0 if the values are equal.
+ * <p>Compares two <code>doubles</code> for order.</p>
+ *
+ * <p>This method is more comprehensive than the standard Java greater
+ * than, less than and equals operators.</p>
+ * <ul>
+ * <li>It returns <code>-1</code> if the first value is less than the second.
+ * <li>It returns <code>+1</code> if the first value is greater than the second.
+ * <li>It returns <code>0</code> if the values are equal.
+ * </ul>
+ *
* <p>
* The ordering is as follows, largest to smallest:
* <ul>
- * <li>NaN
- * <li>Positive infinity
- * <li>Maximum double
- * <li>Normal positve numbers
- * <li>+0.0
- * <li>-0.0
- * <li>Normal negative numbers
- * <li>Minimum double (-Double.MAX_VALUE)
- * <li>Negative infinity
+ * <li>NaN
+ * <li>Positive infinity
+ * <li>Maximum double
+ * <li>Normal positve numbers
+ * <li>+0.0
+ * <li>-0.0
+ * <li>Normal negative numbers
+ * <li>Minimum double (-Double.MAX_VALUE)
+ * <li>Negative infinity
* </ul>
- * Comparing NaN with NaN will return 0.
+ * </p>
+ *
+ * <p>Comparing <code>NaN</code> with <code>NaN</code> will
+ * return <code>0</code>.</p>
*
- * @param lhs the first double
- * @param rhs the second double
- * @return -1 if lhs is less, +1 if greater, 0 if equal to rhs
+ * @param lhs the first <code>double</code>
+ * @param rhs the second <code>double</code>
+ * @return <code>-1</code> if lhs is less, <code>+1</code> if greater,
+ * <code>0</code> if equal to rhs
*/
public static int compare(double lhs, double rhs) {
if (lhs < rhs) {
@@ -531,15 +541,17 @@
}
/**
- * Compares two floats for order.
- * <p>
- * This method is more comprhensive than the standard Java greater than,
- * less than and equals operators.
- * It returns -1 if the first value is less than the second.
- * It returns +1 if the first value is greater than the second.
- * It returns 0 if the values are equal.
- * <p>
- * The ordering is as follows, largest to smallest:
+ * <p>Compares two floats for order.</p>
+ *
+ * <p>This method is more comprhensive than the standard Java greater than,
+ * less than and equals operators.</p>
+ * <ul>
+ * <li>It returns <code>-1</code> if the first value is less than the second.
+ * <li>It returns <code>+1</code> if the first value is greater than the second.
+ * <li>It returns <code>0</code> if the values are equal.
+ * </ul>
+ *
+ * <p> The ordering is as follows, largest to smallest:
* <ul>
* <li>NaN
* <li>Positive infinity
@@ -551,11 +563,14 @@
* <li>Minimum float (-Float.MAX_VALUE)
* <li>Negative infinity
* </ul>
- * Comparing NaN with NaN will return 0.
+ *
+ * <p>Comparing <code>NaN</code> with <code>NaN</code> will return
+ * <code>0</code>.</p>
*
- * @param lhs the first float
- * @param rhs the second float
- * @return -1 if lhs is less, +1 if greater, 0 if equal to rhs
+ * @param lhs the first <code>float</code>
+ * @param rhs the second <code>float</code>
+ * @return <code>-1</code> if lhs is less, <code>+1</code> if greater,
+ * <code>0</code> if equal to rhs
*/
public static int compare(float lhs, float rhs) {
if (lhs < rhs) {
@@ -589,11 +604,14 @@
//--------------------------------------------------------------------
/**
- * Checks whether the String contains only digit characters.
- * Null and blank string will return false.
+ * <p>Checks whether the <code>String</code> contains only
+ * digit characters.</p>
+ *
+ * <p><code>Null</code> and empty String will return
+ * <code>false</code>.</p>
*
- * @param str the string to check
- * @return boolean contains only unicode numeric
+ * @param str the <code>String</code> to check
+ * @return <code>true</code> if str contains only unicode numeric
*/
public static boolean isDigits(String str) {
if ((str == null) || (str.length() == 0)) {
@@ -608,17 +626,17 @@
}
/**
- * <p>
- * Checks whether the String a valid Java number.
- * Valid numbers include hexadecimal marked with the "0x" qualifier,
- * scientific notation and numbers marked with a type qualifier (e.g. 123L).
- * </p>
- * <p>
- * Null and blank string will return false.
- * </p>
- *
- * @param str the string to check
- * @return true if the string is a correctly formatted number
+ * <p>Checks whether the String a valid Java number.</p>
+ *
+ * <p>Valid numbers include hexadecimal marked with the <code>0x</code>
+ * qualifier, scientific notation and numbers marked with a type
+ * qualifier (e.g. 123L).</p>
+ *
+ * <p><code>Null</code> and empty String will return
+ * <code>false</code>.</p>
+ *
+ * @param str the <code>String</code> to check
+ * @return <code>true</code> if the string is a correctly formatted number
*/
public static boolean isNumber(String str) {
if ((str == null) || (str.length() == 0)) {
1.3 +21 -18 jakarta-commons/lang/src/java/org/apache/commons/lang/SerializationUtils.java
Index: SerializationUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/SerializationUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SerializationUtils.java 31 Aug 2002 11:09:45 -0000 1.2
+++ SerializationUtils.java 16 Nov 2002 10:41:03 -0000 1.3
@@ -64,8 +64,8 @@
import java.io.Serializable;
/**
- * Methods that assist with the serialization process, or perform
- * additional functionality based on serialization.
+ * <p>Methods that assist with the serialization process, or perform
+ * additional functionality based on serialization.</p>
* <ul>
* <li>Deep clone using serialization
* <li>Serialize managing finally and IOException
@@ -81,20 +81,20 @@
public class SerializationUtils {
/**
- * Constructor for SerializationUtils is private
+ * <p>Constructor for SerializationUtils is private.</p>
*/
private SerializationUtils() {
super();
}
/**
- * Deep clone an object using serialization.
- * <p>
- * This is many times slower than writing clone methods by hand
+ * <p>Deep clone an <code>Object</code> using serialization.</p>
+ *
+ * <p>This is many times slower than writing clone methods by hand
* on all objects in your object graph. However, for complex object
* graphs, or for those that don't support deep cloning this can
* be a simple alternative implementation. Of course all the objects
- * must be <code>Serializable</code>.
+ * must be <code>Serializable</code>.</p>
*
* @param object the <code>Serializable</code> object to clone
* @return the cloned object
@@ -105,10 +105,11 @@
}
/**
- * Serializes an object to the specified stream. The stream will
- * be closed once the object is written. This avoids the need for
- * a finally clause, and maybe also exception handling, in the
- * application code.
+ * <p>Serializes an <code>Object</code> to the specified stream.</p>
+ *
+ * <p>The stream will be closed once the object is written.
+ * This avoids the need for a finally clause, and maybe also exception
+ * handling, in the application code.</p>
*
* @param obj the object to serialize to bytes
* @param outputStream the stream to write to
@@ -135,7 +136,8 @@
}
/**
- * Serializes an object to a byte array for storage/serialization.
+ * <p>Serializes an <code>Object</code> to a byte array for
+ * storage/serialization.</p>
*
* @param obj the object to serialize to bytes
* @return a byte[] with the converted Serializable
@@ -148,10 +150,11 @@
}
/**
- * Deserializes an object from the specified stream. The stream will
- * be closed once the object is written. This avoids the need for
- * a finally clause, and maybe also exception handling, in the
- * application code.
+ * <p>Deserializes an <code>Object</code> from the specified stream.</p>
+ *
+ * <p>The stream will be closed once the object is written. This
+ * avoids the need for a finally clause, and maybe also exception
+ * handling, in the application code.</p>
*
* @param inputStream the serialized object input stream
* @return the deserialized object
@@ -180,7 +183,7 @@
}
/**
- * Deserializes a single object from an array of bytes.
+ * <p>Deserializes a single <code>Object</code> from an array of bytes.</p>
*
* @param objectData the serialized object
* @return the deserialized object
1.2 +14 -14 jakarta-commons/lang/src/java/org/apache/commons/lang/NotifierException.java
Index: NotifierException.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/NotifierException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NotifierException.java 12 Nov 2002 03:01:05 -0000 1.1
+++ NotifierException.java 16 Nov 2002 10:41:03 -0000 1.2
@@ -56,7 +56,7 @@
import org.apache.commons.lang.exception.NestableException;
/**
- * Exception thrown when something goes wrong in notifying.
+ * <p>Exception thrown when something goes wrong in notifying.</p>
*
* @author <a href="mailto:bayard@apache.org">Henri Yandell</a>
* @version $Id$
@@ -64,16 +64,16 @@
public class NotifierException extends NestableException {
/**
- * Constructs a new <code>NotifierException</code> without specified
- * detail message.
+ * <p>Constructs a new <code>NotifierException</code> without specified
+ * detail message.</p>
*/
public NotifierException() {
super();
}
/**
- * Constructs a new <code>NotifierException</code> with specified
- * detail message.
+ * <p>Constructs a new <code>NotifierException</code> with specified
+ * detail message.</p>
*
* @param msg the error message.
*/
@@ -82,23 +82,23 @@
}
/**
- * Constructs a new <code>NotifierException</code> with specified
- * nested <code>Throwable</code> root cause.
+ * <p>Constructs a new <code>NotifierException</code> with specified
+ * nested <code>Throwable</code> root cause.</p>
*
- * @param rootCause the exception or error that caused this exception
- * to be thrown.
+ * @param rootCause the <code>Exception</code> or <code>Error</code> that
+ * caused this exception to be thrown.
*/
public NotifierException(Throwable rootCause) {
super(rootCause);
}
/**
- * Constructs a new <code>NotifierException</code> with specified
- * detail message and nested <code>Throwable</code> root cause.
+ * <p>Constructs a new <code>NotifierException</code> with specified
+ * detail message and nested <code>Throwable</code> root cause.</p>
*
* @param msg the error message.
- * @param rootCause the exception or error that caused this exception
- * to be thrown.
+ * @param rootCause the <code>Exception</code> or <code>Error</code> that
+ * caused this exception to be thrown.
*/
public NotifierException(String msg, Throwable rootCause) {
super(msg, rootCause);
1.6 +16 -10 jakarta-commons/lang/src/java/org/apache/commons/lang/CharSet.java
Index: CharSet.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/CharSet.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CharSet.java 9 Oct 2002 04:35:03 -0000 1.5
+++ CharSet.java 16 Nov 2002 10:41:03 -0000 1.6
@@ -59,8 +59,8 @@
import java.util.List;
/**
- * A set of characters. You can iterate over the characters in the
- * set.
+ * <p>A set of characters. You can iterate over the characters in the
+ * set.</p>
*
* @author <a href="bayard@generationjava.com">Henri Yandell</a>
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
@@ -71,9 +71,13 @@
private List set = new LinkedList();
/**
- * Restricted constructor. Use the factory method evaluateSet().
+ * <p>Restricted constructor.</p>
*
- * @throws NullPointerException if any of set[i] is null or if set is null
+ * <p>Use the factory method
+ * {@link CharSetUtils#evaluateSet(java.lang.String[])}.</p>
+ *
+ * @throws NullPointerException if any of set[i] is <code>null</code>
+ * or if set is <code>null</code>
*/
protected CharSet(String[] set) {
int sz = set.length;
@@ -83,10 +87,12 @@
}
/**
- * Does the set contain the character specified
+ * <p>Does the <code>CharSet</code> contain the specified
+ * character <code>ch</code>.</p>
*
* @param ch the character to check for
- * @return true if it does contain it
+ * @return <code>true</code> if it does contain the character
+ * <code>ch</code>
*/
public boolean contains(char ch) {
Iterator iterator = set.iterator();
@@ -107,10 +113,10 @@
}
/**
- * Add a set definition string to the set
+ * <p>Add a set definition string to the <code>CharSet</code>.</p>
*
* @param str set definition string
- * @throws NullPointerException if str is null
+ * @throws NullPointerException if <code>str</code> is <code>null</code>
*/
protected void add(String str) {
int sz = str.length();
@@ -145,7 +151,7 @@
}
/**
- * Returns a string representation of the set
+ * <p>Returns a string representation of the set.</p>
*
* @return string representation
*/
1.6 +81 -59 jakarta-commons/lang/src/java/org/apache/commons/lang/RandomStringUtils.java
Index: RandomStringUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/RandomStringUtils.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RandomStringUtils.java 28 Sep 2002 10:34:54 -0000 1.5
+++ RandomStringUtils.java 16 Nov 2002 10:41:03 -0000 1.6
@@ -68,24 +68,28 @@
public class RandomStringUtils {
/**
- * Random object used by random method. This has to be not local
+ * <p>Random object used by random method. This has to be not local
* to the random method so as to not return the same value in the
- * same millisecond.
+ * same millisecond.</p>
*/
private static final Random RANDOM = new Random();
/**
- * RandomStringUtils instances should NOT be constructed in standard programming.
- * Instead, the class should be used as <code>RandomStringUtils.random(5);</code>.
- * This constructor is public to permit tools that require a JavaBean instance
- * to operate.
+ * <p><code>RandomStringUtils</code> instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * <code>RandomStringUtils.random(5);</code>.</p>
+ *
+ * <p>This constructor is public to permit tools that require a JavaBean instance
+ * to operate.</p>
*/
public RandomStringUtils() {
}
/**
- * Creates a random string whose length is the number of characters
- * specified. Characters will be chosen from the set of all characters.
+ * <p>Creates a random string whose length is the number of characters
+ * specified.</p>
+ *
+ * <p>Characters will be chosen from the set of all characters.</p>
*
* @param count length of random string to create
* @return the random string
@@ -95,9 +99,11 @@
}
/**
- * Creates a random string whose length is the number of characters
- * specified. Characters will be chosen from the set of characters whose
- * ASCII value is between 32 and 127 .
+ * <p>Creates a random string whose length is the number of characters
+ * specified.</p>
+ *
+ * <p>Characters will be chosen from the set of characters whose
+ * ASCII value is between <code>32</code> and <code>127</code>.</p>
*
* @param count length of random string to create
* @return the random string
@@ -107,9 +113,11 @@
}
/**
- * Creates a random string whose length is the number of characters
- * specified. Characters will be chosen from the set of alphabetic
- * characters.
+ * <p>Creates a random string whose length is the number of characters
+ * specified.</p>
+ *
+ * <p>Characters will be chosen from the set of alphabetic
+ * characters.</p>
*
* @param count length of random string to create
* @return the random string
@@ -119,9 +127,11 @@
}
/**
- * Creates a random string whose length is the number of characters
- * specified. Characters will be chosen from the set of alpha-numeric
- * characters.
+ * <p>Creates a random string whose length is the number of characters
+ * specified.</p>
+ *
+ * <u>Characters will be chosen from the set of alpha-numeric
+ * characters.</p>
*
* @param count length of random string to create
* @return the random string
@@ -131,9 +141,11 @@
}
/**
- * Creates a random string whose length is the number of characters
- * specified. Characters will be chosen from the set of numeric
- * characters.
+ * <p>Creates a random string whose length is the number of characters
+ * specified.</p>
+ *
+ * <p>Characters will be chosen from the set of numeric
+ * characters.</p>
*
* @param count length of random string to create
* @return the random string
@@ -143,15 +155,17 @@
}
/**
- * Creates a random string whose length is the number of characters
- * specified. Characters will be chosen from the set of alpha-numeric
- * characters as indicated by the arguments.
+ * <p>Creates a random string whose length is the number of characters
+ * specified.</p>
+ *
+ * <p>Characters will be chosen from the set of alpha-numeric
+ * characters as indicated by the arguments.</p>
*
* @param count length of random string to create
* @param letters if <code>true</code>, generated string will include
- * alphabetic characters
+ * alphabetic characters
* @param numbers if <code>true</code>, generatd string will include
- * numeric characters
+ * numeric characters
* @return the random string
*/
public static String random(int count, boolean letters, boolean numbers) {
@@ -159,17 +173,19 @@
}
/**
- * Creates a random string whose length is the number of characters
- * specified. Characters will be chosen from the set of alpha-numeric
- * characters as indicated by the arguments.
+ * <p>Creates a random string whose length is the number of characters
+ * specified.</p>
+ *
+ * <p>Characters will be chosen from the set of alpha-numeric
+ * characters as indicated by the arguments.</p>
*
* @param count length of random string to create
- * @param start int position in set of chars to start at
- * @param end int position in set of chars to end before
+ * @param start position in set of chars to start at
+ * @param end position in set of chars to end before
* @param letters if <code>true</code>, generated string will include
- * alphabetic characters
- * @param numbers if <code>true</code>, generatd string will include
- * numeric characters
+ * alphabetic characters
+ * @param numbers if <code>true</code>, generated string will include
+ * numeric characters
* @return the random string
*/
public static String random(int count, int start, int end, boolean letters, boolean numbers) {
@@ -177,24 +193,27 @@
}
/**
- * Creates a random string based on a variety of options.
- * If start and end are both 0, start and end are set to ' ' and 'z', the ASCII
- * printable characters, will be used, unless letters and numbers are both
- * false, in which case, start and end are set to 0 and Integer.MAX_VALUE.
- * <p>
- * If set is not null, characters between start and end are chosen.
- * <p>
- *
- * @param count int length of random string to create
- * @param start int position in set of chars to start at
- * @param end int position in set of chars to end before
- * @param letters boolean only allow letters?
- * @param numbers boolean only allow numbers?
- * @param set char[] set of chars to choose randoms from.
- * If null, then it will use the set of all chars.
+ * <p>Creates a random string based on a variety of options.</p>
+ *
+ * <p>If start and end are both <code>0</code>, start and end are set
+ * to <code>' '</code> and <code>'z'</code>, the ASCII printable
+ * characters, will be used, unless letters and numbers are both
+ * <code>false</code>, in which case, start and end are set to
+ * <code>0</code> and <code>Integer.MAX_VALUE</code>.
+ *
+ * <p>If set is not <code>null</code>, characters between start and
+ * end are chosen.</p>
+ *
+ * @param count length of random string to create
+ * @param start position in set of chars to start at
+ * @param end position in set of chars to end before
+ * @param letters only allow letters?
+ * @param numbers only allow numbers?
+ * @param set set of chars to choose randoms from. If <code>null</code>,
+ * then it will use the set of all chars.
* @return the random string
- * @throws ArrayIndexOutOfBoundsException if there are not (end - start) + 1
- * characters in the set array.
+ * @throws ArrayIndexOutOfBoundsException if there are not
+ * <code>(end - start) + 1</code> characters in the set array.
*/
public static String random(int count, int start, int end, boolean letters, boolean numbers, char[] set) {
if( (start == 0) && (end == 0) ) {
@@ -231,11 +250,13 @@
}
/**
- * Creates a random string whose length is the number of characters
- * specified. Characters will be chosen from the set of characters
- * specified.
+ * <p>Creates a random string whose length is the number of characters
+ * specified.</p>
+ *
+ * <p>Characters will be chosen from the set of characters
+ * specified.</p>
*
- * @param count int length of random string to create
+ * @param count length of random string to create
* @param set String containing the set of characters to use
* @return the random string
*/
@@ -244,11 +265,12 @@
}
/**
- * Creates a random string whose length is the number of characters
- * specified. Characters will be chosen from the set of characters
- * specified.
+ * <p>Creates a random string whose length is the number of characters
+ * specified.</p>
+ *
+ * <p>Characters will be chosen from the set of characters specified.</p>
*
- * @param count int length of random string to create
+ * @param count length of random string to create
* @param set character array containing the set of characters to use
* @return the random string
*/
1.7 +77 -43 jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java
Index: CharSetUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- CharSetUtils.java 29 Sep 2002 08:20:52 -0000 1.6
+++ CharSetUtils.java 16 Nov 2002 10:41:03 -0000 1.7
@@ -55,7 +55,7 @@
*/
/**
- * Numerous routines to manipulate a character set.
+ * <p>Numerous routines to manipulate a <code>CharSet</code>.</p>
*
* @author <a href="bayard@generationjava.com">Henri Yandell</a>
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
@@ -64,38 +64,44 @@
public class CharSetUtils {
/**
- * CharSetUtils instances should NOT be constructed in standard programming.
- * Instead, the class should be used as <code>CharSetUtils.evaluateSet(null);</code>.
- * This constructor is public to permit tools that require a JavaBean instance
- * to operate.
+ * <p>CharSetUtils instances should NOT be constructed in standard programming.
+ * Instead, the class should be used as <code>CharSetUtils.evaluateSet(null);</code>.</p>
+ *
+ * <p>This constructor is public to permit tools that require a JavaBean instance
+ * to operate.</p>
*/
public CharSetUtils() {
}
/**
- * Creates a CharSetUtils object which allows a certain amount of
- * set logic to be performed upon the following syntax:
+ * <p>Creates a CharSetUtils object which allows a certain amount of
+ * set logic to be performed upon the following syntax:</p>
+ *
+ * <ul>
+ * <li>"aeio" which implies 'a','e',..
+ * <li>"^e" implies not e. However it only negates, it's not
+ * a set in itself due to the size of that set in unicode.
+ * <li>"ej-m" implies e,j->m. e,j,k,l,m.
+ * </ul>
*
- * "aeio" which implies 'a','e',..
- * "^e" implies not e. However it only negates, it's not
- * a set in itself due to the size of that set in unicode.
- * "ej-m" implies e,j->m. e,j,k,l,m.
* @param set
* @return CharSet
* @throws NullPointerException if any of set[i] is null or if set is null
- * @param set
- * @return CharSet
*/
public static CharSet evaluateSet(String[] set) {
return new CharSet(set);
}
/**
- * Squeezes any repititions of a character that is mentioned in the
- * supplied set. An example is:
- * squeeze("hello", "el") => "helo"
- * See evaluateSet for set-syntax.
- *
+ * <p>Squeezes any repititions of a character that is mentioned in the
+ * supplied set.</p>
+ *
+ * <p>An example is:</p>
+ * <ul>
+ * <li>squeeze("hello", "el") => "helo"
+ * </ul>
+ * @see #evaluateSet(java.lang.String[]) for set-syntax.
+ *
* @param str the string to work from
* @param set the character set to use for manipulation
*/
@@ -106,14 +112,19 @@
}
/**
- * Squeezes any repititions of a character that is mentioned in the
- * supplied set. An example is:
- * squeeze("hello", {"el"}) => "helo"
- * See evaluateSet for set-syntax.
+ * <p>Squeezes any repititions of a character that is mentioned in the
+ * supplied set.</p>
+ *
+ * <p>An example is:</p>
+ * <ul>
+ * <li>squeeze("hello", {"el"}) => "helo"
+ * </ul>
+ * @see #evaluateSet(java.lang.String[]) for set-syntax.
*
* @param str the string to work from
* @param set the character set to use for manipulation
- * @throws NullPointerException if str is null
+ * @throws NullPointerException if <code>str</code> is
+ * <code>null</code>
*/
public static String squeeze(String str, String[] set) {
CharSet chars = evaluateSet(set);
@@ -136,9 +147,13 @@
}
/**
- * Takes an argument in set-syntax, see evaluateSet,
- * and returns the number of characters present in the specified string.
- * An example would be: count("hello", {"c-f","o"}) returns 2.
+ * <p>Takes an argument in set-syntax, see evaluateSet,
+ * and returns the number of characters present in the specified string.</p>
+ *
+ * <p>An example would be:</p>
+ * <ul>
+ * <li>count("hello", {"c-f","o"}) returns 2.
+ * </ul>
*
* @param str String target to count characters in
* @param set String set of characters to count
@@ -150,9 +165,13 @@
}
/**
- * Takes an argument in set-syntax, see evaluateSet,
- * and returns the number of characters present in the specified string.
- * An example would be: count("hello", {"c-f","o"}) returns 2.
+ * <p>Takes an argument in set-syntax, see evaluateSet,
+ * and returns the number of characters present in the specified string.</p>
+ *
+ * An example would be:</p>
+ * <ul>
+ * <li>count("hello", {"c-f","o"}) returns 2.
+ * </ul>
*
* @param str String target to count characters in
* @param set String[] set of characters to count
@@ -171,9 +190,13 @@
}
/**
- * Takes an argument in set-syntax, see evaluateSet,
- * and deletes any of characters present in the specified string.
- * An example would be: delete("hello", {"c-f","o"}) returns "hll"
+ * <p>Takes an argument in set-syntax, see evaluateSet,
+ * and deletes any of characters present in the specified string.</p>
+ *
+ * <p>An example would be:</p>
+ * <ul>
+ * <li>delete("hello", {"c-f","o"}) returns "hll"
+ * </ul>
*
* @param str String target to delete characters from
* @param set String set of characters to delete
@@ -185,13 +208,18 @@
}
/**
- * Takes an argument in set-syntax, see evaluateSet,
- * and deletes any of characters present in the specified string.
- * An example would be: delete("hello", {"c-f","o"}) returns "hll"
+ * <p>Takes an argument in set-syntax, see evaluateSet,
+ * and deletes any of characters present in the specified string.</p>
+ *
+ * <p>An example would be:</p>
+ * <ul>
+ * <li>delete("hello", {"c-f","o"}) returns "hll"
+ * </ul>
*
* @param str String target to delete characters from
* @param set String[] set of characters to delete
- * @throws NullPointerException of str is null
+ * @throws NullPointerException of <code>str</code> is
+ * <code>null</code>
*/
public static String delete(String str, String[] set) {
CharSet chars = evaluateSet(set);
@@ -207,16 +235,22 @@
}
/**
- * Translate characters in a String.
- * An example is: translate("hello", "ho", "jy") => jelly
- * If the length of characters to search for is greater than the
+ * <p>Translate characters in a String.</p>
+ *
+ * <p>An example is:</p>
+ * <ul>
+ * <li>translate("hello", "ho", "jy") => jelly
+ * </ul>
+ *
+ * <p>If the length of characters to search for is greater than the
* length of characters to replace, then the last character is
- * used.
+ * used.</p>
*
- * @param target String to replace characters in
+ * @param target String to replace characters in
* @param repl String to find that will be replaced
* @param with String to put into the target String
- * @throws NullPointerException if target, with or repl is null
+ * @throws NullPointerException if <code>target</code>, with
+ * or <code>repl</code> is <code>null</code>
*/
public static String translate(String target, String repl, String with) {
StringBuffer buffer = new StringBuffer(target.length());
1.3 +18 -15 jakarta-commons/lang/src/java/org/apache/commons/lang/Notifier.java
Index: Notifier.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/Notifier.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Notifier.java 12 Nov 2002 22:36:59 -0000 1.2
+++ Notifier.java 16 Nov 2002 10:41:03 -0000 1.3
@@ -63,13 +63,13 @@
import java.lang.reflect.InvocationTargetException;
/**
- * A utility which takes much of the pain out of the Event/Listener
+ * <p>A utility which takes much of the pain out of the Event/Listener
* system. It handles the collection, and the loop-notification.
- * Reflection is used for the actual notification call.
+ * Reflection is used for the actual notification call.</p>
*
- * Alternate strategies are usable. For example this class currently
+ * <p>Alternate strategies are usable. For example this class currently
* does not enforce a particular interface, which means it cannot
- * cache that method. Doing this probably makes a lot of sense.
+ * cache that method. Doing this probably makes a lot of sense.</p>
*/
public class Notifier {
@@ -93,8 +93,8 @@
}
/**
- * Construct with the class and the name of the method to
- * call upon the listeners.
+ * <p>Construct with the class and the name of the method to
+ * call upon the listeners.</p>
*/
public Notifier(Class clss, String name) {
if(clss == null) {
@@ -128,10 +128,11 @@
}
/**
- * Convenience method for when a listener has a single method.
- * Currently this method needs to be called, but it's possible
+ * <p>Convenience method for when a listener has a single method.</p>
+ *
+ * <p>Currently this method needs to be called, but it's possible
* that by providing the interface class, it can be assumed as
- * to what the listening method is.
+ * to what the listening method is.</p>
*/
public void notify(EventObject event) throws NotifierException {
if(this.clss == null) {
@@ -142,9 +143,10 @@
}
/**
- * Notify the listeners of a certain event, to a certain method.
- * This is usable when a Listener has more than one method and
- * a single Notifier wants to be shared.
+ * <p>Notify the listeners of a certain event, to a certain method.</p>
+ *
+ * <p>This is usable when a Listener has more than one method and
+ * a single <code>Notifier</code> wants to be shared.</p>
*/
private void notify(Method listenerMethod, EventObject event) throws NotifierException {
Iterator itr = getListeners().iterator();
@@ -165,9 +167,10 @@
}
/**
- * Notify the listeners of a certain event, to a certain method.
- * This is usable when a Listener has more than one method and
- * a single Notifier wants to be shared.
+ * <p>Notify the listeners of a certain event, to a certain method.</p>
+ *
+ * <p>This is usable when a Listener has more than one method and
+ * a single Notifier wants to be shared.</p>
*/
public void notify(String methodName, EventObject event) throws NotifierException {
Iterator itr = getListeners().iterator();
1.25 +309 -216 jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
Index: StringUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- StringUtils.java 15 Nov 2002 00:25:45 -0000 1.24
+++ StringUtils.java 16 Nov 2002 10:41:03 -0000 1.25
@@ -78,10 +78,12 @@
public class StringUtils {
/**
- * StringUtils instances should NOT be constructed in standard programming.
- * Instead, the class should be used as <code>StringUtils.trim(" foo ");</code>.
- * This constructor is public to permit tools that require a JavaBean instance
- * to operate.
+ * <p><code>StringUtils<code> instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * <code>StringUtils.trim(" foo ");</code>.</p>
+ *
+ * <p>This constructor is public to permit tools that require a JavaBean
+ * instance to operate.</p>
*/
public StringUtils() {
}
@@ -90,8 +92,9 @@
//--------------------------------------------------------------------------
/**
- * Removes control characters, including whitespace, from both ends of this
- * String, handling <code>null</code> by returning an empty String.
+ * <p>Removes control characters, including whitespace, from both
+ * ends of this String, handling <code>null</code> by returning
+ * an empty String.</p>
*
* @see java.lang.String#trim()
* @param str the String to check
@@ -102,8 +105,9 @@
}
/**
- * Removes control characters, including whitespace, from both ends of this
- * String, handling <code>null</code> by returning <code>null</code>.
+ * <p>Removes control characters, including whitespace, from both
+ * ends of this String, handling <code>null</code> by returning
+ * <code>null</code>.</p>
*
* @see java.lang.String#trim()
* @param str the String to check
@@ -114,9 +118,10 @@
}
/**
- * Deletes all 'space' characters from a String.
- * Spaces are defined as {' ', '\t', '\r', '\n', '\b'}
- * in line with the deprecated Character.isSpace
+ * <p>Deletes all 'space' characters from a String.</p>
+ *
+ * <p>Spaces are defined as <code>{' ', '\t', '\r', '\n', '\b'}</code>
+ * in line with the deprecated {@link Character#isSpace(char)}.</p>
*
* @param str String target to delete spaces from
* @return the String without spaces
@@ -127,8 +132,10 @@
}
/**
- * Deletes all whitespaces from a String.
- * Whitespace is defined by Character.isWhitespace
+ * <p>Deletes all whitespaces from a String.</p>
+ *
+ * <p>Whitespace is defined by
+ * {@link Character#isWhitespace(char)}.</p>
*
* @param str String target to delete whitespace from
* @return the String without whitespaces
@@ -146,7 +153,8 @@
}
/**
- * Checks if a String is non null and is not empty (length > 0).
+ * <p>Checks if a String is non <code>null</code> and is
+ * not empty (<code>length > 0</code>).</p>
*
* @param str the String to check
* @return true if the String is non-null, and not length zero
@@ -156,10 +164,11 @@
}
/**
- * Checks if a (trimmed) String is <code>null</code> or empty.
+ * <p>Checks if a (trimmed) String is <code>null</code> or empty.</p>
*
* @param str the String to check
- * @return true if the String is <code>null</code>, or length zero once trimmed
+ * @return <code>true</code> if the String is <code>null</code>, or
+ * length zero once trimmed
*/
public static boolean isEmpty(String str) {
return (str == null || str.trim().length() == 0);
@@ -169,36 +178,42 @@
//--------------------------------------------------------------------------
/**
- * Compares two Strings, returning <code>true</code> if they are equal.
- * <code>null</code>s are handled without exceptions. Two <code>null</code>
- * references are considered to be equal. The comparison is case sensitive.
+ * <p>Compares two Strings, returning <code>true</code> if they are equal.</p>
+ *
+ * <p><code>null</code>s are handled without exceptions. Two <code>null</code>
+ * references are considered to be equal. The comparison is case sensitive.</p>
*
* @see java.lang.String#equals(Object)
* @param str1 the first string
* @param str2 the second string
- * @return true if the Strings are equal, case sensitive, or both <code>null</code>
+ * @return <code>true</code> if the Strings are equal, case sensitive, or
+ * both <code>null</code>
*/
public static boolean equals(String str1, String str2) {
return (str1 == null ? str2 == null : str1.equals(str2));
}
/**
- * Compares two Strings, returning <code>true</code> if they are equal ignoring
- * the case. Nulls are handled without exceptions. Two <code>null</code>
- * references are considered equal. Comparison is case insensitive.
+ * <p>Compares two Strings, returning <code>true</code> if they are equal ignoring
+ * the case.</p>
+ *
+ * <p><code>Nulls</code> are handled without exceptions. Two <code>null</code>
+ * references are considered equal. Comparison is case insensitive.</p>
*
* @see java.lang.String#equalsIgnoreCase(String)
* @param str1 the first string
* @param str2 the second string
- * @return true if the Strings are equal, case insensitive, or both <code>null</code>
+ * @return <code>true</code> if the Strings are equal, case insensitive, or
+ * both <code>null</code>
*/
public static boolean equalsIgnoreCase(String str1, String str2) {
return (str1 == null ? str2 == null : str1.equalsIgnoreCase(str2));
}
/**
- * Find the first index of any of a set of potential substrings.
- * <code>null</code> String will return <code>-1</code>.
+ * <p>Find the first index of any of a set of potential substrings.</p>
+ *
+ * <p><code>null</code> String will return <code>-1</code>.</p>
*
* @param str the String to check
* @param searchStrs the Strings to search for
@@ -230,8 +245,9 @@
}
/**
- * Find the latest index of any of a set of potential substrings.
- * <code>null</code> string will return <code>-1</code>.
+ * <p>Find the latest index of any of a set of potential substrings.</p>
+ *
+ * <p><code>null</code> string will return <code>-1</code>.</p>
*
* @param str the String to check
* @param searchStrs the Strings to search for
@@ -258,13 +274,14 @@
//--------------------------------------------------------------------------
/**
- * Gets a substring from the specified string avoiding exceptions.
- * A negative start position can be used to start n characters from
- * the end of the String.
+ * <p>Gets a substring from the specified string avoiding exceptions.</p>
+ *
+ * <p>A negative start position can be used to start <code>n</code>
+ * characters from the end of the String.</p>
*
* @param str the String to get the substring from
* @param start the position to start from, negative means
- * count back from the end of the String by this many characters
+ * count back from the end of the String by this many characters
* @return substring from start position
*/
public static String substring(String str, int start) {
@@ -288,15 +305,16 @@
}
/**
- * Gets a substring from the specified String avoiding exceptions.
- * A negative start position can be used to start/end n characters
- * from the end of the String.
+ * <p>Gets a substring from the specified String avoiding exceptions.</p>
+ *
+ * <p>A negative start position can be used to start/end <code>n</code>
+ * characters from the end of the String.</p>
*
* @param str the String to get the substring from
* @param start the position to start from, negative means
- * count back from the end of the string by this many characters
+ * count back from the end of the string by this many characters
* @param end the position to end at (exclusive), negative means
- * count back from the end of the String by this many characters
+ * count back from the end of the String by this many characters
* @return substring from start position to end positon
*/
public static String substring(String str, int start, int end) {
@@ -334,9 +352,11 @@
}
/**
- * Gets the leftmost n characters of a String. If n characters are not
- * available, or the String is <code>null</code>, the String will be
- * returned without an exception.
+ * <p>Gets the leftmost <code>n</code> characters of a String.</p>
+ *
+ * <p>If <code>n</code> characters are not available, or the
+ * String is <code>null</code>, the String will be returned without
+ * an exception.</p>
*
* @param str the String to get the leftmost characters from
* @param len the length of the required String
@@ -355,9 +375,11 @@
}
/**
- * Gets the rightmost n characters of a String. If n characters are not
- * available, or the String is <code>null</code>, the String will be
- * returned without an exception.
+ * <p>Gets the rightmost <code>n</code> characters of a String.</p>
+ *
+ * <p>If <code>n</code> characters are not available, or the String
+ * is <code>null</code>, the String will be returned without an
+ * exception.</p>
*
* @param str the String to get the rightmost characters from
* @param len the length of the required String
@@ -376,10 +398,11 @@
}
/**
- * Gets n characters from the middle of a String. If n characters are
- * not available, the remainder of the String will be returned
- * without an exception. If the String is <code>null</code>,
- * <code>null</code> will be returned.
+ * <p>Gets <code>n</code> characters from the middle of a String.</p>
+ *
+ * <p>If <code>n</code> characters are not available, the remainder
+ * of the String will be returned without an exception. If the
+ * String is <code>null</code>, <code>null</code> will be returned.</p>
*
* @param str the String to get the characters from
* @param pos the position to start from
@@ -410,8 +433,10 @@
//--------------------------------------------------------------------------
/**
- * Splits the provided text into a array, using whitespace as the separator.
- * The separator is not included in the returned String array.
+ * <p>Splits the provided text into a array, using whitespace as the
+ * separator.</p>
+ *
+ * <p>The separator is not included in the returned String array.</p>
*
* @param str the String to parse
* @return an array of parsed Strings
@@ -428,20 +453,21 @@
}
/**
- * Splits the provided text into a array, based on a given separator.
- * The separator is not included in the returned String array.
- * The maximum number of splits to perfom can be controlled.
- * A <code>null</code> separator will cause parsing to be on whitespace.
+ * <p>Splits the provided text into a array, based on a given separator.</p>
+ *
+ * <p>The separator is not included in the returned String array. The
+ * maximum number of splits to perfom can be controlled. A <code>null</code>
+ * separator will cause parsing to be on whitespace.</p>
*
* <p>This is useful for quickly splitting a String directly into
* an array of tokens, instead of an enumeration of tokens (as
- * <code>StringTokenizer</code> does).
+ * <code>StringTokenizer</code> does).</p>
*
* @param str The string to parse.
* @param separator Characters used as the delimiters. If
- * <code>null</code>, splits on whitespace.
+ * <code>null</code>, splits on whitespace.
* @param max The maximum number of elements to include in the
- * array. A zero or negative value implies no limit.
+ * array. A zero or negative value implies no limit.
* @return an array of parsed Strings
*/
public static String[] split(String str, String separator, int max) {
@@ -486,8 +512,9 @@
// Joining
//--------------------------------------------------------------------------
/**
- * Concatenates elements of an array into a single String.
- * The difference from join is that concatenate has no delimiter.
+ * <p>Concatenates elements of an array into a single String.</p>
+ *
+ * <p>The difference from join is that concatenate has no delimiter.</p>
*
* @param array the array of values to concatenate.
* @return the concatenated string.
@@ -497,10 +524,11 @@
}
/**
- * Joins the elements of the provided array into a single String
- * containing the provided list of elements.
- * No delimiter is added before or after the list.
- * A <code>null</code> separator is the same as a blank String.
+ * <p>Joins the elements of the provided array into a single String
+ * containing the provided list of elements.</p>
+ *
+ * <p>No delimiter is added before or after the list. A
+ * <code>null</code> separator is the same as a blank String.</p>
*
* @param array the array of values to join together
* @param separator the separator character to use
@@ -525,10 +553,11 @@
}
/**
- * Joins the elements of the provided <code>Iterator</code> into a
- * single String containing the provided elements.
- * No delimiter is added before or after the list.
- * A <code>null</code> separator is the same as a blank String.
+ * <p>Joins the elements of the provided <code>Iterator</code> into
+ * a single String containing the provided elements.</p>
+ *
+ * <p>No delimiter is added before or after the list. A
+ * <code>null</code> separator is the same as a blank String.</p>
*
* @param iterator the <code>Iterator</code> of values to join together
* @param separator the separator character to use
@@ -554,7 +583,7 @@
//--------------------------------------------------------------------------
/**
- * Replace a String with another String inside a larger String, once.
+ * <p>Replace a String with another String inside a larger String, once.</p>
*
* @see #replace(String text, String repl, String with, int max)
* @param text text to search and replace in
@@ -567,7 +596,7 @@
}
/**
- * Replace all occurances of a String within another String.
+ * <p>Replace all occurances of a String within another String.</p>
*
* @see #replace(String text, String repl, String with, int max)
* @param text text to search and replace in
@@ -580,18 +609,19 @@
}
/**
- * Replace a String with another String inside a larger String,
- * for the first <code>max</code> values of the search String. A
- * <code>null</code> reference is passed to this method is a
- * no-op.
+ * <p>Replace a String with another String inside a larger String,
+ * for the first <code>max</code> values of the search String.</p>
+ *
+ * <p>A <code>null</code> reference is passed to this method is a
+ * no-op.</p>
*
* @param text text to search and replace in
* @param repl String to search for
* @param with String to replace with
* @param max maximum number of values to replace, or
- * <code>-1</code> if no maximum
+ * <code>-1</code> if no maximum
* @return the text with any replacements processed
- * @throws NullPointerException if repl is null
+ * @throws NullPointerException if repl is <code>null</code>
*/
public static String replace(String text, String repl, String with,
int max) {
@@ -614,14 +644,14 @@
}
/**
- * Overlay a part of a String with another String.
+ * <p>Overlay a part of a String with another String.</p>
*
* @param text String to do overlaying in
* @param overlay String to overlay
* @param start int to start overlaying at
* @param end int to stop overlaying before
* @return String with overlayed text
- * @throws NullPointerException if text or overlay is null
+ * @throws NullPointerException if text or overlay is <code>null</code>
*/
public static String overlayString(String text, String overlay, int start, int end) {
return new StringBuffer(start + overlay.length() + text.length() - end + 1)
@@ -635,28 +665,30 @@
//--------------------------------------------------------------------------
/**
- * Center a String in a larger String of size n.
- * Uses spaces as the value to buffer the string with.
- * Equivalent to <code>center(str, size, " ")</code>
+ * <p>Center a String in a larger String of size <code>n</code>.<p>
+ *
+ * <p>Uses spaces as the value to buffer the String with.
+ * Equivalent to <code>center(str, size, " ")</code>.</p>
*
* @param str String to center
* @param size int size of new String
* @return String containing centered String
- * @throws NullPointerException if str is null
+ * @throws NullPointerException if str is <code>null</code>
*/
public static String center(String str, int size) {
return center(str, size, " ");
}
/**
- * Center a String in a larger String of size n.
- * Uses a supplied String as the value to buffer the String with.
+ * <p>Center a String in a larger String of size <code>n</code>.</p>
+ *
+ * <p>Uses a supplied String as the value to buffer the String with.</p>
*
* @param str String to center
* @param size int size of new String
* @param delim String to buffer the new String with
* @return String containing centered String
- * @throws NullPointerException if str or delim is null
+ * @throws NullPointerException if str or delim is <code>null</code>
* @throws ArithmeticException if delim is the empty String
*/
public static String center(String str, int size, String delim) {
@@ -674,24 +706,24 @@
//--------------------------------------------------------------------------
/**
- * Remove the last newline, and everything after it from a String.
+ * <p>Remove the last newline, and everything after it from a String.</p>
*
* @param str String to chomp the newline from
* @return String without chomped newline
- * @throws NullPointerException if str is null
+ * @throws NullPointerException if str is <code>null</code>
*/
public static String chomp(String str) {
return chomp(str, "\n");
}
/**
- * Remove the last value of a supplied String, and everything after it
- * from a String.
+ * <p>Remove the last value of a supplied String, and everything after
+ * it from a String.</p>
*
* @param str String to chomp from
* @param sep String to chomp
* @return String without chomped ending
- * @throws NullPointerException if str or sep is null
+ * @throws NullPointerException if str or sep is <code>null</code>
*/
public static String chomp(String str, String sep) {
int idx = str.lastIndexOf(sep);
@@ -703,24 +735,24 @@
}
/**
- * Remove a newline if and only if it is at the end
- * of the supplied String.
+ * <p>Remove a newline if and only if it is at the end
+ * of the supplied String.</p>
*
* @param str String to chomp from
* @return String without chomped ending
- * @throws NullPointerException if str is null
+ * @throws NullPointerException if str is <code>null</code>
*/
public static String chompLast(String str) {
return chompLast(str, "\n");
}
/**
- * Remove a value if and only if the String ends with that value.
+ * <p>Remove a value if and only if the String ends with that value.</p>
*
* @param str String to chomp from
* @param sep String to chomp
* @return String without chomped ending
- * @throws NullPointerException if str or sep is null
+ * @throws NullPointerException if str or sep is <code>null</code>
*/
public static String chompLast(String str, String sep) {
if (str.length() == 0) {
@@ -735,13 +767,13 @@
}
/**
- * Remove everything and return the last value of a supplied String, and
- * everything after it from a String.
+ * <p>Remove everything and return the last value of a supplied String, and
+ * everything after it from a String.</p>
*
* @param str String to chomp from
* @param sep String to chomp
* @return String chomped
- * @throws NullPointerException if str or sep is null
+ * @throws NullPointerException if str or sep is <code>null</code>
*/
public static String getChomp(String str, String sep) {
int idx = str.lastIndexOf(sep);
@@ -755,13 +787,13 @@
}
/**
- * Remove the first value of a supplied String, and everything before it
- * from a String.
+ * <p>Remove the first value of a supplied String, and everything before it
+ * from a String.</p>
*
* @param str String to chomp from
* @param sep String to chomp
* @return String without chomped beginning
- * @throws NullPointerException if str or sep is null
+ * @throws NullPointerException if str or sep is <code>null</code>
*/
public static String prechomp(String str, String sep) {
int idx = str.indexOf(sep);
@@ -773,13 +805,13 @@
}
/**
- * Remove and return everything before the first value of a
- * supplied String from another String.
+ * <p>Remove and return everything before the first value of a
+ * supplied String from another String.</p>
*
* @param str String to chomp from
* @param sep String to chomp
* @return String prechomped
- * @throws NullPointerException if str or sep is null
+ * @throws NullPointerException if str or sep is <code>null</code>
*/
public static String getPrechomp(String str, String sep) {
int idx = str.indexOf(sep);
@@ -794,12 +826,14 @@
//--------------------------------------------------------------------------
/**
- * Remove the last character from a String. If the String
- * ends in \r\n, then remove both of them.
+ * <p>Remove the last character from a String.</p>
+ *
+ * <p>If the String ends in <code>\r\n</code>, then remove both
+ * of them.</p>
*
* @param str String to chop last character from
* @return String without last character
- * @throws NullPointerException if str is null
+ * @throws NullPointerException if str is <code>null</code>
*/
public static String chop(String str) {
if ("".equals(str)) {
@@ -820,12 +854,12 @@
}
/**
- * Remove \n from end of a String if it's there.
- * If a \r precedes it, then remove that too.
+ * <p>Remove <code>\n</code> from end of a String if it's there.
+ * If a <code>\r</code> precedes it, then remove that too.</p>
*
* @param str String to chop a newline from
* @return String without newline
- * @throws NullPointerException if str is null
+ * @throws NullPointerException if str is <code>null</code>
*/
public static String chopNewline(String str) {
int lastIdx = str.length() - 1;
@@ -846,12 +880,14 @@
// spec 3.10.6
/**
- * Escapes any values it finds into their String form.
- * So a tab becomes the characters '\\' and 't'.
+ * <p>Escapes any values it finds into their String form.</p>
+ *
+ * <p>So a tab becomes the characters <code>'\\'</code> and
+ * <code>'t'</code>.</p>
*
* @param str String to escape values in
* @return String with escaped values
- * @throws NullPointerException if str is null
+ * @throws NullPointerException if str is <code>null</code>
*/
public static String escape(String str) {
// improved with code from cybertiger@cyberiantiger.org
@@ -925,13 +961,14 @@
//--------------------------------------------------------------------------
/**
- * Repeat a String n times to form a new string.
+ * <p>Repeat a String <code>n</code> times to form a
+ * new string.</p>
*
* @param str String to repeat
* @param repeat number of times to repeat str
* @return String with repeated String
- * @throws NegativeArraySizeException if repeat < 0
- * @throws NullPointerException if str is null
+ * @throws NegativeArraySizeException if <code>repeat < 0</code>
+ * @throws NullPointerException if str is <code>null</code>
*/
public static String repeat(String str, int repeat) {
StringBuffer buffer = new StringBuffer(repeat * str.length());
@@ -942,26 +979,30 @@
}
/**
- * Right pad a String with spaces. Pad to a size of n.
+ * <p>Right pad a String with spaces.</p>
+ *
+ * <p>The String is padded to the size of <code>n</code>.</p>
*
* @param str String to repeat
* @param size number of times to repeat str
* @return right padded String
- * @throws NullPointerException if str is null
+ * @throws NullPointerException if str is <code>null</code>
*/
public static String rightPad(String str, int size) {
return rightPad(str, size, " ");
}
/**
- * Right pad a String with a specified string. Pad to a size of n.
+ * <p>Right pad a String with a specified string.</p>
+ *
+ * <p>The String is padded to the size of <code>n</code>.</p>
*
* @param str String to pad out
* @param size size to pad to
* @param delim String to pad with
* @return right padded String
- * @throws NullPointerException if str or delim is null
- * @throws ArithmeticException if delim is the empty string
+ * @throws NullPointerException if str or delim is <code>null<code>
+ * @throws ArithmeticException if delim is the empty String
*/
public static String rightPad(String str, int size, String delim) {
size = (size - str.length()) / delim.length();
@@ -972,12 +1013,14 @@
}
/**
- * Left pad a String with spaces. Pad to a size of n.
+ * <p>Left pad a String with spaces.</p>
+ *
+ * <p>The String is padded to the size of <code>n<code>.</p>
*
* @param str String to pad out
* @param size size to pad to
* @return left padded String
- * @throws NullPointerException if str or delim is null
+ * @throws NullPointerException if str or delim is <code>null<code>
*/
public static String leftPad(String str, int size) {
return leftPad(str, size, " ");
@@ -1004,7 +1047,7 @@
//--------------------------------------------------------------------------
/**
- * Remove whitespace from the front and back of a String.
+ * <p>Remove whitespace from the front and back of a String.</p>
*
* @param str the String to remove whitespace from
* @return the stripped String
@@ -1013,9 +1056,11 @@
return strip(str, null);
}
/**
- * Remove a specified String from the front and back of a
- * String. If Whitespace is wanted to be removed, used the
- * strip(String) method.
+ * <p>Remove a specified String from the front and back of a
+ * String.</p>
+ *
+ * <p>If whitespace is wanted to be removed, used the
+ * {@link #strip(java.lang.String)} method.</p>
*
* @param str the String to remove a string from
* @param delim the String to remove at start and end
@@ -1027,8 +1072,8 @@
}
/**
- * Strip whitespace from the front and back of every String
- * in the array.
+ * <p>Strip whitespace from the front and back of every String
+ * in the array.</p>
*
* @param strs the Strings to remove whitespace from
* @return the stripped Strings
@@ -1038,10 +1083,10 @@
}
/**
- * Strip the specified delimiter from the front and back of
- * every String in the array.
+ * <p>Strip the specified delimiter from the front and back of
+ * every String in the array.</p>
*
- * @param strs the Strings to remove a string from
+ * @param strs the Strings to remove a String from
* @param delimiter the String to remove at start and end
* @return the stripped Strings
*/
@@ -1058,8 +1103,10 @@
}
/**
- * Strip any of a supplied String from the end of a String..
- * If the strip String is <code>null</code>, whitespace is stripped.
+ * <p>Strip any of a supplied String from the end of a String.</p>
+ *
+ * <p>If the strip String is <code>null</code>, whitespace is
+ * stripped.</p>
*
* @param str the String to remove characters from
* @param strip the String to remove
@@ -1084,8 +1131,10 @@
}
/**
- * Strip any of a supplied String from the start of a String.
- * If the strip String is <code>null</code>, whitespace is stripped.
+ * <p>Strip any of a supplied String from the start of a String.</p>
+ *
+ * <p>If the strip String is <code>null</code>, whitespace is
+ * stripped.</p>
*
* @param str the String to remove characters from
* @param strip the String to remove
@@ -1116,8 +1165,8 @@
//--------------------------------------------------------------------------
/**
- * Convert a String to upper case, <code>null</code> String returns
- * <code>null</code>.
+ * <p>Convert a String to upper case, <code>null</code> String
+ * returns <code>null</code>.</p>
*
* @param str the String to uppercase
* @return the upper cased String
@@ -1130,8 +1179,8 @@
}
/**
- * Convert a String to lower case, <code>null</code> String returns
- * <code>null</code>.
+ * <p>Convert a String to lower case, <code>null</code> String
+ * returns <code>null</code>.</p>
*
* @param str the string to lowercase
* @return the lower cased String
@@ -1144,8 +1193,10 @@
}
/**
- * Uncapitalise a String. That is, convert the first character into
- * lower-case. <code>null</code> is returned as <code>null</code>.
+ * <p>Uncapitalise a String.</p>
+ *
+ * <p>That is, convert the first character into lower-case.
+ * <code>null</code> is returned as <code>null</code>.</p>
*
* @param str the String to uncapitalise
* @return uncapitalised String
@@ -1164,8 +1215,10 @@
}
/**
- * Capitalise a String. That is, convert the first character into
- * title-case. <code>null</code> is returned as <code>null</code>.
+ * <p>Capitalise a String.</p>
+ *
+ * <p>That is, convert the first character into title-case.
+ * <code>null</code> is returned as <code>null</code>.</p>
*
* @param str the String to capitalise
* @return capitalised String
@@ -1184,10 +1237,12 @@
}
/**
- * Swaps the case of String. Properly looks after
- * making sure the start of words are Titlecase and not
- * Uppercase. <code>null</code> is returned as
- * <code>null</code>.
+ * <p>Swaps the case of String.</p>
+ *
+ * <p>Properly looks after making sure the start of words
+ * are Titlecase and not Uppercase.</p>
+ *
+ * <p><code>null</code> is returned as <code>null</code>.</p>
*
* @param str the String to swap the case of
* @return the modified String
@@ -1226,9 +1281,12 @@
/**
- * Capitalise all the words in a String. Uses Character.isWhitespace
- * as a separator between words. <code>null</code> will return
- * <code>null</code>.
+ * <p>Capitalise all the words in a String.</p>
+ *
+ * <p>Uses {@link Character#isWhitespace(char)} as a
+ * separator between words.</p>
+ *
+ * <p><code>null</code> will return <code>null</code>.</p>
*
* @param str the String to capitalise
* @return capitalised String
@@ -1256,9 +1314,12 @@
}
/**
- * Uncapitalise all the words in a string. Uses
- * Character.isWhitespace
- * as a separator between words. Null will return null.
+ * <p>Uncapitalise all the words in a string.</p>
+ *
+ * <p>Uses {@link Character#isWhitespace(char)} as a
+ * separator between words.</p>
+ *
+ * <p><code>null</code> will return <code>null</code>.</p>
*
* @param str the string to uncapitalise
* @return uncapitalised string
@@ -1289,27 +1350,29 @@
//--------------------------------------------------------------------------
/**
- * Get the String that is nested in between two instances of the
- * same String. If <code>str</code> is <code>null</code>, will
- * return <code>null</code>.
+ * <p>Get the String that is nested in between two instances of the
+ * same String.</p>
+ *
+ * <p>If <code>str</code> is <code>null</code>, will
+ * return <code>null</code>.</p>
*
* @param str the String containing nested-string
* @param tag the String before and after nested-string
- * @return the String that was nested, or null
- * @throws NullPointerException if tag is null
+ * @return the String that was nested, or <code>null</code>
+ * @throws NullPointerException if tag is <code>null</code>
*/
public static String getNestedString(String str, String tag) {
return getNestedString(str, tag, tag);
}
/**
- * Get the String that is nested in between two Strings.
+ * <p>Get the String that is nested in between two Strings.</p>
*
* @param str the String containing nested-string
* @param open the String before nested-string
* @param close the String after nested-string
- * @return the String that was nested, or null
- * @throws NullPointerException if open or close is null
+ * @return the String that was nested, or <code>null</code>
+ * @throws NullPointerException if open or close is <code>null</code>
*/
public static String getNestedString(String str, String open, String close) {
if (str == null) {
@@ -1326,13 +1389,14 @@
}
/**
- * How many times is the substring in the larger String.
- * <code>null</code> returns 0.
+ * <p>How many times is the substring in the larger String.</p>
+ *
+ * <p><code>null</code> returns <code>0</code>.</p>
*
* @param str the String to check
* @param sub the substring to count
- * @return the number of occurances, 0 if the String is null
- * @throws NullPointerException if sub is null
+ * @return the number of occurances, 0 if the String is <code>null</code>
+ * @throws NullPointerException if sub is <code>null</code>
*/
public static int countMatches(String str, String sub) {
if (str == null) {
@@ -1351,12 +1415,13 @@
//--------------------------------------------------------------------------
/**
- * Checks if the String contains only unicode letters.
- * <code>null</code> will return <code>false</code>.
- * The empty String will return <code>true</code>.
+ * <p>Checks if the String contains only unicode letters.</p>
+ *
+ * <p><code>null</code> will return <code>false</code>.
+ * An empty String will return <code>true</code>.</p>
*
* @param str the String to check
- * @return true if only contains letters, and is non-null
+ * @return <code>true</code> if only contains letters, and is non-null
*/
public static boolean isAlpha(String str) {
if (str == null) {
@@ -1372,12 +1437,13 @@
}
/**
- * Checks if the String contains only whitespace.
- * <code>null</code> will return <code>false</code>. The empty String
- * will return <code>true</code>.
+ * <p>Checks if the String contains only whitespace.</p>
+ *
+ * <p><code>null</code> will return <code>false</code>. An
+ * empty String will return <code>true</code>.</p>
*
* @param str the String to check
- * @return true if only contains whitespace, and is non-null
+ * @return <code>true</code> if only contains whitespace, and is non-null
*/
public static boolean isWhitespace(String str) {
if (str == null) {
@@ -1393,12 +1459,15 @@
}
/**
- * Checks if the String contains only unicode letters and space (' ').
- * <code>null</code> will return <code>false</code>. The empty String
- * will return <code>true</code>.
+ * <p>Checks if the String contains only unicode letters and
+ * space (<code>' '</code>).</p>
+ *
+ * <p><code>null</code> will return <code>false</code>. An
+ * empty String will return <code>true</code>.</p>
*
* @param str the String to check
- * @return true if only contains letters and space, and is non-null
+ * @return <code>true</code> if only contains letters and space,
+ * and is non-null
*/
public static boolean isAlphaSpace(String str) {
if (str == null) {
@@ -1415,12 +1484,14 @@
}
/**
- * Checks if the String contains only unicode letters or digits.
- * <code>null</code> will return <code>false</code>. The empty
- * String will return <code>true</code>.
+ * <p>Checks if the String contains only unicode letters or digits.</p>
+ *
+ * <p><code>null</code> will return <code>false</code>. An empty
+ * String will return <code>true</code>.</p>
*
* @param str the String to check
- * @return true if only contains letters or digits, and is non-null
+ * @return <code>true</code> if only contains letters or digits,
+ * and is non-null
*/
public static boolean isAlphanumeric(String str) {
if (str == null) {
@@ -1436,12 +1507,15 @@
}
/**
- * Checks if the String contains only unicode letters, digits or space (' ').
- * <code>null</code> will return <code>false</code>. The empty String will
- * return <code>true</code>.
+ * <p>Checks if the String contains only unicode letters, digits
+ * or space (<code>' '</code>).</p>
+ *
+ * <p><code>null</code> will return <code>false</code>. An empty
+ * String will return <code>true</code>.</p>
*
* @param str the String to check
- * @return true if only contains letters, digits or space, and is non-null
+ * @return <code>true</code> if only contains letters, digits or space,
+ * and is non-null
*/
public static boolean isAlphanumericSpace(String str) {
if (str == null) {
@@ -1458,12 +1532,13 @@
}
/**
- * Checks if the String contains only unicode digits.
- * <code>null</code> will return <code>false</code>.
- * The empty String will return <code>true</code>.
+ * <p>Checks if the String contains only unicode digits.</p>
+ *
+ * <p><code>null</code> will return <code>false</code>.
+ * An empty String will return <code>true</code>.</p>
*
* @param str the String to check
- * @return true if only contains digits, and is non-null
+ * @return <code>true</code> if only contains digits, and is non-null
*/
public static boolean isNumeric(String str) {
if (str == null) {
@@ -1479,12 +1554,15 @@
}
/**
- * Checks if the String contains only unicode digits or space (' ').
- * <code>null</code> will return <code>false</code>. The empty
- * String will return <code>true</code>.
+ * <p>Checks if the String contains only unicode digits or space
+ * (<code>' '</code>).</p>
+ *
+ * <p><code>null</code> will return <code>false</code>. An empty
+ * String will return <code>true</code>.</p>
*
* @param str the String to check
- * @return true if only contains digits or space, and is non-null
+ * @return <code>true</code> if only contains digits or space,
+ * and is non-null
*/
public static boolean isNumericSpace(String str) {
if (str == null) {
@@ -1501,11 +1579,15 @@
}
/**
- * Checks if the String contains a 'true' value. These are defined
- * as the words 'true', 'on' and 'yes', case insensitive.
+ * <p>Checks if the String contains a 'true' value.</p>
+ *
+ * <p>These values are defined as the words
+ * <code>'true'</code>, <code>'on'</code> and
+ * <code>'yes'</code>, case insensitive.</p>
*
* @param str the String to check
- * @return true if the string is 'true|on|yes' case insensitive
+ * @return <code>true</code> if the string is 'true|on|yes' case
+ * insensitive
*/
public static boolean isTrue(String str) {
if ("true".equalsIgnoreCase(str)) {
@@ -1522,23 +1604,28 @@
//--------------------------------------------------------------------------
/**
- * Returns either the passed in Object as a String, or,
- * if the Object is <code>null</code>, an empty String.
+ * <p>Returns either the passed in <code>Object</code> as a String,
+ * or, if the <code>Object</code> is <code>null</code>, an empty
+ * String.</p>
*
* @param obj the Object to check
- * @return the passed in Object's toString, or blank if it was null
+ * @return the passed in Object's toString, or blank if it was
+ * <code>null</code>
*/
public static String defaultString(Object obj) {
return defaultString(obj, "");
}
/**
- * Returns either the passed in Object as a String, or,
- * if the Object is <code>null</code>, a passed in default String.
+ * <p>Returns either the passed in <code>Object</code> as a String,
+ * or, if the <code>Object</code> is <code>null</code>, a passed
+ * in default String.</p>
*
* @param obj the Object to check
- * @param defaultString the default String to return if str is null
- * @return the passed in string, or the default if it was null
+ * @param defaultString the default String to return if str is
+ * <code>null</code>
+ * @return the passed in string, or the default if it was
+ * <code>null</code>
*/
public static String defaultString(Object obj, String defaultString) {
return (obj == null) ? defaultString : obj.toString();
@@ -1548,7 +1635,9 @@
//--------------------------------------------------------------------------
/**
- * Reverse a String, <code>null</code> String returns <code>null</code>.
+ * <p>Reverse a String.</p>
+ *
+ * <p><code>null</code> String returns <code>null</code>.</p>
*
* @param str the String to reverse
* @return the reversed String
@@ -1561,9 +1650,11 @@
}
/**
- * Reverses a String that is delimited by a specific character.
- * The Strings between the delimiters are not reversed.
- * Thus java.lang.String becomes String.lang.java (if the delimiter is '.').
+ * <p>Reverses a String that is delimited by a specific character.</p>
+ *
+ * <p>The Strings between the delimiters are not reversed.
+ * Thus java.lang.String becomes String.lang.java (if the delimiter
+ * is <code>'.'</code>).</p>
*
* @param str the String to reverse
* @param delimiter the delimiter to use
@@ -1578,8 +1669,9 @@
}
/**
- * Reverses an array.
- * TAKEN FROM CollectionsUtils.
+ * <p>Reverses an array.</p>
+ *
+ * <p>TAKEN FROM CollectionsUtils.</p>
*
* @param array the array to reverse
*/
@@ -1602,17 +1694,18 @@
//--------------------------------------------------------------------------
/**
- * Find the Levenshtein distance between two Strings.
- * This is the number of changes needed to change one String into
- * another. Where each change is a single character modification.
+ * <p>Find the Levenshtein distance between two Strings.</p>
+ *
+ * <P>This is the number of changes needed to change one String into
+ * another. Where each change is a single character modification.</p>
*
- * This implemmentation of the levenshtein distance algorithm
- * is from http://www.merriampark.com/ld.htm
+ * <p>This implemmentation of the levenshtein distance algorithm
+ * is from <a href="http://www.merriampark.com/ld.htm">http://www.merriampark.com/ld.htm</a></p>
*
* @param s the first String
* @param t the second String
* @return result distance
- * @throws NullPointerException if s or t is null
+ * @throws NullPointerException if s or t is <code>null</code>
*/
public static int getLevenshteinDistance(String s, String t) {
int d[][]; // matrix
@@ -1669,7 +1762,7 @@
}
/**
- * Checks if the String contains only certain chars.
+ * <p>Checks if the String contains only certain chars.</p>
*
* @param str the String to check
* @param valid an array of valid chars
1.4 +129 -94 jakarta-commons/lang/src/java/org/apache/commons/lang/ArrayUtils.java
Index: ArrayUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/ArrayUtils.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ArrayUtils.java 15 Nov 2002 00:25:45 -0000 1.3
+++ ArrayUtils.java 16 Nov 2002 10:41:03 -0000 1.4
@@ -59,8 +59,8 @@
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
/**
- * <code>ArrayUtils</code> contains utility methods for working for
- * arrays.
+ * <p><code>ArrayUtils</code> contains utility methods for working for
+ * arrays.</p>
*
* @author <a href="mailto:scolebourne@apache.org">Stephen Colebourne</a>
* @author Moritz Petersen
@@ -91,10 +91,11 @@
public static final boolean[] EMPTY_BOOLEAN_ARRAY = new boolean[0];
/**
- * ArrayUtils instances should NOT be constructed in standard programming.
- * Instead, the class should be used as <code>ArrayUtils.clone(new int[] {2})</code>.
- * This constructor is public to permit tools that require a JavaBean instance
- * to operate.
+ * <p>ArrayUtils instances should NOT be constructed in standard programming.
+ * Instead, the class should be used as <code>ArrayUtils.clone(new int[] {2})</code>.</p>
+ *
+ * <p>This constructor is public to permit tools that require a JavaBean instance
+ * to operate.</p>
*/
public ArrayUtils() {
}
@@ -102,11 +103,12 @@
//--------------------------------------------------------------------------
/**
- * Outputs an array as a String, treating <code>null</code> as an empty array.
- * <p>
- * Multi-dimensional arrays are handled correctly, including
- * multi-dimensional primitive arrays.
- * The format is that of Java source code, for example {a,b}.
+ * <p>Outputs an array as a String, treating <code>null</code> as an empty array.</p>
+ *
+ * <p>Multi-dimensional arrays are handled correctly, including
+ * multi-dimensional primitive arrays.</p>
+ *
+ * <p>The format is that of Java source code, for example {a,b}.</p>
*
* @param array the array to get a toString for, may not be <code>null</code>
* @return a String representation of the array, '{}' if <code>null</code> passed in
@@ -116,11 +118,12 @@
}
/**
- * Outputs an array as a String handling <code>null</code>s.
- * <p>
- * Multi-dimensional arrays are handled correctly, including
- * multi-dimensional primitive arrays.
- * The format is that of Java source code, for example {a,b}.
+ * <p>Outputs an array as a String handling <code>null</code>s.</p>
+ *
+ * <p>Multi-dimensional arrays are handled correctly, including
+ * multi-dimensional primitive arrays.</p>
+ *
+ * <p>The format is that of Java source code, for example {a,b}.</p>
*
* @param array the array to get a toString for, may be <code>null</code>
* @param stringIfNull the String to return if the array is <code>null</code>
@@ -134,11 +137,12 @@
}
/**
- * Converts the given array into a {@link Map}. Each element of the array
+ * <p>Converts the given array into a {@link Map}. Each element of the array
* must be either a {@link Map.Entry} or an Array, containing at least two
* elements, where the first element is used as key and the second as
- * value. This method can be used to initialize:
- *
+ * value.</p>
+ *
+ * <p>This method can be used to initialize:</p>
* <pre>
* // Create a Map mapping colors.
* Map colorMap = MapUtils.toMap(new String[][] {{
@@ -149,7 +153,7 @@
*
* @param array an array whose elements are either a {@link Map.Entry} or
* an Array containing at least two elements
- * @return a Map that was created from the array
+ * @return a <code>Map</code> that was created from the array
* @throws IllegalArgumentException if the array is <code>null</code>
* @throws IllegalArgumentException if one element of this Array is
* itself an Array containing less then two elements
@@ -184,10 +188,11 @@
}
// /**
-// * Output the array as a String.
-// * <p>
-// * Multi-dimensional arrays are handled by the Object[] method.
-// * The format is that of Java source code, for example {1,2}.
+// * <p>Output the array as a String.</p>
+// *
+// * <p>Multi-dimensional arrays are handled by the Object[] method.</p>
+// *
+// * <p>The format is that of Java source code, for example {1,2}.</p>
// *
// * @param array the array to get a toString for, must not be <code>null</code>
// * @return a String representation of the array
@@ -198,10 +203,11 @@
// }
//
// /**
-// * Output the array as a String.
-// * <p>
-// * Multi-dimensional arrays are handled by the Object[] method.
-// * The format is that of Java source code, for example {1,2}.
+// * <p>Output the array as a String.</p>
+// *
+// * <p>Multi-dimensional arrays are handled by the Object[] method.</p>
+// *
+// * <p>The format is that of Java source code, for example {1,2}.</p>
// *
// * @param array the array to get a toString for, must not be <code>null</code>
// * @return a String representation of the array
@@ -212,10 +218,11 @@
// }
//
// /**
-// * Output the array as a String.
-// * <p>
-// * Multi-dimensional arrays are handled by the Object[] method.
-// * The format is that of Java source code, for example {1,2}.
+// * <p>Output the array as a String.</p>
+// *
+// * <p>Multi-dimensional arrays are handled by the Object[] method.</p>
+// *
+// * <p>The format is that of Java source code, for example {1,2}.</p>
// *
// * @param array the array to get a toString for, must not be <code>null</code>
// * @return a String representation of the array
@@ -226,10 +233,11 @@
// }
//
// /**
-// * Output the array as a String.
-// * <p>
-// * Multi-dimensional arrays are handled by the Object[] method.
-// * The format is that of Java source code, for example {1,2}.
+// * <p>Output the array as a String.</p>
+// *
+// * <p>Multi-dimensional arrays are handled by the Object[] method.</p>
+// *
+// * <p>The format is that of Java source code, for example {1,2}.</p>
// *
// * @param array the array to get a toString for, must not be <code>null</code>
// * @return a String representation of the array
@@ -240,10 +248,11 @@
// }
//
// /**
-// * Output the array as a String.
-// * <p>
-// * Multi-dimensional arrays are handled by the Object[] method.
-// * The format is that of Java source code, for example {1.0,2.0}.
+// * <p>Output the array as a String.</p>
+// *
+// * <p>Multi-dimensional arrays are handled by the Object[] method.</p>
+// *
+// * <p>The format is that of Java source code, for example {1.0,2.0}.</p>
// *
// * @param array the array to get a toString for, must not be <code>null</code>
// * @return a String representation of the array
@@ -254,11 +263,12 @@
// }
//
// /**
-// * Output the array as a String.
-// * <p>
-// * Multi-dimensional arrays are handled by the Object[] method.
-// * The format is that of Java source code, for example {1.0,2.0}.
-// *
+// * <p>Output the array as a String.</p>
+// *
+// * <p>Multi-dimensional arrays are handled by the Object[] method.</p>
+// *
+// * <p>The format is that of Java source code, for example {1.0,2.0}.</p>
+// *
// * @param array the array to get a toString for, must not be <code>null</code>
// * @return a String representation of the array
// * @throws IllegalArgumentException if the array is <code>null</code>
@@ -268,10 +278,11 @@
// }
//
// /**
-// * Output the array as a String.
-// * <p>
-// * Multi-dimensional arrays are handled by the Object[] method.
-// * The format is that of Java source code, for example {true,false}.
+// * <p>Output the array as a String.</p>
+// *
+// * <p>Multi-dimensional arrays are handled by the Object[] method.</p>
+// *
+// * <p>The format is that of Java source code, for example {true,false}.</p>
// *
// * @param array the array to get a toString for, must not be <code>null</code>
// * @return a String representation of the array
@@ -284,12 +295,14 @@
//--------------------------------------------------------------------------
/**
- * Shallow clones an array returning a typecast result and handling <code>null</code>.
- * <p>
- * The objecs in the array are not cloned.
+ * <p>Shallow clones an array returning a typecast result and handling
+ * <code>null</code>.</p>
+ *
+ * <p>The objecs in the array are not cloned.</p>
*
* @param array the array to shallow clone, may not be <code>null</code>
- * @return the cloned array, or <code>null</code> if <code>null</code> passed in
+ * @return the cloned array, or <code>null</code> if <code>null</code>
+ * passed in
*/
public static Object[] clone(Object[] array) {
if (array == null) {
@@ -299,10 +312,12 @@
}
/**
- * Clones an array returning a typecast result and handling <code>null</code>.
+ * <p>Clones an array returning a typecast result and handling
+ * <code>null</code>.</p>
*
* @param array the array to clone, may not be <code>null</code>
- * @return the cloned array, or <code>null</code> if <code>null</code> passed in
+ * @return the cloned array, or <code>null</code> if <code>null</code>
+ * passed in
*/
public static long[] clone(long[] array) {
if (array == null) {
@@ -312,10 +327,12 @@
}
/**
- * Clones an array returning a typecast result and handling <code>null</code>.
+ * <p>Clones an array returning a typecast result and handling
+ * <code>null</code>.</p>
*
* @param array the array to clone, may not be <code>null</code>
- * @return the cloned array, or <code>null</code> if <code>null</code> passed in
+ * @return the cloned array, or <code>null</code> if <code>null</code>
+ * passed in
*/
public static int[] clone(int[] array) {
if (array == null) {
@@ -325,10 +342,12 @@
}
/**
- * Clones an array returning a typecast result and handling <code>null</code>.
+ * <p>Clones an array returning a typecast result and handling
+ * <code>null</code>.</p>
*
* @param array the array to clone, may not be <code>null</code>
- * @return the cloned array, or <code>null</code> if <code>null</code> passed in
+ * @return the cloned array, or <code>null</code> if <code>null</code>
+ * passed in
*/
public static short[] clone(short[] array) {
if (array == null) {
@@ -338,10 +357,12 @@
}
/**
- * Clones an array returning a typecast result and handling <code>null</code>.
+ * <p>Clones an array returning a typecast result and handling
+ * <code>null</code>.</p>
*
* @param array the array to clone, may not be <code>null</code>
- * @return the cloned array, or <code>null</code> if <code>null</code> passed in
+ * @return the cloned array, or <code>null</code> if <code>null</code>
+ * passed in
*/
public static byte[] clone(byte[] array) {
if (array == null) {
@@ -351,10 +372,12 @@
}
/**
- * Clones an array returning a typecast result and handling <code>null</code>.
+ * <p>Clones an array returning a typecast result and handling
+ * <code>null</code>.</p>
*
* @param array the array to clone, may not be <code>null</code>
- * @return the cloned array, or <code>null</code> if <code>null</code> passed in
+ * @return the cloned array, or <code>null</code> if <code>null</code>
+ * passed in
*/
public static double[] clone(double[] array) {
if (array == null) {
@@ -364,10 +387,12 @@
}
/**
- * Clones an array returning a typecast result and handling <code>null</code>.
+ * <p>Clones an array returning a typecast result and handling
+ * <code>null</code>.</p>
*
* @param array the array to clone, may not be <code>null</code>
- * @return the cloned array, or <code>null</code> if <code>null</code> passed in
+ * @return the cloned array, or <code>null</code> if <code>null</code>
+ * passed in
*/
public static float[] clone(float[] array) {
if (array == null) {
@@ -377,10 +402,12 @@
}
/**
- * Clones an array returning a typecast result and handling <code>null</code>.
+ * <p>Clones an array returning a typecast result and handling
+ * <code>null</code>.</p>
*
* @param array the array to clone, may not be <code>null</code>
- * @return the cloned array, or <code>null</code> if <code>null</code> passed in
+ * @return the cloned array, or <code>null</code> if <code>null</code>
+ * passed in
*/
public static boolean[] clone(boolean[] array) {
if (array == null) {
@@ -392,9 +419,10 @@
//--------------------------------------------------------------------------
/**
- * Checks whether two arrays are the same length, treating <code>null</code>
- * arrays as length 0.
- * Any multi-dimensional aspects of the arrays are ignored.
+ * <p>Checks whether two arrays are the same length, treating
+ * <code>null</code> arrays as length <code>0</code>.
+ *
+ * <p>Any multi-dimensional aspects of the arrays are ignored.</p>
*
* @param array1 the first array, may be <code>null</code>
* @param array2 the second array, may be <code>null</code>
@@ -411,9 +439,10 @@
}
/**
- * Checks whether two arrays are the same length, treating <code>null</code>
- * arrays as length 0.
- * Any multi-dimensional aspects of the arrays are ignored.
+ * <p>Checks whether two arrays are the same length, treating
+ * <code>null</code> arrays as length <code>0</code>.</p>
+ *
+ * <p>Any multi-dimensional aspects of the arrays are ignored.</p>
*
* @param array1 the first array, may be <code>null</code>
* @param array2 the second array, may be <code>null</code>
@@ -430,9 +459,10 @@
}
/**
- * Checks whether two arrays are the same length, treating <code>null</code>
- * arrays as length 0.
- * Any multi-dimensional aspects of the arrays are ignored.
+ * <p>Checks whether two arrays are the same length, treating
+ * <code>null</code> arrays as length <code>0</code>.</p>
+ *
+ * <p>Any multi-dimensional aspects of the arrays are ignored.</p>
*
* @param array1 the first array, may be <code>null</code>
* @param array2 the second array, may be <code>null</code>
@@ -449,9 +479,10 @@
}
/**
- * Checks whether two arrays are the same length, treating <code>null</code>
- * arrays as length 0.
- * Any multi-dimensional aspects of the arrays are ignored.
+ * <p>Checks whether two arrays are the same length, treating
+ * <code>null</code> arrays as length <code>0</code>.</p>
+ *
+ * <p>Any multi-dimensional aspects of the arrays are ignored.</p>
*
* @param array1 the first array, may be <code>null</code>
* @param array2 the second array, may be <code>null</code>
@@ -468,9 +499,10 @@
}
/**
- * Checks whether two arrays are the same length, treating <code>null</code>
- * arrays as length 0.
- * Any multi-dimensional aspects of the arrays are ignored.
+ * <p>Checks whether two arrays are the same length, treating
+ * <code>null</code> arrays as length <code>0</code>.</p>
+ *
+ * <p>Any multi-dimensional aspects of the arrays are ignored.</p>
*
* @param array1 the first array, may be <code>null</code>
* @param array2 the second array, may be <code>null</code>
@@ -487,9 +519,10 @@
}
/**
- * Checks whether two arrays are the same length, treating <code>null</code>
- * arrays as length 0.
- * Any multi-dimensional aspects of the arrays are ignored.
+ * <p>Checks whether two arrays are the same length, treating
+ * <code>null</code> arrays as length <code>0</code>.</p>
+ *
+ * <p>Any multi-dimensional aspects of the arrays are ignored.</p>
*
* @param array1 the first array, may be <code>null</code>
* @param array2 the second array, may be <code>null</code>
@@ -506,9 +539,10 @@
}
/**
- * Checks whether two arrays are the same length, treating <code>null</code>
- * arrays as length 0.
- * Any multi-dimensional aspects of the arrays are ignored.
+ * <p>Checks whether two arrays are the same length, treating
+ * <code>null</code> arrays as length <code>0</code>.</p>
+ *
+ * <p>Any multi-dimensional aspects of the arrays are ignored</p>.
*
* @param array1 the first array, may be <code>null</code>
* @param array2 the second array, may be <code>null</code>
@@ -525,9 +559,10 @@
}
/**
- * Checks whether two arrays are the same length, treating <code>null</code>
- * arrays as length 0.
- * Any multi-dimensional aspects of the arrays are ignored.
+ * <p>Checks whether two arrays are the same length, treating
+ * <code>null</code> arrays as length <code>0</code>.</p>
+ *
+ * <p>Any multi-dimensional aspects of the arrays are ignored.</p>
*
* @param array1 the first array, may be <code>null</code>
* @param array2 the second array, may be <code>null</code>
@@ -544,8 +579,8 @@
}
/**
- * Checks whether two arrays are the same type taking into account
- * multi-dimensional arrays.
+ * <p>Checks whether two arrays are the same type taking into account
+ * multi-dimensional arrays.</p>
*
* @param array1 the first array, must not be <code>null</code>
* @param array2 the second array, must not be <code>null</code>
1.5 +102 -86 jakarta-commons/lang/src/java/org/apache/commons/lang/ClassUtils.java
Index: ClassUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/ClassUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ClassUtils.java 14 Nov 2002 22:29:25 -0000 1.4
+++ ClassUtils.java 16 Nov 2002 10:41:03 -0000 1.5
@@ -57,8 +57,8 @@
import java.util.Iterator;
import java.util.List;
/**
- * <code>ClassUtils</code> contains utility methods for working for
- * classes without using reflection.
+ * <p><code>ClassUtils</code> contains utility methods for working for
+ * classes without using reflection.</p>
*
* @author <a href="mailto:scolebourne@apache.org">Stephen Colebourne</a>
* @version $Id$
@@ -66,10 +66,12 @@
public class ClassUtils {
/**
- * ClassUtils instances should NOT be constructed in standard programming.
- * Instead, the class should be used as <code>ClassUtils.getShortClassName(cls)</code>.
- * This constructor is public to permit tools that require a JavaBean instance
- * to operate.
+ * <p>ClassUtils instances should NOT be constructed in standard programming.
+ * Instead, the class should be used as
+ * <code>ClassUtils.getShortClassName(cls)</code>.</p>
+ *
+ * <p>This constructor is public to permit tools that require a JavaBean
+ * instance to operate.</p>
*/
public ClassUtils() {
}
@@ -77,9 +79,11 @@
// -------------------------------------------------------------------------
/**
- * Gets the class name minus the package name from a Class.
+ * <p>Gets the class name minus the package name from a
+ * <code>Class</code>.</p>
*
- * @param cls the class to get the short name for, must not be <code>null</code>
+ * @param cls the class to get the short name for, must not be
+ * <code>null</code>
* @return the class name without the package name
* @throws IllegalArgumentException if the class is <code>null</code>
*/
@@ -91,9 +95,11 @@
}
/**
- * Gets the class name minus the package name for an Object.
+ * <p>Gets the class name minus the package name for an
+ * <code>Object</code>.</p>
*
- * @param object the class to get the short name for, must not be <code>null</code>
+ * @param object the class to get the short name for, must not be
+ * <code>null</code>
* @return the class name of the object without the package name
* @throws IllegalArgumentException if the object is <code>null</code>
*/
@@ -105,9 +111,9 @@
}
/**
- * Gets the class name minus the package name from a String.
- * <p>
- * The string passed in is assumed to be a class name - it is not checked.
+ * <p>Gets the class name minus the package name from a String.</p>
+ *
+ * <p>The string passed in is assumed to be a class name - it is not checked.</p>
*
* @param className the className to get the short name for, must not be empty
* @return the class name of the class without the package name
@@ -132,9 +138,10 @@
// -------------------------------------------------------------------------
/**
- * Gets the package name of a Class.
+ * <p>Gets the package name of a <code>Class</code>.</p>
*
- * @param cls the class to get the package name for, must not be <code>null</code>
+ * @param cls the class to get the package name for, must not be
+ * <code>null</code>
* @return the package name
* @throws IllegalArgumentException if the class is <code>null</code>
*/
@@ -146,9 +153,10 @@
}
/**
- * Gets the package name of an Object.
+ * <p>Gets the package name of an <code>Object</code>.</p>
*
- * @param object the class to get the package name for, must not be <code>null</code>
+ * @param object the class to get the package name for, must not be
+ * <code>null</code>
* @return the package name
* @throws IllegalArgumentException if the object is <code>null</code>
*/
@@ -160,9 +168,9 @@
}
/**
- * Gets the package name from a String.
- * <p>
- * The string passed in is assumed to be a class name - it is not checked.
+ * <p>Gets the package name from a <code>String</code>.</p>
+ *
+ * <p>The string passed in is assumed to be a class name - it is not checked.</p>
*
* @param className the className to get the package name for, must not be empty
* @return the package name
@@ -182,10 +190,10 @@
// -------------------------------------------------------------------------
/**
- * Gets a list of superclasses for the given class.
+ * <p>Gets a <code>List</code> of superclasses for the given class.</p>
*
* @param cls the class to look up, must not be <code>null</code>
- * @return the list of superclasses in order going up from this one
+ * @return the <code>List</code> of superclasses in order going up from this one
* @throws IllegalArgumentException if the class is <code>null</code>
*/
public static List getAllSuperclasses(Class cls) {
@@ -202,14 +210,15 @@
}
/**
- * Gets a list of all interfaces implemented by the given class.
- * <p>
- * The order is determined by looking through each interface in turn as
+ * <p>Gets a <code>List</code> of all interfaces implemented by the given
+ * class.</p>
+ *
+ * <p>The order is determined by looking through each interface in turn as
* declared in the source file and following its hieracrchy up. Later
- * duplicates are ignored, so the order is maintained.
+ * duplicates are ignored, so the order is maintained.</p>
*
* @param cls the class to look up, must not be <code>null</code>
- * @return the list of interfaces in order
+ * @return the <code>List</code> of interfaces in order
* @throws IllegalArgumentException if the class is <code>null</code>
*/
public static List getAllInterfaces(Class cls) {
@@ -234,14 +243,14 @@
}
// /**
-// * Gets a list of subclasses of the specified class.
-// * <p>
-// * This method searches the classpath to find all the subclasses
+// * <p>Gets a <code>List</code> of subclasses of the specified class.</p>
+// *
+// * <p>This method searches the classpath to find all the subclasses
// * of a particular class available. No classes are loaded, the
-// * returned list contains class names, not classes.
+// * returned list contains class names, not classes.</p>
// *
// * @param cls the class to find subclasses for
-// * @return the list of subclass String class names
+// * @return the <code>List</code> of subclass String class names
// * @throws IllegalArgumentException if the class is <code>null</code>
// */
// public static List getAllSubclassNames(Class cls) {
@@ -253,13 +262,13 @@
// }
// /**
-// * Gets a list of subclasses of the specified class.
-// * <p>
-// * This method searches the classpath to find all the subclasses
-// * of a particular class available.
+// * <p>Gets a <code>List</code> of subclasses of the specified class.</p>
+// *
+// * <p>This method searches the classpath to find all the subclasses
+// * of a particular class available.</p>
// *
// * @param cls the class to find subclasses for
-// * @return the list of subclasses
+// * @return the <code>List</code> of subclasses
// * @throws IllegalArgumentException if the class is <code>null</code>
// */
// public static List getAllSubclasses(Class cls) {
@@ -268,14 +277,14 @@
// }
// /**
-// * Gets a list of implementations of the specified interface.
-// * <p>
-// * This method searches the classpath to find all the implementations
+// * <p>Gets a <code>List</code> of implementations of the specified interface.</p>
+// *
+// * <p>This method searches the classpath to find all the implementations
// * of a particular interface available. No classes are loaded, the
-// * returned list contains class names, not classes.
+// * returned list contains class names, not classes.</p>
// *
// * @param cls the class to find sub classes for
-// * @return the list of implementation String class names
+// * @return the <code>List</code> of implementation String class names
// * @throws IllegalArgumentException if the class is <code>null</code>
// */
// public static List getAllImplementationClassNames(Class cls) {
@@ -287,14 +296,15 @@
// }
/**
- * Given a list of class names, this method converts them into classes.
- * A new list is returned. If the class name cannot be found, <code>null</code>
- * is stored in the list. If the class name in the list is <code>null</code>,
- * <code>null</code> is stored in the output list.
+ * <p>Given a <code>List</code> of class names, this method converts them into classes. *
+ * A new <code>List</code> is returned. If the class name cannot be found, <code>null</code>
+ * is stored in the <code>List</code>. If the class name in the <code>List</code> is
+ * <code>null</code>, <code>null</code> is stored in the output <code>List</code>.</p>
*
* @param classNames the classNames to change, the class is stored back
- * into the list. <code>null</code> will be stored in the list if no class is found.
- * @return the list of Class objects corresponding to the class names
+ * into the <code>List</code>. <code>null</code> will be stored in the <code>List</code>
+ * if no class is found.
+ * @return the <code>List</code> of Class objects corresponding to the class names
* @throws IllegalArgumentException if the classNames is <code>null</code>
*/
public static List convertClassNamesToClasses(List classNames) {
@@ -314,8 +324,8 @@
}
/**
- * Given a list of classes, this method finds all those which are
- * subclasses or implementations of a specified superclass.
+ * <p>Given a <code>List</code> of classes, this method finds all those which
+ * are subclasses or implementations of a specified superclass.</p>
*
* @param classes the classes to check
* @param superclass the superclass to check for
@@ -344,30 +354,33 @@
}
/**
- * Checks if an array of Classes can be assigned to another array of Classes.
- * <p>
- * This can be used to check if parameter types are suitably compatable for
- * reflection invocation.
- * <p>
- * Unlike the Class.isAssignableFrom method, this method takes into
- * account widenings of primitive classes and <code>null</code>s.
- * <p>
- * Primitive widenings allow an int to be assigned to a long, float or
- * double. This method returns the correct result for these cases.
- * <p>
- * <code>Null</code> may be assigned to any reference type. This method will return
- * true if <code>null</code> is passed in and the toClass is non-primitive.
- * <p>
- * Specifically, this method tests whether the type represented by the
+ * <p>Checks if an array of Classes can be assigned to another array of Classes.</p>
+ *
+ * <p>This can be used to check if parameter types are suitably compatable for
+ * reflection invocation.</p>
+ *
+ * <p>Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method, this
+ * method takes into account widenings of primitive classes and
+ * <code>null</code>s.</p>
+ *
+ * <p>Primitive widenings allow an int to be assigned to a <code>long</code>,
+ * <code>float</code> or <code>double</code>. This method returns the correct
+ * result for these cases.</p>
+ *
+ * <p><code>Null</code> may be assigned to any reference type. This method will
+ * return <code>true</code> if <code>null</code> is passed in and the toClass is
+ * non-primitive.</p>
+ *
+ * <p>Specifically, this method tests whether the type represented by the
* specified <code>Class</code> parameter can be converted to the type
* represented by this <code>Class</code> object via an identity conversion
* widening primitive or widening reference conversion. See
- * <em>The Java Language Specification</em>, sections 5.1.1, 5.1.2 and
- * 5.1.4 for details.
+ * <em><a href="http://java.sun.com/docs/books/jls/">The Java Language Specification</a></em>,
+ * sections 5.1.1, 5.1.2 and 5.1.4 for details.</p>
*
* @param classArray the array of Classes to check, may be <code>null</code>
* @param toClassArray the array of Classes to try to assign into, may be <code>null</code>
- * @return true if assignment possible
+ * @return <code>true</code> if assignment possible
*/
public static boolean isAssignable(Class[] classArray, Class[] toClassArray) {
if (ArrayUtils.isSameLength(classArray, toClassArray) == false) {
@@ -388,27 +401,30 @@
}
/**
- * Checks if one Class can be assigned to a variable of another Class.
- * <p>
- * Unlike the Class.isAssignableFrom method, this method takes into
- * account widenings of primitive classes and <code>null</code>s.
- * <p>
- * Primitive widenings allow an int to be assigned to a long, float or
- * double. This method returns the correct result for these cases.
- * <p>
- * Null may be assigned to any reference type. This method will return
- * true if <code>null</code> is passed in and the toClass is non-primitive.
- * <p>
- * Specifically, this method tests whether the type represented by the
+ * <p>Checks if one <code>Class</code> can be assigned to a variable of
+ * another <code>Class</code>.</p>
+ *
+ * <p>Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method,
+ * this method takes into account widenings of primitive classes and
+ * <code>null</code>s.</p>
+ *
+ * <p>Primitive widenings allow an int to be assigned to a long, float or
+ * double. This method returns the correct result for these cases.</p>
+ *
+ * <p><code>Null</code> may be assigned to any reference type. This method
+ * will return <code>true</code> if <code>null</code> is passed in and the
+ * toClass is non-primitive.</p>
+ *
+ * <p>Specifically, this method tests whether the type represented by the
* specified <code>Class</code> parameter can be converted to the type
* represented by this <code>Class</code> object via an identity conversion
* widening primitive or widening reference conversion. See
- * <em>The Java Language Specification</em>, sections 5.1.1, 5.1.2 and
- * 5.1.4 for details.
+ * <em><a href="http://java.sun.com/docs/books/jls/">The Java Language Specification</a></em>,
+ * sections 5.1.1, 5.1.2 and 5.1.4 for details.</p>
*
* @param cls the Class to check, may be <code>null</code>
* @param toClass the Class to try to assign into, must not be <code>null</code>
- * @return true if assignment possible
+ * @return <code>true</code> if assignment possible
* @throws IllegalArgumentException if the toClass is <code>null</code>
*/
public static boolean isAssignable(Class cls, Class toClass) {
@@ -470,10 +486,10 @@
}
/**
- * Is the specified class an inner class or static nested class.
+ * <p>Is the specified class an inner class or static nested class.</p>
*
* @param cls the class to check
- * @return true if the class is an inner or static nested class
+ * @return <code>true</code> if the class is an inner or static nested class
* @throws IllegalArgumentException if the class is <code>null</code>
*/
public static boolean isInnerClass(Class cls) {
1.4 +24 -15 jakarta-commons/lang/src/java/org/apache/commons/lang/SystemUtils.java
Index: SystemUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/SystemUtils.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SystemUtils.java 29 Oct 2002 19:47:02 -0000 1.3
+++ SystemUtils.java 16 Nov 2002 10:41:03 -0000 1.4
@@ -55,7 +55,7 @@
*/
/**
- * Common <code>System</code> class helpers.
+ * <p>Common <code>System</code> class helpers.</p>
*
* @author Based on code from Avalon Excalibur
* @author Based on code from Lucene
@@ -66,10 +66,12 @@
public class SystemUtils {
/**
- * SystemUtils instances should NOT be constructed in standard programming.
- * Instead, the class should be used as <code>SystemUtils.FILE_SEPARATOR</code>.
- * This constructor is public to permit tools that require a JavaBean instance
- * to operate.
+ * <P>SystemUtils instances should NOT be constructed in standard
+ * programming. Instead, the class should be used as
+ * <code>SystemUtils.FILE_SEPARATOR</code>.</p>
+ *
+ * <p>This constructor is public to permit tools that require a JavaBean
+ * instance to operate.</p>
*/
public SystemUtils() {
}
@@ -409,10 +411,13 @@
// }
/**
- * Get the Java version number as a float.
- * Example output:<br>
- * 1.2f for JDK 1.2<br>
- * 1.31f for JDK 1.3.1<br>
+ * <p>Get the Java version number as a <code>float</code>.</p>
+ *
+ * <P>Example output:</p>
+ * <ul>
+ * <li><code>1.2f</code> for JDK 1.2
+ * <li><code>1.31f</code> for JDK 1.3.1
+ * </ul>
*
* @return the version, for example 1.31f for JDK 1.3.1
*/
@@ -425,13 +430,17 @@
}
/**
- * Is the Java version at the the requested version.
- * Example input:<br>
- * 1.2f for JDK 1.2<br>
- * 1.31f for JDK 1.3.1<br>
+ * <p>Is the Java version at the the requested version.</p>
+ *
+ * <p>Example input:</p>
+ * <ul>
+ * <li><code>1.2f</code> for JDK 1.2
+ * <li><code>1.31f</code> for JDK 1.3.1
+ * </ul>
*
* @param requiredVersion the required version, for example 1.31f
- * @return true if the actual version is equal or greater than the required version
+ * @return <code>true</code> if the actual version is equal or greater
+ * than the required version
*/
public boolean isJavaVersionAtLeast(float requiredVersion) {
return (getJavaVersion() >= requiredVersion);
1.5 +48 -34 jakarta-commons/lang/src/java/org/apache/commons/lang/ObjectUtils.java
Index: ObjectUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/ObjectUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ObjectUtils.java 22 Sep 2002 09:18:33 -0000 1.4
+++ ObjectUtils.java 16 Nov 2002 10:41:03 -0000 1.5
@@ -55,7 +55,7 @@
import java.io.Serializable;
/**
- * Common <code>Object</code> manipulation routines.
+ * <p>Common <code>Object</code> manipulation routines.</p>
*
* @author <a href="mailto:nissim@nksystems.com">Nissim Karpenstein</a>
* @author <a href="mailto:janekdb@yahoo.co.uk">Janek Bogucki</a>
@@ -66,24 +66,30 @@
public class ObjectUtils {
/**
- * Singleton used as a null placeholder where null has another meaning.
- * <p>
- * For example, in a <code>HashMap</code> the get(key) method returns null
- * if the Map contains null or if there is no matching key. The Null
- * placeholder can be used to distinguish between these two cases.
- * <p>
- * Another example is <code>HashTable</code>, where <code>null</code>
- * cannot be stored.
- * <p>
- * This instance is Serializable.
+ * <p>Singleton used as a <code>null</code> placeholder where
+ * <code>null</code> has another meaning.</p>
+ *
+ * <p>For example, in a <code>HashMap</code> the
+ * {@link java.util.HashMap#get(java.lang.Object)} method returns
+ * <code>null</code> if the <code>Map</code> contains
+ * <code>null</code> or if there is no matching key. The
+ * <code>Null</code> placeholder can be used to distinguish between
+ * these two cases.</p>
+ *
+ * <p>Another example is <code>HashTable</code>, where <code>null</code>
+ * cannot be stored.</p>
+ *
+ * <p>This instance is Serializable.</p>
*/
public static final Null NULL = new Null();
/**
- * ObjectUtils instances should NOT be constructed in standard programming.
- * Instead, the class should be used as <code>ObjectUtils.defaultIfNull("a","b");</code>.
- * This constructor is public to permit tools that require a JavaBean instance
- * to operate.
+ * <p><code>ObjectUtils</code> instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * <code>ObjectUtils.defaultIfNull("a","b");</code>.</p>
+ *
+ * <p>This constructor is public to permit tools that require a JavaBean instance
+ * to operate.</p>
*/
public ObjectUtils() {
}
@@ -91,19 +97,20 @@
//--------------------------------------------------------------------
/**
- * Returns a default value if the object passed is null.
+ * <p>Returns a default value if the object passed is
+ * <code>null</code>.</p>
*
- * @param object the object to test
+ * @param object the <code>Object</code> to test
* @param defaultValue the default value to return
- * @return object if it is not null, defaultValue otherwise
+ * @return <code>object</code> if it is not <code>null</code>, defaultValue otherwise
*/
public static Object defaultIfNull(Object object, Object defaultValue) {
return (object != null ? object : defaultValue);
}
/**
- * Compares two objects for equality, where either one or both
- * objects may be <code>null</code>.
+ * <p>Compares two objects for equality, where either one or both
+ * objects may be <code>null</code>.</p>
*
* @param object1 the first object
* @param object2 the second object
@@ -120,11 +127,14 @@
}
/**
- * Gets the toString that would be produced by Object if a class did not
- * override toString itself. Null will return null.
+ * <p>Gets the toString that would be produced by <code>Object</code>
+ * if a class did not override toString itself. <code>Null</code>
+ * will return <code>null</code>.</p>
*
- * @param object the object to create a toString for, may be null
- * @return the default toString text, or null if null passed in
+ * @param object the object to create a toString for, may be
+ * <code>null</code>
+ * @return the default toString text, or <code>null</code> if
+ * <code>null</code> passed in
*/
public static String identityToString(Object object) {
if (object == null) {
@@ -138,14 +148,17 @@
}
/**
- * Class used as a null placeholder where null has another meaning.
- * <p>
- * For example, in a <code>HashMap</code> the get(key) method returns null
- * if the Map contains null or if there is no matching key. The Null
- * placeholder can be used to distinguish between these two cases.
- * <p>
- * Another example is <code>HashTable</code>, where <code>null</code>
- * cannot be stored.
+ * <p>Class used as a null placeholder where null has another meaning.</p>
+ *
+ * <p>For example, in a <code>HashMap</code> the
+ * {@link java.util.HashMap#get(java.lang.Object)} method returns
+ * <code>null</code> if the <code>Map</code> contains
+ * <code>null</code> or if there is no matching key. The
+ * <code>Null</code> placeholder can be used to distinguish between
+ * these two cases.</p>
+ *
+ * <p>Another example is <code>HashTable</code>, where <code>null</code>
+ * cannot be stored.</p>
*/
public static class Null implements Serializable {
/**
@@ -155,7 +168,8 @@
}
/**
- * Ensure singleton.
+ * <p>Ensure singleton.</p>
+ *
* @return the singleton value
*/
private Object readResolve() {
1.3 +26 -22 jakarta-commons/lang/src/java/org/apache/commons/lang/NumberRange.java
Index: NumberRange.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/NumberRange.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NumberRange.java 7 Nov 2002 16:59:44 -0000 1.2
+++ NumberRange.java 16 Nov 2002 10:41:03 -0000 1.3
@@ -55,7 +55,7 @@
*/
/**
- * Represents a range of {@link Number} objects.
+ * <p>Represents a range of {@link Number} objects.</p>
*
* @author <a href="mailto:chrise@esha.com">Christopher Elkins</a>
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
@@ -72,8 +72,8 @@
/**
- * Constructs a new instance using the specified number as both the
- * minimum and maximum in theis range.
+ * <p>Constructs a new <code>NumberRange</code> using the specified
+ * number as both the minimum and maximum in this range.</p>
*
* @param num the number to use for this range
* @throws NullPointerException if the number is <code>null</code>
@@ -88,13 +88,13 @@
}
/**
- * Constructs a new instance with the specified minimum and maximum
- * numbers.
+ * <p>Constructs a new <code>NumberRange</code> with the specified
+ * minimum and maximum numbers.</p>
*
* @param min the minimum number in this range
* @param max the maximum number in this range
* @throws NullPointerException if either the minimum or maximum number is
- * <code>null</code>
+ * <code>null</code>
*/
public NumberRange(Number min, Number max) {
if (min == null) {
@@ -112,7 +112,7 @@
}
/**
- * Returns the minimum number in this range.
+ * <p>Returns the minimum number in this range.</p>
*
* @return the minimum number in this range
*/
@@ -121,7 +121,7 @@
}
/**
- * Returns the maximum number in this range.
+ * <p>Returns the maximum number in this range.</p>
*
* @return the maximum number in this range
*/
@@ -130,11 +130,12 @@
}
/**
- * Tests whether the specified number occurs within this range.
+ * <p>Tests whether the specified <code>number</code> occurs within
+ * this range.</p>
*
* @param number the number to test
* @return <code>true</code> if the specified number occurs within this
- * range; otherwise, <code>false</code>
+ * range; otherwise, <code>false</code>
*/
public boolean includesNumber(Number number) {
if (number == null) {
@@ -146,11 +147,12 @@
}
/**
- * Tests whether the specified range occurs entirely within this range.
+ * <p>Tests whether the specified range occurs entirely within this
+ * range.</p>
*
* @param range the range to test
* @return <code>true</code> if the specified range occurs entirely within
- * this range; otherwise, <code>false</code>
+ * this range; otherwise, <code>false</code>
*/
public boolean includesRange(NumberRange range) {
if (range == null) {
@@ -161,11 +163,11 @@
}
/**
- * Tests whether the specified range overlaps with this range.
+ * <p>Tests whether the specified range overlaps with this range.</p>
*
* @param range the range to test
* @return <code>true</code> if the specified range overlaps with this
- * range; otherwise, <code>false</code>
+ * range; otherwise, <code>false</code>
*/
public boolean overlaps(NumberRange range) {
if (range == null) {
@@ -177,11 +179,12 @@
}
/**
- * Indicates whether some other object is "equal" to this one.
+ * <p>Indicates whether some other <code>Object</code> is "equal" to
+ * this one</p>.
*
* @param obj the reference object with which to compare
* @return <code>true</code> if this object is the same as the obj
- * argument; <code>false</code> otherwise
+ * argument; <code>false</code> otherwise
*/
public boolean equals(Object obj) {
if (obj == this) {
@@ -195,7 +198,7 @@
}
/**
- * Returns a hash code value for this object.
+ * <p>Returns a hash code value for this object.</p>
*
* @return a hash code value for this object
*/
@@ -207,10 +210,11 @@
}
/**
- * Returns the string representation of this range. This string is the
- * string representation of the minimum and maximum numbers in the range,
- * separated by a hyphen. If a number is negative, then it is enclosed
- * in parentheses.
+ * <p>Returns the string representation of this range.</p>
+ *
+ * <p>This string is the string representation of the minimum and
+ * maximum numbers in the range, separated by a hyphen. If a number
+ * is negative, then it is enclosed in parentheses.</p>
*
* @return the string representation of this range
*/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>