public class CacheCollator extends Collator implements Serializable
CANONICAL_DECOMPOSITION, FULL_DECOMPOSITION, IDENTICAL, NO_DECOMPOSITION, PRIMARY, SECONDARY, TERTIARY| Constructor and Description |
|---|
CacheCollator(Collator collator)
Construct this collator to cache the results of another collator.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Clone the caching collator.
|
int |
compare(String source, String target)
Compares the source string to the target string according to the collation rules for this Collator.
|
boolean |
equals(Object that)
Compares the equality of two Collators.
|
protected Map |
getCache() |
CollationKey |
getCollationKey(String source)
Transforms the String into a series of bits that can be compared bitwise to other CollationKeys.
|
int |
getDecomposition()
Get the decomposition mode of this Collator.
|
int |
getStrength()
Returns this Collator's strength property.
|
int |
hashCode()
Generates the hash code for this Collator.
|
void |
setDecomposition(int decomposition)
Set the decomposition mode of this Collator.
|
void |
setStrength(int newStrength)
Sets this Collator's strength property.
|
compare, equals, getAvailableLocales, getInstance, getInstancefinalize, getClass, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic CacheCollator(Collator collator)
collator - the collator to delegate topublic int getStrength()
getStrength in class Collatorpublic void setStrength(int newStrength)
setStrength in class CollatornewStrength - the new strength value.UnsupportedOperationException - always thrownpublic int getDecomposition()
getDecomposition in class Collatorpublic void setDecomposition(int decomposition)
setDecomposition in class Collatordecomposition - the new decomposition modeUnsupportedOperationException - always thrownpublic int compare(String source, String target)
For a one time comparison, this method has the best performance. If a given String will be involved in multiple comparisons, CollationKey.compareTo has the best performance. See the Collator class description for an example using CollationKeys.
compare in class Collatorsource - the source string.target - the target string.public CollationKey getCollationKey(String source)
getCollationKey in class Collatorsource - the string to be transformed into a collation key.public Object clone()
public boolean equals(Object that)
equals in interface Comparator<Object>equals in class Collatorthat - the Collator to be compared with this.public int hashCode()
protected Map getCache()