diff --git a/src/java/org/apache/commons/lang/builder/CompareToBuilder.java b/src/java/org/apache/commons/lang/builder/CompareToBuilder.java index 53c166d9e..d8eb64d97 100644 --- a/src/java/org/apache/commons/lang/builder/CompareToBuilder.java +++ b/src/java/org/apache/commons/lang/builder/CompareToBuilder.java @@ -63,18 +63,18 @@ import org.apache.commons.lang.math.NumberUtils; /** *
CompareTo
generation routines.
This class provides methods to build a good This class provides methods to build a good Two object that compare equal using equals should normally compare
- * equals using Two Objects that compare equal using All relevant fields should be included in the calculation of the
* comparison. Derived fields may be ignored. The same fields, in the same
- * order, should be used in both equals
and
- * hashcode
built with {@link EqualsBuilder} and
+ * compareTo
+ * method for any class. It is consistent with the equals()
and
+ * hashcode()
built with {@link EqualsBuilder} and
* {@link HashCodeBuilder}.compareTo
equals()
should normally
+ * also compare equal using compareTo()
compareTo
and
- * equals
.compareTo()
and
+ * equals()
.
Typical use for the code is as follows:
* @@ -107,8 +107,9 @@ import org.apache.commons.lang.math.NumberUtils; * @author Steve Downey * @author Stephen Colebourne * @author Gary Gregory + * @author Pete Gieser * @since 1.0 - * @version $Id: CompareToBuilder.java,v 1.17 2003/07/19 03:25:38 ggregory Exp $ + * @version $Id: CompareToBuilder.java,v 1.18 2003/07/21 23:14:37 scolebourne Exp $ */ public class CompareToBuilder { @@ -137,7 +138,7 @@ public class CompareToBuilder { * *It uses AccessibleObject.setAccessible
to gain access to private
* fields. This means that it will throw a security exception if run under
- * a security manger, if the permissions are not set up correctly. It is
+ * a security manager, if the permissions are not set up correctly. It is
* also not as efficient as testing explicitly.
Transient members will be not be tested, as they are likely derived @@ -164,7 +165,7 @@ public class CompareToBuilder { * *
It uses AccessibleObject.setAccessible
to gain access to private
* fields. This means that it will throw a security exception if run under
- * a security manger, if the permissions are not set up correctly. It is
+ * a security manager, if the permissions are not set up correctly. It is
* also not as efficient as testing explicitly.
If the testTransients
is set to true
,
@@ -193,7 +194,7 @@ public class CompareToBuilder {
*
*
It uses AccessibleObject.setAccessible
to gain access to private
* fields. This means that it will throw a security exception if run under
- * a security manger, if the permissions are not set up correctly. It is
+ * a security manager, if the permissions are not set up correctly. It is
* also not as efficient as testing explicitly.
If the testTransients
is set to true
,
@@ -274,10 +275,10 @@ public class CompareToBuilder {
/**
*
Adds the result of super.hashCode() to this builder.
* - * @param superHashCode the result of callingsuper.equals()
+ * @param superCompareTo the result of calling super.compareTo()
* @return CompareToBuilder - used to chain calls.
*/
- public CompareToBuilder appendSuper(int superHashCode) {
+ public CompareToBuilder appendSuper(int superCompareTo) {
if (comparison != 0) {
return this;
}
@@ -522,7 +523,7 @@ public class CompareToBuilder {
* Deep comparison of an Object
array.
==
==
null
, a null array is less than a non-nullDeep comparison of an Object
array.
==
==
null
, a null array is less than a non-nullDeep comparison of a long
array.
==
==
null
, a null array is less than a non-nullDeep comparison of an int
array.
==
==
null
, a null array is less than a non-nullDeep comparison of a short
array.
==
==
null
, a null array is less than a non-nullDeep comparison of a char
array.
==
==
null
, a null array is less than a non-nullDeep comparison of a byte
array.
==
==
null
, a null array is less than a non-nullDeep comparison of a double
array.
==
==
null
, a null array is less than a non-nullDeep comparison of a float
array.
==
==
null
, a null array is less than a non-nullDeep comparison of a boolean/code> array.
==
==
null
, a null array is less than a non-nullReturn a negative integer if the Object
is less
- * than, a positive integer if the Object
is greater than,
- * or 0
if the Object
is equal.
Return a negative integer if this Object
is less
+ * than, a positive integer if this Object
is greater than,
+ * or 0
if this Object
is equal to the specified
+ * Object.