public class StringEncoderComparator
extends java.lang.Object
implements java.util.Comparator
Modifier and Type | Field and Description |
---|---|
private StringEncoder |
stringEncoder
Internal encoder instance.
|
Constructor and Description |
---|
StringEncoderComparator()
Constructs a new instance.
|
StringEncoderComparator(StringEncoder stringEncoder)
Constructs a new instance with the given algorithm.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Object o1,
java.lang.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.
|
private StringEncoder stringEncoder
public StringEncoderComparator()
public StringEncoderComparator(StringEncoder stringEncoder)
stringEncoder
- the StringEncoder used for comparisons.public int compare(java.lang.Object o1, java.lang.Object o2)
EncoderException
is encountered, return 0
.compare
in interface java.util.Comparator
o1
- the object to compareo2
- the object to compare toComparable
commons-codec version 1.3 - Copyright © 2002-2004 - Apache Software Foundation