java.lang.Object | |
↳ | org.apache.commons.codec.StringEncoderComparator |
Strings are comparable, and this comparator allows you to configure it with an instance of a class which implements StringEncoder. This comparator is used to sort Strings by an encoding scheme such as Soundex, Metaphone, etc. This class can come in handy if one need to sort Strings by an encoded form of a name such as Soundex.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This constructor is deprecated.
as creating without a StringEncoder will lead to a
broken NullPointerException creating comparator.
| |||||||||||
Constructs a new instance with the given algorithm.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.util.Comparator
|
This constructor is deprecated.
as creating without a StringEncoder will lead to a
broken NullPointerException creating comparator.
Constructs a new instance.
Constructs a new instance with the given algorithm.
stringEncoder | the StringEncoder used for comparisons. |
---|
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.
If an EncoderException
is encountered, return 0
.
o1 | the object to compare |
---|---|
o2 | the object to compare to |