com.g11ntoolkit.sorter
Interface Sorter.Comparer

Enclosing interface:
Sorter

public static interface Sorter.Comparer

Defines the compare() method used to compare two objects.

To sort objects of a given type, you must provide a Comparer object with a compare() method that orders those objects as desired.


Method Summary
 int compare(java.lang.Object a, java.lang.Object b)
          Compare two objects and return a value that indicated their relative order.
 

Method Detail

compare

public int compare(java.lang.Object a,
                   java.lang.Object b)
Compare two objects and return a value that indicated their relative order.

Parameters:
a - an Object specifying one of the comparands
b - an Object specifying one of the comparands
Returns:
an int representing the relative order of the two comparands:
  • if (a > b) return >0
  • if (a = b) return 0
  • if (a < b) return <0