02/28/2005
 

com.epicentric.common
Class StringComparator

java.lang.Object
  |
  +--com.epicentric.common.StringComparator
All Implemented Interfaces:
com.sun.java.util.collections.Comparator

Deprecated. As of 4.0, to be removed in 8.0 or later.

public class StringComparator
extends Object
implements com.sun.java.util.collections.Comparator

Case-insensitive string comparison utility.


Constructor Summary
StringComparator()
          Deprecated.  
 
Method Summary
 int compare(Object a, Object b)
          Deprecated. As of 4.0, to be removed in 8.0 or later.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.java.util.collections.Comparator
equals
 

Constructor Detail

StringComparator

public StringComparator()
Deprecated. 
Method Detail

compare

public int compare(Object a,
                   Object b)
Deprecated. As of 4.0, to be removed in 8.0 or later.

Casts two objects as strings and then compares them. If the result of the cast is not a string for both values, a ClassCastException will be thrown. The comparisons are case insensitive. Note that for comparison purposes, null is considered to be greater than any non-null value.
Specified by:
compare in interface com.sun.java.util.collections.Comparator
Parameters:
a - first object in the comparison; may be null
b - second object in the comparison; may be null
Returns:
-1 if a < b or b == null
0 if a == b or both a and b are null
1 if a > b or a == null

02/28/2005
 

Copyright and Trademark Notices