nz.ac.waikato.jdsl.core.api
Interface EqualityComparator

All Known Subinterfaces:
Comparator, HashComparator
All Known Implementing Classes:
ComparableComparator, ComparatorExtender, ComparatorReverser, IntegerComparator, IntegerHashComparator, ObjectHashComparator

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:
JDSL 2.1.1
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

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

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.


Copyright © 2009 ModelJUnit Project. All Rights Reserved.