edu.nrao.sss.util
Enum EqualityMethod

java.lang.Object
  extended by java.lang.Enum<EqualityMethod>
      extended by edu.nrao.sss.util.EqualityMethod
All Implemented Interfaces:
Serializable, Comparable<EqualityMethod>

public enum EqualityMethod
extends Enum<EqualityMethod>

An enumeration of the ways that two objects may be compared for equality.

CVS Info:

$Revision: 161 $
$Date: 2006-12-15 11:48:34 -0700 (Fri, 15 Dec 2006) $
$Author: btruitt $

Since:
2006-12-01
Author:
David M. Harland

Enum Constant Summary
REFERENCE
          Indicates that objects should be compared by reference, that is by the == operator.
VALUE
          Indicates that objects should be compared by value, that is by the equals method.
 
Method Summary
abstract  boolean deemsObjectsEqual(Object o1, Object o2)
          Returns true if o1 is equal to o2 according to the rules of this element.
static EqualityMethod valueOf(String name)
          Returns the enum constant of this type with the specified name.
static EqualityMethod[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

REFERENCE

public static final EqualityMethod REFERENCE
Indicates that objects should be compared by reference, that is by the == operator.


VALUE

public static final EqualityMethod VALUE
Indicates that objects should be compared by value, that is by the equals method.

Method Detail

values

public static EqualityMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (EqualityMethod c : EqualityMethod.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static EqualityMethod valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

deemsObjectsEqual

public abstract boolean deemsObjectsEqual(Object o1,
                                          Object o2)
Returns true if o1 is equal to o2 according to the rules of this element.

Parameters:
o1 - an object to be compared to another for equality.
o2 - an object to be compared to another for equality.
Returns:
true if o1 is equal to o2.


Copyright © 2009. All Rights Reserved.