Package org.h2.value
Class CharsetCollator
- java.lang.Object
-
- java.text.Collator
-
- org.h2.value.CharsetCollator
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.util.Comparator<java.lang.Object>
public class CharsetCollator extends java.text.Collator
The charset collator sorts strings according to the order in the given charset.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
CharsetCollator.CharsetCollationKey
-
Field Summary
Fields Modifier and Type Field Description private java.nio.charset.Charset
charset
(package private) static java.util.Comparator<byte[]>
COMPARATOR
The comparator used to compare byte arrays.
-
Constructor Summary
Constructors Constructor Description CharsetCollator(java.nio.charset.Charset charset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(java.lang.String source, java.lang.String target)
java.nio.charset.Charset
getCharset()
java.text.CollationKey
getCollationKey(java.lang.String source)
int
hashCode()
(package private) byte[]
toBytes(java.lang.String source)
Convert the source to bytes, using the character set.-
Methods inherited from class java.text.Collator
clone, compare, equals, equals, getAvailableLocales, getDecomposition, getInstance, getInstance, getStrength, setDecomposition, setStrength
-
-
-
-
Method Detail
-
getCharset
public java.nio.charset.Charset getCharset()
-
compare
public int compare(java.lang.String source, java.lang.String target)
- Specified by:
compare
in classjava.text.Collator
-
toBytes
byte[] toBytes(java.lang.String source)
Convert the source to bytes, using the character set.- Parameters:
source
- the source- Returns:
- the bytes
-
getCollationKey
public java.text.CollationKey getCollationKey(java.lang.String source)
- Specified by:
getCollationKey
in classjava.text.Collator
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classjava.text.Collator
-
-