Class TextCollatorRegistryJRE.TextCollatorJRE
- java.lang.Object
-
- com.apple.foundationdb.record.provider.common.text.TextCollatorRegistryJRE.TextCollatorJRE
-
- All Implemented Interfaces:
TextCollator
,Comparator<String>
- Enclosing class:
- TextCollatorRegistryJRE
protected static class TextCollatorRegistryJRE.TextCollatorJRE extends Object implements TextCollator
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.provider.common.text.TextCollator
TextCollator.Strength
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TextCollatorJRE(Collator collator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(String str1, String str2)
Compare the two strings according to the this collator's collation rules.ByteString
getKey(String str)
Get a representation of a string suitable for storing in an index for this collation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(@Nonnull String str1, @Nonnull String str2)
Description copied from interface:TextCollator
Compare the two strings according to the this collator's collation rules.- Specified by:
compare
in interfaceComparator<String>
- Specified by:
compare
in interfaceTextCollator
- Parameters:
str1
- the first stringstr2
- the second string- Returns:
- an integer equal to zero if the two strings are equivalent, less than zero if the first string should sort before the second, or greater than zero if the first string should sort after the second.
-
getKey
@Nonnull public ByteString getKey(@Nonnull String str)
Description copied from interface:TextCollator
Get a representation of a string suitable for storing in an index for this collation. The unsigned byte comparison of the result byte array will match this collator's ordering.- Specified by:
getKey
in interfaceTextCollator
- Parameters:
str
- the string to index- Returns:
- a byte string for storing in an index
-
-