All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.predicates.HashComparator

java.lang.Object
   |
   +----COM.objectspace.jgl.predicates.HashComparator

public final class HashComparator
extends Object
implements BinaryPredicate
HashComparator is a binary predicate that returns true if the hash code of its first operand is less than the hash code of its second operand. It is used as the default comparator by many algorithms and containers. It is especially useful for sorting numbers, as the hash code of the Number subclasses are equal to their primitive value.


Constructor Index

 o HashComparator()

Method Index

 o execute(Object, Object)
Compare the operands based on their hash code.

Constructors

 o HashComparator
 public HashComparator()

Methods

 o execute
 public boolean execute(Object first,
                        Object second)
Compare the operands based on their hash code.

Parameters:
first - The first object.
second - The second object.
Returns:
true if the hash code of the first operand is less than the hash code of the second operand using the standard Java hashCode() method.

All Packages  Class Hierarchy  This Package  Previous  Next  Index