|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.icu.util.ByteArrayWrapper
com.ibm.icu.text.RawCollationKey
Simple class wrapper to store the internal byte representation of a CollationKey. Unlike the CollationKey, this class do not contain information on the source string the sort order represents. RawCollationKey is mutable and users can reuse its objects with the method in RuleBasedCollator.getRawCollationKey(..).
Please refer to the documentation on CollationKey for a detail description on the internal byte representation. Note the internal byte representation is always null-terminated.
Example of use:
String str[] = {.....};
RuleBasedCollator collator = (RuleBasedCollator)Collator.getInstance();
RawCollationKey key = new RawCollationKey(128);
for (int i = 0; i < str.length; i ++) {
collator.getRawCollationKey(str[i], key);
// do something with key.bytes
}
Note: Comparison between RawCollationKeys created by different Collators might return incorrect results. See class documentation for Collator.
RuleBasedCollator
,
CollationKey
Field Summary |
Fields inherited from class com.ibm.icu.util.ByteArrayWrapper |
bytes, size |
Constructor Summary | |
RawCollationKey()
Deprecated. This is a draft API and might change in a future release of ICU. |
|
RawCollationKey(byte[] bytes)
Deprecated. This is a draft API and might change in a future release of ICU. |
|
RawCollationKey(byte[] bytesToAdopt,
int size)
Deprecated. This is a draft API and might change in a future release of ICU. |
|
RawCollationKey(int capacity)
Deprecated. This is a draft API and might change in a future release of ICU. |
Method Summary | |
int |
compareTo(Object rhs)
Deprecated. This is a draft API and might change in a future release of ICU. |
Methods inherited from class com.ibm.icu.util.ByteArrayWrapper |
append, ensureCapacity, equals, hashCode, releaseBytes, set, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RawCollationKey()
public RawCollationKey(int capacity)
capacity
- length of internal byte arraypublic RawCollationKey(byte[] bytes)
bytes
- byte array to be adopted by RawCollationKeypublic RawCollationKey(byte[] bytesToAdopt, int size)
bytesToAdopt
- the byte array to adoptsize
- the length of valid data in the byte array
IndexOutOfBoundsException
- if bytesToAdopt == null and size != 0, or
size < 0, or size > bytesToAdopt.length.Method Detail |
public int compareTo(Object rhs)
compareTo
in interface Comparable
compareTo
in class ByteArrayWrapper
rhs
- the RawCollationKey to compare to.
ClassCastException
- if the other object is not a RawCollationKey.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |