Class RSComparator

Description

Base class for all implementations of comparators.

A comparator does nothing more than to implement/inherit the method compare that takes two arguments and compares them. If the two arguments are equal the value 0 is returned - owtherwise a non-zero value is returned.

Located in /code/framework/RSArrayUtil/RSArrayUtil.php (line 408)


	
			
Direct descendents
Class Description
RSArrayComparator A comparator for arrays.
RSToStringComparator A Comparator for comparing objects by the return values of their toString methods.
RSPrimitiveComparator A Comparator for comparing primitives.
Method Summary
void compare (Object $o1, Object $o2)
Methods
compare (line 417)

Returns 0 if objects passed as first and second argument are equal. They have to implement the method hashCode.

If the return value of the method call hashCode on the object passed as first agrument is equal (==) to the return value of the same methodcall on the object passed as second argument 0 is returned; otherwise -1.

void compare (Object $o1, Object $o2)
  • Object $o1: An object that implements a method called hashCode.
  • Object $o2: An object that implements a method called hashCode.

Redefined in descendants as:

Documentation generated on Mon, 8 Dec 2003 13:10:39 +0100 by phpDocumentor 1.2.3