xxl.comparators
Class Comparators

java.lang.Object
  |
  +--xxl.comparators.Comparators

public abstract class Comparators
extends java.lang.Object

The Comparators-class provides some useful static functions to compare elements.


Constructor Summary
Comparators()
           
 
Method Summary
static java.lang.Object max(java.lang.Object object1, java.lang.Object object2)
          Returns the maximum of two objects.
static java.lang.Object max(java.lang.Object object1, java.lang.Object object2, java.util.Comparator comparator)
          Returns the maximum of two objects.
static java.lang.Object min(java.lang.Object object1, java.lang.Object object2)
          Returns the minimum of two objects.
static java.lang.Object min(java.lang.Object object1, java.lang.Object object2, java.util.Comparator comparator)
          Returns the minimum of two objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Comparators

public Comparators()
Method Detail

max

public static java.lang.Object max(java.lang.Object object1,
                                   java.lang.Object object2)
Returns the maximum of two objects. This function assumes that object1 implements Comparable.
Parameters:
object1 - the first object
object2 - the second object

max

public static java.lang.Object max(java.lang.Object object1,
                                   java.lang.Object object2,
                                   java.util.Comparator comparator)
Returns the maximum of two objects.
Parameters:
object1 - the first object
object2 - the second object
comparator - the comparator to be used to compare the elements

min

public static java.lang.Object min(java.lang.Object object1,
                                   java.lang.Object object2)
Returns the minimum of two objects. This function assumes that object1 implements Comparable.
Parameters:
object1 - the first object
object2 - the second object

min

public static java.lang.Object min(java.lang.Object object1,
                                   java.lang.Object object2,
                                   java.util.Comparator comparator)
Returns the minimum of two objects.
Parameters:
object1 - the first object
object2 - the second object
comparator - the comparator to be used to compare the elements