public class AlphanumComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.CharSequence>
| Modifier and Type | Field and Description |
|---|---|
static ComparatorContext |
CONTEXT |
static ComparatorContext |
CONTEXT_IGNORE_CASE |
| Constructor and Description |
|---|
AlphanumComparator()
Creates a case sensitive comparator to use the alphanum algorithm to compare the strings.
|
AlphanumComparator(boolean caseSensitive)
Creates a comparator to use the alphanum algorithm to compare the strings.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(java.lang.CharSequence s1,
java.lang.CharSequence s2) |
boolean |
isCaseSensitive()
Checks if the case is sensitive when comparing.
|
void |
setCaseSensitive(boolean caseSensitive)
Sets the case sensitive flag.
|
public static final ComparatorContext CONTEXT
public static final ComparatorContext CONTEXT_IGNORE_CASE
public AlphanumComparator()
public AlphanumComparator(boolean caseSensitive)
caseSensitive - true or false.public int compare(java.lang.CharSequence s1,
java.lang.CharSequence s2)
compare in interface java.util.Comparator<java.lang.CharSequence>public boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
caseSensitive - true or false.