jdsl.core.api
Interface EqualityComparator

All Known Subinterfaces:
Comparator, HashComparator

public interface EqualityComparator

This interface defines an equality comparison on a set of objects. It is up to individual implementations to define the set over which they are valid and to reject those objects which they cannot compare by throwing ClassCastExceptions.

Version:
$Id: EqualityComparator.java,v 1.2 2000/01/12 03:21:29 mdh Exp $
Author:
Maurizio Pizzonia, Luca Vismara

Method Summary
 boolean isComparable(java.lang.Object o)
          Allows a container (or any client) to find out whether an object is a member of the ordered set over which this comparator is defined.
 boolean isEqualTo(java.lang.Object a, java.lang.Object b)
          Tests the two parameter objects in the set over which the comparator is defined for equality.
 

Method Detail

isComparable

public boolean isComparable(java.lang.Object o)
Allows a container (or any client) to find out whether an object is a member of the ordered set over which this comparator is defined.
Parameters:
o - Any java.lang.Object
Returns:
True if and only if this comparator may compare this object.

isEqualTo

public boolean isEqualTo(java.lang.Object a,
                         java.lang.Object b)
                  throws java.lang.ClassCastException
Tests the two parameter objects in the set over which the comparator is defined for equality.
Parameters:
a - First Object to compare
b - Second Object to compare
Returns:
True if and only if a is equal to b
Throws:
java.lang.ClassCastException - If either object passed in as a parameter is not a member of the set over which the comparator is defined.