gishur.core
Interface Comparitor

All Known Implementing Classes:
StdComparitor, SweepEventComparitor, HashComparitor, WeightComparitor

public interface Comparitor

The comparitor interface should be implemented by objects, which are intended to work as comparitor for sorting objects using a sorter object or something similar. A comparitor defines an order on a group of objects. If the objects o1 and o2 are uncomparable by this order, a CompareException should be generated.

Version:
1.1
Author:
Thomas Wolf
See Also:
CompareException

Field Summary
static short BIGGER
          return value of compare: o1 comes after o2 in the order.
static short EQUAL
          return value of compare: o1 is equal to o2 in the order.
static short SMALLER
          return value of compare: o1 comes before o2 in the order.
 
Method Summary
 short compare(java.lang.Object o1, java.lang.Object o2)
          Compares the two objects o1 and o2 using the order
 

Field Detail

SMALLER

public static final short SMALLER
return value of compare: o1 comes before o2 in the order.

EQUAL

public static final short EQUAL
return value of compare: o1 is equal to o2 in the order.

BIGGER

public static final short BIGGER
return value of compare: o1 comes after o2 in the order.
Method Detail

compare

public short compare(java.lang.Object o1,
                     java.lang.Object o2)
Compares the two objects o1 and o2 using the order
Parameters:
o1,o2 - objects to be compared.
Returns:
one of the compare constants of this interface.