org.apache.commons.codec
public class StringEncoderComparator extends Object implements Comparator
Version: $Id: StringEncoderComparator.java 130381 2004-06-21 23:24:17Z ggregory $
| Field Summary | |
|---|---|
| StringEncoder | stringEncoder
Internal encoder instance. |
| Constructor Summary | |
|---|---|
| StringEncoderComparator()
Constructs a new instance. | |
| StringEncoderComparator(StringEncoder stringEncoder)
Constructs a new instance with the given algorithm. | |
| Method Summary | |
|---|---|
| int | compare(Object o1, Object o2)
Compares two strings based not on the strings
themselves, but on an encoding of the two
strings using the StringEncoder this Comparator
was created with.
|
Parameters: stringEncoder the StringEncoder used for comparisons.
0.
Parameters: o1 the object to compare o2 the object to compare to
Returns: the Comparable.compareTo() return code or 0 if an encoding error was caught.
See Also: Comparable