diff --git a/src/java/org/apache/commons/lang/mutable/MutableBoolean.java b/src/java/org/apache/commons/lang/mutable/MutableBoolean.java index 3710582ff..b333823d0 100644 --- a/src/java/org/apache/commons/lang/mutable/MutableBoolean.java +++ b/src/java/org/apache/commons/lang/mutable/MutableBoolean.java @@ -49,8 +49,7 @@ public class MutableBoolean implements Mutable, Serializable, Comparabl /** * Constructs a new MutableBoolean with the specified value. * - * @param value - * a value. + * @param value the initial value to store */ public MutableBoolean(boolean value) { super(); @@ -60,10 +59,8 @@ public class MutableBoolean implements Mutable, Serializable, Comparabl /** * Constructs a new MutableBoolean with the specified value. * - * @param value - * a value. - * @throws NullPointerException - * if the object is null + * @param value the initial value to store, not null + * @throws NullPointerException if the object is null */ public MutableBoolean(Boolean value) { super(); @@ -94,11 +91,9 @@ public class MutableBoolean implements Mutable, Serializable, Comparabl /** * Compares this mutable to another in ascending order. * - * @param other - * the mutable to compare to - * @return zero if this object represents the same boolean value as the argument; a positive value if this object - * represents true and the argument represents false; and a negative value if this object represents false - * and the argument represents true + * @param other the other mutable to compare to, not null + * @return negative if this is less, zero if equal, positive if greater + * where false is less than true */ public int compareTo(MutableBoolean other) { boolean anotherVal = other.value; @@ -111,8 +106,7 @@ public class MutableBoolean implements Mutable, Serializable, Comparabl * not null and is an MutableBoolean object that contains the same * boolean value as this object. * - * @param obj - * the object to compare with. + * @param obj the object to compare with, null returns false * @return true if the objects are the same; false otherwise. */ @Override @@ -127,17 +121,16 @@ public class MutableBoolean implements Mutable, Serializable, Comparabl /** * Gets the value as a Boolean instance. * - * @return the value as a Boolean + * @return the value as a Boolean, never null */ public Boolean getValue() { return Boolean.valueOf(this.value); } /** - * Returns a suitable hashcode for this mutable. + * Returns a suitable hash code for this mutable. * - * @return the integer 1231 if this object represents true; returns the integer - * 1237 if this object represents false. + * @return the hash code returned by Boolean.TRUE or Boolean.FALSE */ @Override public int hashCode() { @@ -147,8 +140,7 @@ public class MutableBoolean implements Mutable, Serializable, Comparabl /** * Sets the value. * - * @param value - * the value to set + * @param value the value to set */ public void setValue(boolean value) { this.value = value; @@ -157,15 +149,14 @@ public class MutableBoolean implements Mutable, Serializable, Comparabl /** * Sets the value from any Boolean instance. * - * @param value - * the value to set - * @throws NullPointerException - * if the object is null + * @param value the value to set, not null + * @throws NullPointerException if the object is null */ public void setValue(Boolean value) { this.value = value.booleanValue(); } + //----------------------------------------------------------------------- /** * Returns the String value of this mutable. * diff --git a/src/java/org/apache/commons/lang/mutable/MutableByte.java b/src/java/org/apache/commons/lang/mutable/MutableByte.java index a4fa91a1c..2667a35f3 100644 --- a/src/java/org/apache/commons/lang/mutable/MutableByte.java +++ b/src/java/org/apache/commons/lang/mutable/MutableByte.java @@ -45,8 +45,7 @@ public class MutableByte extends Number implements Comparable, Muta /** * Constructs a new MutableByte with the specified value. * - * @param value - * a value. + * @param value the initial value to store */ public MutableByte(byte value) { super(); @@ -56,10 +55,8 @@ public class MutableByte extends Number implements Comparable, Muta /** * Constructs a new MutableByte with the specified value. * - * @param value - * a value. - * @throws NullPointerException - * if the object is null + * @param value the initial value to store, not null + * @throws NullPointerException if the object is null */ public MutableByte(Number value) { super(); @@ -69,10 +66,8 @@ public class MutableByte extends Number implements Comparable, Muta /** * Constructs a new MutableByte parsing the given string. * - * @param value - * the string to parse. - * @throws NumberFormatException - * if the string cannot be parsed into a byte + * @param value the string to parse, not null + * @throws NumberFormatException if the string cannot be parsed into a byte */ public MutableByte(String value) throws NumberFormatException { super(); @@ -83,7 +78,7 @@ public class MutableByte extends Number implements Comparable, Muta /** * Gets the value as a Byte instance. * - * @return the value as a Byte + * @return the value as a Byte, never null */ public Byte getValue() { return Byte.valueOf(this.value); @@ -92,8 +87,7 @@ public class MutableByte extends Number implements Comparable, Muta /** * Sets the value. * - * @param value - * the value to set + * @param value the value to set */ public void setValue(byte value) { this.value = value; @@ -102,10 +96,8 @@ public class MutableByte extends Number implements Comparable, Muta /** * Sets the value from any Number instance. * - * @param value - * the value to set - * @throws NullPointerException - * if the object is null + * @param value the value to set, not null + * @throws NullPointerException if the object is null */ public void setValue(Number value) { this.value = value.byteValue(); @@ -124,7 +116,7 @@ public class MutableByte extends Number implements Comparable, Muta } /** - * Returns the value of this MutableByte as a int. + * Returns the value of this MutableByte as an int. * * @return the numeric value represented by this object after conversion to type int. */ @@ -194,11 +186,9 @@ public class MutableByte extends Number implements Comparable, Muta //----------------------------------------------------------------------- /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to add, not null * @since Commons Lang 2.2 */ public void add(byte operand) { @@ -206,13 +196,10 @@ public class MutableByte extends Number implements Comparable, Muta } /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to add, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void add(Number operand) { @@ -220,11 +207,9 @@ public class MutableByte extends Number implements Comparable, Muta } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to subtract, not null * @since Commons Lang 2.2 */ public void subtract(byte operand) { @@ -232,13 +217,10 @@ public class MutableByte extends Number implements Comparable, Muta } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to subtract, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void subtract(Number operand) { @@ -247,12 +229,11 @@ public class MutableByte extends Number implements Comparable, Muta //----------------------------------------------------------------------- /** - * Compares this object against the specified object. The result is true if and only if the argument - * is not null and is a MutableByte object that contains the same byte - * value as this object. + * Compares this object to the specified object. The result is true if and only if the argument is + * not null and is a MutableByte object that contains the same byte value + * as this object. * - * @param obj - * the object to compare with. + * @param obj the object to compare with, null returns false * @return true if the objects are the same; false otherwise. */ @Override @@ -264,28 +245,28 @@ public class MutableByte extends Number implements Comparable, Muta } /** - * Returns a suitable hashcode for this mutable. + * Returns a suitable hash code for this mutable. * - * @return a suitable hashcode + * @return a suitable hash code */ @Override public int hashCode() { return value; } + //----------------------------------------------------------------------- /** * Compares this mutable to another in ascending order. * - * @param other - * the mutable to compare to + * @param other the other mutable to compare to, not null * @return negative if this is less, zero if equal, positive if greater - * @throws ClassCastException if the argument is not a MutableByte */ public int compareTo(MutableByte other) { byte anotherVal = other.value; return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1); } + //----------------------------------------------------------------------- /** * Returns the String value of this mutable. * diff --git a/src/java/org/apache/commons/lang/mutable/MutableDouble.java b/src/java/org/apache/commons/lang/mutable/MutableDouble.java index 5d73336ca..6bc0864f9 100644 --- a/src/java/org/apache/commons/lang/mutable/MutableDouble.java +++ b/src/java/org/apache/commons/lang/mutable/MutableDouble.java @@ -45,8 +45,7 @@ public class MutableDouble extends Number implements Comparable, /** * Constructs a new MutableDouble with the specified value. * - * @param value - * a value. + * @param value the initial value to store */ public MutableDouble(double value) { super(); @@ -56,10 +55,8 @@ public class MutableDouble extends Number implements Comparable, /** * Constructs a new MutableDouble with the specified value. * - * @param value - * a value. - * @throws NullPointerException - * if the object is null + * @param value the initial value to store, not null + * @throws NullPointerException if the object is null */ public MutableDouble(Number value) { super(); @@ -69,10 +66,8 @@ public class MutableDouble extends Number implements Comparable, /** * Constructs a new MutableDouble parsing the given string. * - * @param value - * the string to parse. - * @throws NumberFormatException - * if the string cannot be parsed into a double + * @param value the string to parse, not null + * @throws NumberFormatException if the string cannot be parsed into a double */ public MutableDouble(String value) throws NumberFormatException { super(); @@ -83,7 +78,7 @@ public class MutableDouble extends Number implements Comparable, /** * Gets the value as a Double instance. * - * @return the value as a Double + * @return the value as a Double, never null */ public Double getValue() { return new Double(this.value); @@ -92,8 +87,7 @@ public class MutableDouble extends Number implements Comparable, /** * Sets the value. * - * @param value - * the value to set + * @param value the value to set */ public void setValue(double value) { this.value = value; @@ -102,10 +96,8 @@ public class MutableDouble extends Number implements Comparable, /** * Sets the value from any Number instance. * - * @param value - * the value to set - * @throws NullPointerException - * if the object is null + * @param value the value to set, not null + * @throws NullPointerException if the object is null */ public void setValue(Number value) { this.value = value.doubleValue(); @@ -114,7 +106,7 @@ public class MutableDouble extends Number implements Comparable, //----------------------------------------------------------------------- // shortValue and bytValue rely on Number implementation /** - * Returns the value of this MutableDouble as a int. + * Returns the value of this MutableDouble as an int. * * @return the numeric value represented by this object after conversion to type int. */ @@ -202,11 +194,9 @@ public class MutableDouble extends Number implements Comparable, //----------------------------------------------------------------------- /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to add * @since Commons Lang 2.2 */ public void add(double operand) { @@ -214,13 +204,10 @@ public class MutableDouble extends Number implements Comparable, } /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to add, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void add(Number operand) { @@ -228,11 +215,9 @@ public class MutableDouble extends Number implements Comparable, } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to subtract, not null * @since Commons Lang 2.2 */ public void subtract(double operand) { @@ -240,13 +225,10 @@ public class MutableDouble extends Number implements Comparable, } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to subtract, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void subtract(Number operand) { @@ -280,8 +262,7 @@ public class MutableDouble extends Number implements Comparable, * +0.0==-0.0 has the value true. This allows hashtables to operate properly. * * - * @param obj - * the object to compare with. + * @param obj the object to compare with, null returns false * @return true if the objects are the same; false otherwise. */ @Override @@ -291,9 +272,9 @@ public class MutableDouble extends Number implements Comparable, } /** - * Returns a suitable hashcode for this mutable. + * Returns a suitable hash code for this mutable. * - * @return a suitable hashcode + * @return a suitable hash code */ @Override public int hashCode() { @@ -301,11 +282,11 @@ public class MutableDouble extends Number implements Comparable, return (int) (bits ^ (bits >>> 32)); } + //----------------------------------------------------------------------- /** * Compares this mutable to another in ascending order. * - * @param other - * the mutable to compare to + * @param other the other mutable to compare to, not null * @return negative if this is less, zero if equal, positive if greater */ public int compareTo(MutableDouble other) { @@ -313,6 +294,7 @@ public class MutableDouble extends Number implements Comparable, return Double.compare(value, anotherVal); } + //----------------------------------------------------------------------- /** * Returns the String value of this mutable. * diff --git a/src/java/org/apache/commons/lang/mutable/MutableFloat.java b/src/java/org/apache/commons/lang/mutable/MutableFloat.java index 26a953328..253b984e7 100644 --- a/src/java/org/apache/commons/lang/mutable/MutableFloat.java +++ b/src/java/org/apache/commons/lang/mutable/MutableFloat.java @@ -45,8 +45,7 @@ public class MutableFloat extends Number implements Comparable, Mu /** * Constructs a new MutableFloat with the specified value. * - * @param value - * a value. + * @param value the initial value to store */ public MutableFloat(float value) { super(); @@ -56,10 +55,8 @@ public class MutableFloat extends Number implements Comparable, Mu /** * Constructs a new MutableFloat with the specified value. * - * @param value - * a value. - * @throws NullPointerException - * if the object is null + * @param value the initial value to store, not null + * @throws NullPointerException if the object is null */ public MutableFloat(Number value) { super(); @@ -69,10 +66,8 @@ public class MutableFloat extends Number implements Comparable, Mu /** * Constructs a new MutableFloat parsing the given string. * - * @param value - * the string to parse. - * @throws NumberFormatException - * if the string cannot be parsed into a float + * @param value the string to parse, not null + * @throws NumberFormatException if the string cannot be parsed into a float */ public MutableFloat(String value) throws NumberFormatException { super(); @@ -83,7 +78,7 @@ public class MutableFloat extends Number implements Comparable, Mu /** * Gets the value as a Float instance. * - * @return the value as a Float + * @return the value as a Float, never null */ public Float getValue() { return new Float(this.value); @@ -92,8 +87,7 @@ public class MutableFloat extends Number implements Comparable, Mu /** * Sets the value. * - * @param value - * the value to set + * @param value the value to set */ public void setValue(float value) { this.value = value; @@ -102,10 +96,8 @@ public class MutableFloat extends Number implements Comparable, Mu /** * Sets the value from any Number instance. * - * @param value - * the value to set - * @throws NullPointerException - * if the object is null + * @param value the value to set, not null + * @throws NullPointerException if the object is null */ public void setValue(Number value) { this.value = value.floatValue(); @@ -132,11 +124,9 @@ public class MutableFloat extends Number implements Comparable, Mu //----------------------------------------------------------------------- /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to add, not null * @since Commons Lang 2.2 */ public void add(float operand) { @@ -144,13 +134,10 @@ public class MutableFloat extends Number implements Comparable, Mu } /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to add, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void add(Number operand) { @@ -158,11 +145,9 @@ public class MutableFloat extends Number implements Comparable, Mu } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to subtract * @since Commons Lang 2.2 */ public void subtract(float operand) { @@ -170,13 +155,10 @@ public class MutableFloat extends Number implements Comparable, Mu } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to subtract, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void subtract(Number operand) { @@ -186,7 +168,7 @@ public class MutableFloat extends Number implements Comparable, Mu //----------------------------------------------------------------------- // shortValue and bytValue rely on Number implementation /** - * Returns the value of this MutableFloat as a int. + * Returns the value of this MutableFloat as an int. * * @return the numeric value represented by this object after conversion to type int. */ @@ -281,8 +263,7 @@ public class MutableFloat extends Number implements Comparable, Mu * * This definition allows hashtables to operate properly. * - * @param obj - * the object to be compared + * @param obj the object to compare with, null returns false * @return true if the objects are the same; false otherwise. * @see java.lang.Float#floatToIntBits(float) */ @@ -292,22 +273,21 @@ public class MutableFloat extends Number implements Comparable, Mu && (Float.floatToIntBits(((MutableFloat) obj).value) == Float.floatToIntBits(value)); } - //----------------------------------------------------------------------- /** - * Returns a suitable hashcode for this mutable. + * Returns a suitable hash code for this mutable. * - * @return a suitable hashcode + * @return a suitable hash code */ @Override public int hashCode() { return Float.floatToIntBits(value); } + //----------------------------------------------------------------------- /** * Compares this mutable to another in ascending order. * - * @param other - * the mutable to compare to + * @param other the other mutable to compare to, not null * @return negative if this is less, zero if equal, positive if greater */ public int compareTo(MutableFloat other) { @@ -315,6 +295,7 @@ public class MutableFloat extends Number implements Comparable, Mu return Float.compare(value, anotherVal); } + //----------------------------------------------------------------------- /** * Returns the String value of this mutable. * diff --git a/src/java/org/apache/commons/lang/mutable/MutableInt.java b/src/java/org/apache/commons/lang/mutable/MutableInt.java index 456821f18..32df2c823 100644 --- a/src/java/org/apache/commons/lang/mutable/MutableInt.java +++ b/src/java/org/apache/commons/lang/mutable/MutableInt.java @@ -45,8 +45,7 @@ public class MutableInt extends Number implements Comparable, Mutabl /** * Constructs a new MutableInt with the specified value. * - * @param value - * a value. + * @param value the initial value to store */ public MutableInt(int value) { super(); @@ -56,10 +55,8 @@ public class MutableInt extends Number implements Comparable, Mutabl /** * Constructs a new MutableInt with the specified value. * - * @param value - * a value. - * @throws NullPointerException - * if the object is null + * @param value the initial value to store, not null + * @throws NullPointerException if the object is null */ public MutableInt(Number value) { super(); @@ -69,10 +66,8 @@ public class MutableInt extends Number implements Comparable, Mutabl /** * Constructs a new MutableInt parsing the given string. * - * @param value - * the string to parse. - * @throws NumberFormatException - * if the string cannot be parsed into an int + * @param value the string to parse, not null + * @throws NumberFormatException if the string cannot be parsed into an int */ public MutableInt(String value) throws NumberFormatException { super(); @@ -83,7 +78,7 @@ public class MutableInt extends Number implements Comparable, Mutabl /** * Gets the value as a Integer instance. * - * @return the value as a Integer + * @return the value as a Integer, never null */ public Integer getValue() { return new Integer(this.value); @@ -92,8 +87,7 @@ public class MutableInt extends Number implements Comparable, Mutabl /** * Sets the value. * - * @param value - * the value to set + * @param value the value to set */ public void setValue(int value) { this.value = value; @@ -102,12 +96,8 @@ public class MutableInt extends Number implements Comparable, Mutabl /** * Sets the value from any Number instance. * - * @param value - * the value to set - * @throws NullPointerException - * if the object is null - * @throws ClassCastException - * if the type is not a {@link Number} + * @param value the value to set, not null + * @throws NullPointerException if the object is null */ public void setValue(Number value) { this.value = value.intValue(); @@ -134,11 +124,9 @@ public class MutableInt extends Number implements Comparable, Mutabl //----------------------------------------------------------------------- /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to add, not null * @since Commons Lang 2.2 */ public void add(int operand) { @@ -146,13 +134,10 @@ public class MutableInt extends Number implements Comparable, Mutabl } /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to add, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void add(Number operand) { @@ -160,11 +145,9 @@ public class MutableInt extends Number implements Comparable, Mutabl } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to subtract, not null * @since Commons Lang 2.2 */ public void subtract(int operand) { @@ -172,13 +155,10 @@ public class MutableInt extends Number implements Comparable, Mutabl } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to subtract, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void subtract(Number operand) { @@ -188,7 +168,7 @@ public class MutableInt extends Number implements Comparable, Mutabl //----------------------------------------------------------------------- // shortValue and bytValue rely on Number implementation /** - * Returns the value of this MutableInt as a int. + * Returns the value of this MutableInt as an int. * * @return the numeric value represented by this object after conversion to type int. */ @@ -240,11 +220,10 @@ public class MutableInt extends Number implements Comparable, Mutabl //----------------------------------------------------------------------- /** * Compares this object to the specified object. The result is true if and only if the argument is - * not null and is an MutableInt object that contains the same int value + * not null and is a MutableInt object that contains the same int value * as this object. * - * @param obj - * the object to compare with. + * @param obj the object to compare with, null returns false * @return true if the objects are the same; false otherwise. */ @Override @@ -256,20 +235,20 @@ public class MutableInt extends Number implements Comparable, Mutabl } /** - * Returns a suitable hashcode for this mutable. + * Returns a suitable hash code for this mutable. * - * @return a suitable hashcode + * @return a suitable hash code */ @Override public int hashCode() { return value; } + //----------------------------------------------------------------------- /** * Compares this mutable to another in ascending order. * - * @param other - * the mutable to compare to + * @param other the other mutable to compare to, not null * @return negative if this is less, zero if equal, positive if greater */ public int compareTo(MutableInt other) { @@ -277,6 +256,7 @@ public class MutableInt extends Number implements Comparable, Mutabl return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1); } + //----------------------------------------------------------------------- /** * Returns the String value of this mutable. * diff --git a/src/java/org/apache/commons/lang/mutable/MutableLong.java b/src/java/org/apache/commons/lang/mutable/MutableLong.java index e945718d1..7f39d0627 100644 --- a/src/java/org/apache/commons/lang/mutable/MutableLong.java +++ b/src/java/org/apache/commons/lang/mutable/MutableLong.java @@ -45,8 +45,7 @@ public class MutableLong extends Number implements Comparable, Muta /** * Constructs a new MutableLong with the specified value. * - * @param value - * a value. + * @param value the initial value to store */ public MutableLong(long value) { super(); @@ -56,10 +55,8 @@ public class MutableLong extends Number implements Comparable, Muta /** * Constructs a new MutableLong with the specified value. * - * @param value - * a value. - * @throws NullPointerException - * if the object is null + * @param value the initial value to store, not null + * @throws NullPointerException if the object is null */ public MutableLong(Number value) { super(); @@ -69,10 +66,8 @@ public class MutableLong extends Number implements Comparable, Muta /** * Constructs a new MutableLong parsing the given string. * - * @param value - * the string to parse. - * @throws NumberFormatException - * if the string cannot be parsed into a long + * @param value the string to parse, not null + * @throws NumberFormatException if the string cannot be parsed into a long */ public MutableLong(String value) throws NumberFormatException { super(); @@ -83,7 +78,7 @@ public class MutableLong extends Number implements Comparable, Muta /** * Gets the value as a Long instance. * - * @return the value as a Long + * @return the value as a Long, never null */ public Long getValue() { return new Long(this.value); @@ -92,8 +87,7 @@ public class MutableLong extends Number implements Comparable, Muta /** * Sets the value. * - * @param value - * the value to set + * @param value the value to set */ public void setValue(long value) { this.value = value; @@ -102,10 +96,8 @@ public class MutableLong extends Number implements Comparable, Muta /** * Sets the value from any Number instance. * - * @param value - * the value to set - * @throws NullPointerException - * if the object is null + * @param value the value to set, not null + * @throws NullPointerException if the object is null */ public void setValue(Number value) { this.value = value.longValue(); @@ -132,11 +124,9 @@ public class MutableLong extends Number implements Comparable, Muta //----------------------------------------------------------------------- /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to add, not null * @since Commons Lang 2.2 */ public void add(long operand) { @@ -144,13 +134,10 @@ public class MutableLong extends Number implements Comparable, Muta } /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to add, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void add(Number operand) { @@ -158,11 +145,9 @@ public class MutableLong extends Number implements Comparable, Muta } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to subtract, not null * @since Commons Lang 2.2 */ public void subtract(long operand) { @@ -170,13 +155,10 @@ public class MutableLong extends Number implements Comparable, Muta } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to subtract, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void subtract(Number operand) { @@ -186,7 +168,7 @@ public class MutableLong extends Number implements Comparable, Muta //----------------------------------------------------------------------- // shortValue and bytValue rely on Number implementation /** - * Returns the value of this MutableLong as a int. + * Returns the value of this MutableLong as an int. * * @return the numeric value represented by this object after conversion to type int. */ @@ -237,12 +219,11 @@ public class MutableLong extends Number implements Comparable, Muta //----------------------------------------------------------------------- /** - * Compares this object against the specified object. The result is true if and only if the argument + * Compares this object to the specified object. The result is true if and only if the argument * is not null and is a MutableLong object that contains the same long * value as this object. * - * @param obj - * the object to compare with. + * @param obj the object to compare with, null returns false * @return true if the objects are the same; false otherwise. */ @Override @@ -254,20 +235,20 @@ public class MutableLong extends Number implements Comparable, Muta } /** - * Returns a suitable hashcode for this mutable. + * Returns a suitable hash code for this mutable. * - * @return a suitable hashcode + * @return a suitable hash code */ @Override public int hashCode() { return (int) (value ^ (value >>> 32)); } + //----------------------------------------------------------------------- /** * Compares this mutable to another in ascending order. * - * @param other - * the mutable to compare to + * @param other the other mutable to compare to, not null * @return negative if this is less, zero if equal, positive if greater */ public int compareTo(MutableLong other) { @@ -275,6 +256,7 @@ public class MutableLong extends Number implements Comparable, Muta return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1); } + //----------------------------------------------------------------------- /** * Returns the String value of this mutable. * diff --git a/src/java/org/apache/commons/lang/mutable/MutableShort.java b/src/java/org/apache/commons/lang/mutable/MutableShort.java index 82e14dbb7..d07ddc07b 100644 --- a/src/java/org/apache/commons/lang/mutable/MutableShort.java +++ b/src/java/org/apache/commons/lang/mutable/MutableShort.java @@ -45,8 +45,7 @@ public class MutableShort extends Number implements Comparable, Mu /** * Constructs a new MutableShort with the specified value. * - * @param value - * a value. + * @param value the initial value to store */ public MutableShort(short value) { super(); @@ -56,10 +55,8 @@ public class MutableShort extends Number implements Comparable, Mu /** * Constructs a new MutableShort with the specified value. * - * @param value - * a value. - * @throws NullPointerException - * if the object is null + * @param value the initial value to store, not null + * @throws NullPointerException if the object is null */ public MutableShort(Number value) { super(); @@ -69,10 +66,8 @@ public class MutableShort extends Number implements Comparable, Mu /** * Constructs a new MutableShort parsing the given string. * - * @param value - * the string to parse. - * @throws NumberFormatException - * if the string cannot be parsed into a short + * @param value the string to parse, not null + * @throws NumberFormatException if the string cannot be parsed into a short */ public MutableShort(String value) throws NumberFormatException { super(); @@ -83,7 +78,7 @@ public class MutableShort extends Number implements Comparable, Mu /** * Gets the value as a Short instance. * - * @return the value as a Short + * @return the value as a Short, never null */ public Short getValue() { return new Short(this.value); @@ -92,8 +87,7 @@ public class MutableShort extends Number implements Comparable, Mu /** * Sets the value. * - * @param value - * the value to set + * @param value the value to set */ public void setValue(short value) { this.value = value; @@ -102,10 +96,8 @@ public class MutableShort extends Number implements Comparable, Mu /** * Sets the value from any Number instance. * - * @param value - * the value to set - * @throws NullPointerException - * if the object is null + * @param value the value to set, not null + * @throws NullPointerException if the object is null */ public void setValue(Number value) { this.value = value.shortValue(); @@ -132,11 +124,9 @@ public class MutableShort extends Number implements Comparable, Mu //----------------------------------------------------------------------- /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to add, not null * @since Commons Lang 2.2 */ public void add(short operand) { @@ -144,13 +134,10 @@ public class MutableShort extends Number implements Comparable, Mu } /** - * Adds a value. + * Adds a value to the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to add, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void add(Number operand) { @@ -158,11 +145,9 @@ public class MutableShort extends Number implements Comparable, Mu } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * + * @param operand the value to subtract, not null * @since Commons Lang 2.2 */ public void subtract(short operand) { @@ -170,13 +155,10 @@ public class MutableShort extends Number implements Comparable, Mu } /** - * Subtracts a value. + * Subtracts a value from the value of this instance. * - * @param operand - * the value to add - * @throws NullPointerException - * if the object is null - * + * @param operand the value to subtract, not null + * @throws NullPointerException if the object is null * @since Commons Lang 2.2 */ public void subtract(Number operand) { @@ -196,7 +178,7 @@ public class MutableShort extends Number implements Comparable, Mu } /** - * Returns the value of this MutableShort as a int. + * Returns the value of this MutableShort as an int. * * @return the numeric value represented by this object after conversion to type int. */ @@ -247,12 +229,11 @@ public class MutableShort extends Number implements Comparable, Mu //----------------------------------------------------------------------- /** - * Compares this object against the specified object. The result is true if and only if the argument + * Compares this object to the specified object. The result is true if and only if the argument * is not null and is a MutableShort object that contains the same short * value as this object. * - * @param obj - * the object to compare with. + * @param obj the object to compare with, null returns false * @return true if the objects are the same; false otherwise. */ @Override @@ -264,20 +245,20 @@ public class MutableShort extends Number implements Comparable, Mu } /** - * Returns a suitable hashcode for this mutable. + * Returns a suitable hash code for this mutable. * - * @return a suitable hashcode + * @return a suitable hash code */ @Override public int hashCode() { return value; } + //----------------------------------------------------------------------- /** * Compares this mutable to another in ascending order. * - * @param other - * the mutable to compare to + * @param other the other mutable to compare to, not null * @return negative if this is less, zero if equal, positive if greater */ public int compareTo(MutableShort other) { @@ -285,6 +266,7 @@ public class MutableShort extends Number implements Comparable, Mu return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1); } + //----------------------------------------------------------------------- /** * Returns the String value of this mutable. *