org.jfree.util
Class ObjectUtils

java.lang.Object
  extended byorg.jfree.util.ObjectUtils

public abstract class ObjectUtils
extends java.lang.Object

A collection of useful static utility methods.


Constructor Summary
ObjectUtils()
           
 
Method Summary
static java.util.List clone(java.util.List list)
          Returns a clone of the list.
static java.lang.Object clone(java.lang.Object object)
          Returns a clone of the object if the object implements the PublicCloneable interface otherwise the original object reference is returned.
static boolean equal(java.lang.Object o1, java.lang.Object o2)
          Returns true if the two objects are equal OR both null.
static boolean equalOrBothNull(java.lang.Object o1, java.lang.Object o2)
          Deprecated. Use ObjectUtils.equal().
static int hashCode(java.lang.Object object)
          Returns a hash code for an object, or zero if the object is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectUtils

public ObjectUtils()
Method Detail

equal

public static boolean equal(java.lang.Object o1,
                            java.lang.Object o2)
Returns true if the two objects are equal OR both null.

Parameters:
o1 - object 1 (null permitted).
o2 - object 2 (null permitted).
Returns:
true or false.

hashCode

public static int hashCode(java.lang.Object object)
Returns a hash code for an object, or zero if the object is null.

Parameters:
object - the object (null permitted).
Returns:
The object's hash code (or zero if the object is null).

clone

public static java.lang.Object clone(java.lang.Object object)
                              throws java.lang.CloneNotSupportedException
Returns a clone of the object if the object implements the PublicCloneable interface otherwise the original object reference is returned.

Parameters:
object - the object to clone (null permitted).
Returns:
A clone or the original object reference.
Throws:
java.lang.CloneNotSupportedException - if the object cannot be cloned.

clone

public static java.util.List clone(java.util.List list)
                            throws java.lang.CloneNotSupportedException
Returns a clone of the list. The objects within the list are cloned IF they implement the PublicCloneable interface, otherwise the reference to the original object is retained in the cloned list.

Parameters:
list - the list.
Returns:
A clone of the list.
Throws:
java.lang.CloneNotSupportedException - if the list could not be cloned.

equalOrBothNull

public static boolean equalOrBothNull(java.lang.Object o1,
                                      java.lang.Object o2)
Deprecated. Use ObjectUtils.equal().

Returns true if the two objects are equal OR both null.

Parameters:
o1 - object 1.
o2 - object 2.
Returns:
true or false.