diff --git a/src/java/org/apache/commons/lang/ArrayUtils.java b/src/java/org/apache/commons/lang/ArrayUtils.java index 6d5fdc1da..10bd95c30 100644 --- a/src/java/org/apache/commons/lang/ArrayUtils.java +++ b/src/java/org/apache/commons/lang/ArrayUtils.java @@ -76,8 +76,9 @@ * @author Nikolay Metchev * @author Matthew Hawthorne * @author Tim O'Brien + * @author Pete Gieser * @since 2.0 - * @version $Id: ArrayUtils.java,v 1.22 2003/08/03 23:29:19 scolebourne Exp $ + * @version $Id: ArrayUtils.java,v 1.23 2003/08/16 11:04:46 scolebourne Exp $ */ public class ArrayUtils { @@ -1531,6 +1532,7 @@ public static int lastIndexOf(final double[] array, final double valueToFind, in * @param array the array to traverse for looking for the object, may be null * @param valueToFind the value to find * @param startIndex the start index to travers backwards from + * @param tolerance search for value within plus/minus this amount * @return the last index of the value within the array, * -1 if not found or null array input */ @@ -1574,9 +1576,10 @@ public static boolean contains(final double[] array, final double valueToFind) { *

The method returns false if a null array * is passed in.

* - * @param array the array to search - * @param valueToFind the value to find - * @param tolerance the array contains the tolerance of the search. + * @param array the array to search + * @param valueToFind the value to find + * @param tolerance the array contains the tolerance of the search + * @return true if value falling within tolerance is in array */ public static boolean contains(final double[] array, final double valueToFind, final double tolerance) { return (indexOf(array, valueToFind, 0, tolerance) != -1); diff --git a/src/java/org/apache/commons/lang/CharSet.java b/src/java/org/apache/commons/lang/CharSet.java index 2308e4594..7344f09e9 100644 --- a/src/java/org/apache/commons/lang/CharSet.java +++ b/src/java/org/apache/commons/lang/CharSet.java @@ -62,20 +62,21 @@ /** *

A set of characters.

- * + * *

This class is immutable, but subclasses may not be.

* * @author Henri Yandell * @author Stephen Colebourne * @author Phil Steitz + * @author Pete Gieser * @since 1.0 - * @version $Id: CharSet.java,v 1.14 2003/08/07 21:12:19 bayard Exp $ + * @version $Id: CharSet.java,v 1.15 2003/08/16 11:04:46 scolebourne Exp $ */ public class CharSet implements Serializable { /** Serialization lock, Lang version 2.0. */ private static final long serialVersionUID = 5947847346149275958L; - + /** A CharSet defining no characters. */ public static final CharSet EMPTY = new CharSet((String) null); /** A CharSet defining ASCII alphabetic characters "a-zA-Z". */ @@ -86,7 +87,7 @@ public class CharSet implements Serializable { public static final CharSet ASCII_ALPHA_UPPER = new CharSet("A-Z"); /** A CharSet defining ASCII alphabetic characters "0-9". */ public static final CharSet ASCII_NUMERIC = new CharSet("0-9"); - + /** * A Map of the common cases used in the factory. * Subclasses can add more common patterns if desired. @@ -101,14 +102,14 @@ public class CharSet implements Serializable { COMMON.put("A-Z", ASCII_ALPHA_UPPER); COMMON.put("0-9", ASCII_NUMERIC); } - + /** The set of CharRange objects. */ private Set set = new HashSet(); //----------------------------------------------------------------------- /** *

Factory method to create a new CharSet using a special syntax.

- * + * * - * + * *

The matching order is:

*
    Negated multi character range, such as "^a-e" @@ -131,7 +132,7 @@ public class CharSet implements Serializable { *
*

Matching works left to right. Once a match is found the * search starts again from the next character.

- * + * *

If the same range is defined twice using the same syntax, only * one range will be kept. * Thus, "a-ca-c" creates only one range of "a-c".

@@ -144,8 +145,9 @@ public class CharSet implements Serializable { *

The set of characters represented is the union of the specified ranges.

* *

All CharSet objects returned by this method will be immutable.

- * + * * @param setStr the String describing the set, may be null + * @return a CharSet instance */ public static CharSet getInstance(String setStr) { Object set = COMMON.get(setStr); @@ -170,6 +172,7 @@ protected CharSet(String setStr) { *

Constructs a new CharSet using the set syntax. * Each string is merged in with the set.

* + * @param set Strings to merge into the initial set * @throws NullPointerException if set is null */ protected CharSet(String[] set) { @@ -183,7 +186,7 @@ protected CharSet(String[] set) { //----------------------------------------------------------------------- /** *

Add a set definition string to the CharSet.

- * + * * @param str set definition string */ protected void add(String str) { @@ -218,18 +221,18 @@ protected void add(String str) { //----------------------------------------------------------------------- /** *

Gets the internal set as an array of CharRange objects.

- * + * * @return an array of immutable CharRange objects */ public CharRange[] getCharRanges() { return (CharRange[]) set.toArray(new CharRange[set.size()]); } - + //----------------------------------------------------------------------- /** *

Does the CharSet contain the specified * character ch.

- * + * * @param ch the character to check for * @return true if the set contains the characters */ @@ -248,11 +251,10 @@ public boolean contains(char ch) { /** *

Compares two CharSet objects, returning true if they represent * exactly the same set of characters defined in the same way.

- * + * *

The two sets abc and a-c are not * equal according to this method.

- * - * + * * @param obj the object to compare to * @return true if equal */ @@ -269,16 +271,16 @@ public boolean equals(Object obj) { /** *

Gets a hashCode compatable with the equals method.

- * + * * @return a suitable hashCode */ public int hashCode() { return 89 + set.hashCode(); } - + /** *

Gets a string representation of the set.

- * + * * @return string representation of the set */ public String toString() { diff --git a/src/java/org/apache/commons/lang/StringEscapeUtils.java b/src/java/org/apache/commons/lang/StringEscapeUtils.java index f345abc9d..49b44894e 100644 --- a/src/java/org/apache/commons/lang/StringEscapeUtils.java +++ b/src/java/org/apache/commons/lang/StringEscapeUtils.java @@ -72,8 +72,9 @@ * @author Sean Brown * @author Gary Gregory * @author Phil Steitz + * @author Pete Gieser * @since 2.0 - * @version $Id: StringEscapeUtils.java,v 1.23 2003/08/01 20:45:17 scolebourne Exp $ + * @version $Id: StringEscapeUtils.java,v 1.24 2003/08/16 11:04:46 scolebourne Exp $ */ public class StringEscapeUtils { @@ -308,6 +309,7 @@ public static String unescapeJava(String str) { * @param out the Writer used to output unescaped characters * @param str the String to unescape, may be null * @throws IllegalArgumentException if the Writer is null + * @throws IOException if error occurs on undelying Writer */ public static void unescapeJava(Writer out, String str) throws IOException { if (out == null) { @@ -422,6 +424,7 @@ public static String unescapeJavaScript(String str) { * @param out the Writer used to output unescaped characters * @param str the String to unescape, may be null * @throws IllegalArgumentException if the Writer is null + * @throws IOException if error occurs on undelying Writer */ public static void unescapeJavaScript(Writer out, String str) throws IOException { unescapeJava(out, str); diff --git a/src/java/org/apache/commons/lang/enum/package.html b/src/java/org/apache/commons/lang/enum/package.html index 214f8d542..3a174f269 100644 --- a/src/java/org/apache/commons/lang/enum/package.html +++ b/src/java/org/apache/commons/lang/enum/package.html @@ -30,5 +30,6 @@ } } +@since 1.0 diff --git a/src/java/org/apache/commons/lang/exception/ExceptionUtils.java b/src/java/org/apache/commons/lang/exception/ExceptionUtils.java index b53335ed0..29b2eb8e1 100644 --- a/src/java/org/apache/commons/lang/exception/ExceptionUtils.java +++ b/src/java/org/apache/commons/lang/exception/ExceptionUtils.java @@ -78,8 +78,9 @@ * @author Dmitri Plotnikov * @author Stephen Colebourne * @author Gary Gregory + * @author Pete Gieser * @since 1.0 - * @version $Id: ExceptionUtils.java,v 1.31 2003/07/31 23:45:28 scolebourne Exp $ + * @version $Id: ExceptionUtils.java,v 1.32 2003/08/16 11:15:20 scolebourne Exp $ */ public class ExceptionUtils { @@ -180,9 +181,9 @@ public static Throwable getCause(Throwable throwable) { *

Introspects the Throwable to obtain the cause.

* *
    - *
  1. Try known exception types.

    - *
  2. Try the supplied array of method names.

    - *
  3. Try the field 'detail'.

    + *
  4. Try known exception types.
  5. + *
  6. Try the supplied array of method names.
  7. + *
  8. Try the field 'detail'.
  9. *
* *

A null set of method names means use the default set. diff --git a/src/java/org/apache/commons/lang/exception/Nestable.java b/src/java/org/apache/commons/lang/exception/Nestable.java index 60d181583..183359569 100644 --- a/src/java/org/apache/commons/lang/exception/Nestable.java +++ b/src/java/org/apache/commons/lang/exception/Nestable.java @@ -64,14 +64,17 @@ * @author Daniel Rall * @author Kasper Nielsen * @author Steven Caswell + * @author Pete Gieser * @since 1.0 - * @version $Id: Nestable.java,v 1.7 2003/07/26 13:00:36 scolebourne Exp $ + * @version $Id: Nestable.java,v 1.8 2003/08/16 11:15:20 scolebourne Exp $ */ public interface Nestable { /** * Returns the reference to the exception or error that caused the * exception implementing the Nestable to be thrown. + * + * @return throwable that caused the original exception */ public Throwable getCause(); diff --git a/src/java/org/apache/commons/lang/exception/package.html b/src/java/org/apache/commons/lang/exception/package.html index 2707883dd..19ca8cd41 100644 --- a/src/java/org/apache/commons/lang/exception/package.html +++ b/src/java/org/apache/commons/lang/exception/package.html @@ -6,5 +6,6 @@ Exception which can handle JDK 1.4 Exceptions as well as others.

Lastly, {@link org.apache.commons.lang.exception.ExceptionUtils} also contains Throwable manipulation and examination routines.

+@since 1.0 diff --git a/src/java/org/apache/commons/lang/math/Fraction.java b/src/java/org/apache/commons/lang/math/Fraction.java index 7628b9e12..4e97a8db5 100644 --- a/src/java/org/apache/commons/lang/math/Fraction.java +++ b/src/java/org/apache/commons/lang/math/Fraction.java @@ -65,29 +65,62 @@ * @author Travis Reeder * @author Stephen Colebourne * @author Tim O'Brien + * @author Pete Gieser * @since 2.0 - * @version $Id: Fraction.java,v 1.9 2003/08/13 23:42:17 scolebourne Exp $ + * @version $Id: Fraction.java,v 1.10 2003/08/16 11:14:01 scolebourne Exp $ */ public final class Fraction extends Number implements Serializable, Comparable { /** Serialization lock, Lang version 2.0 */ private static final long serialVersionUID = 65382027393090L; + /** + * Fraction representation of 0. + */ public static final Fraction ZERO = new Fraction(0, 1); + /** + * Fraction representation of 1. + */ public static final Fraction ONE = new Fraction(1, 1); - + /** + * Fraction representation of 1/2. + */ public static final Fraction ONE_HALF = new Fraction(1, 2); - + /** + * Fraction representation of 1/3. + */ public static final Fraction ONE_THIRD = new Fraction(1, 3); + /** + * Fraction representation of 2/3. + */ public static final Fraction TWO_THIRDS = new Fraction(2, 3); - + /** + * Fraction representation of 1/4. + */ public static final Fraction ONE_QUARTER = new Fraction(1, 4); + /** + * Fraction representation of 2/4. + */ public static final Fraction TWO_QUARTERS = new Fraction(2, 4); + /** + * Fraction representation of 3/4. + */ public static final Fraction THREE_QUARTERS = new Fraction(3, 4); - + /** + * Fraction representation of 1/5. + */ public static final Fraction ONE_FIFTH = new Fraction(1, 5); + /** + * Fraction representation of 2/5. + */ public static final Fraction TWO_FIFTHS = new Fraction(2, 5); + /** + * Fraction representation of 3/5. + */ public static final Fraction THREE_FIFTHS = new Fraction(3, 5); + /** + * Fraction representation of 4/5. + */ public static final Fraction FOUR_FIFTHS = new Fraction(4, 5); diff --git a/src/java/org/apache/commons/lang/math/package.html b/src/java/org/apache/commons/lang/math/package.html index 1503ff9ab..65a6e9250 100644 --- a/src/java/org/apache/commons/lang/math/package.html +++ b/src/java/org/apache/commons/lang/math/package.html @@ -2,5 +2,6 @@ Extends java.math for business mathematical classes. This package is intended for business mathematical classes, not scientific ones. +@since 2.0 diff --git a/src/java/org/apache/commons/lang/package.html b/src/java/org/apache/commons/lang/package.html index 61cf85dc0..23280277a 100644 --- a/src/java/org/apache/commons/lang/package.html +++ b/src/java/org/apache/commons/lang/package.html @@ -2,5 +2,6 @@ Provides highly reusable static utility methods, chiefly concerned with adding value to java.lang and other standard core classes. +@since 1.0 diff --git a/src/java/org/apache/commons/lang/reflect/MethodUtils.java b/src/java/org/apache/commons/lang/reflect/MethodUtils.java index 29d73c07f..afdeb80ec 100644 --- a/src/java/org/apache/commons/lang/reflect/MethodUtils.java +++ b/src/java/org/apache/commons/lang/reflect/MethodUtils.java @@ -71,15 +71,18 @@ * @author Based on code from BeanUtils by: Craig R. McClanahan * @author Ralph Schaer * @author Chris Audley - * @author Rey François - * @author Gregor Raýman + * @author Rey Fran�ois + * @author Gregor Ra�man * @author Jan Sorensen * @author Robert Burrell Donkin * @author Gary Gregory - * @version $Id: MethodUtils.java,v 1.13 2003/07/20 01:13:54 ggregory Exp $ + * @version $Id: MethodUtils.java,v 1.14 2003/08/16 11:10:23 scolebourne Exp $ */ public class MethodUtils { - + + /** + * Debug flag. + */ public static final boolean debug = false; /** @@ -120,6 +123,7 @@ public static Method getMethod(Class cls, String methodName) { * * @param cls the class to reflect, must not be null * @param methodName the field name to obtain + * @param paramType the class of the parameter * @return the Method object * @throws IllegalArgumentException if the class or method name * is null @@ -131,11 +135,13 @@ public static Method getMethod(Class cls, String methodName, Class paramType) { } /** - *

Gets a Method by name.

The method must be public. - * Superclasses will be considered.

+ *

Gets a Method by name.

+ * + *

The method must be public. Superclasses will be considered.

* * @param cls the class to reflect, must not be null * @param methodName the field name to obtain + * @param paramTypes the classes of the parameters * @return the Method object * @throws IllegalArgumentException if the class or method name * is null @@ -150,6 +156,7 @@ public static Method getMethod(Class cls, String methodName, Class[] paramTypes) * * @param cls the class to reflect, must not be null * @param methodName the method name to obtain + * @param paramTypes the classes of the parameters * @param breakScope whether to break scope restrictions using the * setAccessible method. False will only * match public fields. @@ -226,6 +233,7 @@ public static Method getMethod(Class cls, String methodName, Class[] paramTypes, * no such method can be found, return null.

* * @param method The method that we wish to call + * @return Method */ public static Method getMethod(Method method) { @@ -282,6 +290,7 @@ public static Method getMethod(Method method) { * @param methodName get method with this name, must not * be null * @param arg use this argument, must not be null + * @return Object * @throws ReflectionException if an error occurs during reflection * @throws IllegalArgumentException if any parameter is * null @@ -323,6 +332,7 @@ public static Object invokeMethod( * be null * @param args use these arguments - treat null * as empty array + * @return Object * @throws ReflectionException if an error occurs during reflection * @throws IllegalArgumentException if the objectToInvoke, methodName * or any argument is null @@ -368,6 +378,7 @@ public static Object invokeMethod( * @param args use these arguments - treat null as empty array * @param parameterTypes match these parameters - treat * null as empty array + * @return Object * @throws ReflectionException if an error occurs during reflection */ public static Object invokeMethod( diff --git a/src/java/org/apache/commons/lang/reflect/package.html b/src/java/org/apache/commons/lang/reflect/package.html index 82c827423..f0b9339fe 100644 --- a/src/java/org/apache/commons/lang/reflect/package.html +++ b/src/java/org/apache/commons/lang/reflect/package.html @@ -21,4 +21,6 @@

Java 1.3 And Below

The reflection implementation is slow and buggy. If you are using one of these easier java versions, then you will probably find our code more reliable than the standard java implementation.

+@since 3.0 + diff --git a/src/java/org/apache/commons/lang/time/DateUtils.java b/src/java/org/apache/commons/lang/time/DateUtils.java index 949c1f673..f4f33db49 100644 --- a/src/java/org/apache/commons/lang/time/DateUtils.java +++ b/src/java/org/apache/commons/lang/time/DateUtils.java @@ -74,7 +74,7 @@ * @author Janek Bogucki * @author Gary Gregory * @since 2.0 - * @version $Id: DateUtils.java,v 1.12 2003/08/15 16:14:35 bayard Exp $ + * @version $Id: DateUtils.java,v 1.13 2003/08/16 11:09:26 scolebourne Exp $ */ public class DateUtils { @@ -154,7 +154,7 @@ public class DateUtils { public final static int RANGE_MONTH_MONDAY = 6; /** - *

DateUtils instances should NOT be constructed in + *

DateUtils instances should NOT be constructed in * standard programming. Instead, the class should be used as * DateUtils.parse(str);.

* diff --git a/src/java/org/apache/commons/lang/time/package.html b/src/java/org/apache/commons/lang/time/package.html index 21bfba91f..27f9f5548 100644 --- a/src/java/org/apache/commons/lang/time/package.html +++ b/src/java/org/apache/commons/lang/time/package.html @@ -10,5 +10,6 @@
  • DateFormatUtils - a formatting class for dates
  • StopWatch - a duration timer +@since 2.0 diff --git a/src/java/org/apache/commons/lang/util/BitField.java b/src/java/org/apache/commons/lang/util/BitField.java index 760f4e629..e69f79882 100644 --- a/src/java/org/apache/commons/lang/util/BitField.java +++ b/src/java/org/apache/commons/lang/util/BitField.java @@ -56,14 +56,14 @@ /** *

    Manage operations dealing with bit-mapped fields.

    * - *

    Code originated from the POI project.

    - * + * @author Apache Jakarta POI * @author Scott Sanders (sanders at apache dot org) * @author Marc Johnson (mjohnson at apache dot org) * @author Andrew C. Oliver (acoliver at apache dot org) * @author Stephen Colebourne + * @author Pete Gieser * @since 2.0 - * @version $Id: BitField.java,v 1.6 2003/07/14 22:25:06 bayard Exp $ + * @version $Id: BitField.java,v 1.7 2003/08/16 11:08:49 scolebourne Exp $ */ public class BitField { @@ -100,6 +100,7 @@ public BitField(final int mask) { * value is stored as a BitField (and so shifted left so many * bits).

    * + * @see #setValue * @param holder the int data containing the bits we're interested * in * @return the selected bits, shifted right appropriately @@ -117,6 +118,7 @@ public int getValue(final int holder) { * value is stored as a BitField (and so shifted left so many * bits).

    * + * @see #setShortValue * @param holder the short data containing the bits we're * interested in * @return the selected bits, shifted right appropriately @@ -183,6 +185,7 @@ public boolean isAllSet(final int holder) { /** *

    Replace the bits with new values.

    * + * @see #getValue * @param holder the int data containint the bits we're * interested in * @param value the new value for the specified bits @@ -196,6 +199,7 @@ public int setValue(final int holder, final int value) { /** *

    Replace the bits with new values.

    * + * @see #getShortValue * @param holder the short data containing the bits we're * interested in * @param value the new value for the specified bits diff --git a/src/java/org/apache/commons/lang/util/package.html b/src/java/org/apache/commons/lang/util/package.html index d5c217713..1a2e8340f 100644 --- a/src/java/org/apache/commons/lang/util/package.html +++ b/src/java/org/apache/commons/lang/util/package.html @@ -9,5 +9,6 @@
  • IdentifierUtils - for creating identifiers
  • Validate - for validating values and throwing exceptions +@since 2.0