org.aris.utils.comperators
Class HashCompare

java.lang.Object
  extended by org.aris.utils.comperators.HashCompare
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator

public class HashCompare
extends java.lang.Object
implements java.util.Comparator, java.io.Serializable

A comparator based on the hash() value of an object.

Author:
Copyright (C) 2004 by Konstantine Koygios
See Also:
Serialized Form

Constructor Summary
HashCompare()
          Creates a new instance of hashCompare
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          The compare function
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

HashCompare

public HashCompare()
Creates a new instance of hashCompare

Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
The compare function

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - first object
o2 - Second object to compare
Returns:
Depending on o1.hash()<=>o2.hash() it returns -1,0,1