org.sape.carboncontrib.utils
Class CompareHelper

java.lang.Object
  extended byorg.sape.carboncontrib.utils.CompareHelper

public final class CompareHelper
extends Object

Helper class for comparing objects.


Constructor Summary
CompareHelper()
           
 
Method Summary
static int compare(Comparable obj1, Comparable obj2)
          Compares the supplied objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompareHelper

public CompareHelper()
Method Detail

compare

public static int compare(Comparable obj1,
                          Comparable obj2)
Compares the supplied objects.

Returns:
int - the compared value of the two objects
  • 0 if they are the same
  • -1 if obj1 is null or obj1 is less than obj2
  • 1 if obj2 is null or obj1 is greater than obj2


Copyright 2003 Sapient Corporation. All Rights Reserved.