public class StringComparator extends Object implements Comparator
| Constructor and Description |
|---|
StringComparator(Locale locale)
Create a locale specific comparator.
|
StringComparator(Locale locale,
int collatorStrength,
boolean isAscending)
Create a locale specific comparator.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Object object1,
Object object2)
Compare the two strings.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic StringComparator(Locale locale, int collatorStrength, boolean isAscending)
locale - The locale to be used when determining sorting order.
If locale is null then a binary comparison is performed.collatorStrength - The strength value to be used by the
Collator. If locale is null then this value is ignored.isAscending - True if we are sorting in ascending order, false
otherwise.public StringComparator(Locale locale)
locale - The locale to be used when determining sorting order.
If locale is null then a binary comparison is performed.public int compare(Object object1, Object object2)
compare in interface Comparatorobject1 - The first string.object2 - The second string.Copyright © 1998–2025 Gargoyle Software Inc.. All rights reserved.