net.sf.molae.logic.test
Class DefaultEqualityTest

java.lang.Object
  |
  +--net.sf.molae.logic.test.DefaultEqualityTest
All Implemented Interfaces:
EqualityTest

public class DefaultEqualityTest
extends Object
implements EqualityTest

Defines if two objects are equal or not independent from the standard equals method.

Since:
1.1

Constructor Summary
protected DefaultEqualityTest()
          Constructs a new DefaultEqualityTest.
 
Method Summary
 boolean areEqual(Object o1, Object o2)
          Checks if the two specified objects are regarded equal.
static DefaultEqualityTest getInstance()
          Returns the singleton instance of this class.
protected  boolean isEqualTo(Object o1, Object o2)
          Checks if the two specified objects are regarded equal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEqualityTest

protected DefaultEqualityTest()
Constructs a new DefaultEqualityTest.
Method Detail

getInstance

public static DefaultEqualityTest getInstance()
Returns the singleton instance of this class.
Returns:
the singleton instance of this class.

isEqualTo

protected boolean isEqualTo(Object o1,
                            Object o2)
Checks if the two specified objects are regarded equal. Helper method to avoid double code. Only the first object is handled.
Parameters:
o1 - first object to compare
o2 - second object to compare
Returns:
true if the two specified objects are regarded equal.

areEqual

public boolean areEqual(Object o1,
                        Object o2)
Description copied from interface: EqualityTest
Checks if the two specified objects are regarded equal.
Specified by:
areEqual in interface EqualityTest
Following copied from interface: net.sf.molae.logic.tools.EqualityTest
Parameters:
o1 - first object to compare
o2 - second object to compare
Returns:
true if the two specified objects are regarded equal.