Proposal: Additional API to support the use of recently proposed RawCollationKey class
syn wee <[email protected]>
| Newsgroups | gmane.comp.lib.icu.general |
|---|---|
| Message-ID | <[email protected]> |
Proposal: Adding additional constructors and utility methods to support the use of RawCollationKey class. Please respond with comments before Oct 6 2003. Refer to previous proposal for information on the recently proposed RawCollationKey class, http://oss.software.ibm.com/pipermail/icu4j-support/2003-September/000153.html. Proposed new constructor in the class com.ibm.icu.text RawCollationKey ------------------------------------------------------------------------------------------------------ /** * RawCollationKey created, adopting bytes as the internal byte array. * Size of the internal byte array will be set to size. * @param bytes byte array to be adopted by RawCollationKey * @param size non-negative designated size of bytes * @exception ArrayIndexOutOfBoundsException thrown if size is > * bytes.length * @draft ICU 2.8 */ public RawCollationKey(byte[] bytes, int size) ; Proposed new abstract method in class com.ibm.icu.text.Collator. ------------------------------------------------------------------------------------------------------ /** * Gets the simpler form of a CollationKey for the String source following * the rules of this Collator and stores the result into the user provided * argument key. * If key has a internal byte array of length that's too small for the * result, the internal byte array will be grown to the exact required * size. * @param source the text String to be transformed into a RawCollationKey * @return If key is null, a new instance of RawCollationKey will be * created and returned, otherwise the user provided key will be * returned. * @see #compare(String, String) * @see #getCollationKey * @see RawCollationKey */ public abstract RawCollationKey getRawCollationKey(String source, RawCollationKey key); Proposed new constructor in class com.ibm.icu.text.CollationKey ------------------------------------------------------------------------------------------------------ /** * CollationKey constructor that forces key to release its internal byte * array for adoption. key will have a null byte array after this * construction. * @param source string this CollationKey is to represent * @param key RawCollationKey object that represents the collation order of * argument source. * @see Collator * @see RawCollationKey * @draft ICU 2.8 */ public CollationKey(String source, RawCollationKey key) Proposed 3 new utility methods in class com.ibm.icu.util.ByteArrayWrapper ------------------------------------------------------------------------------------------------------ /** * Appends the internal byte array from offset size with the * contents of src from offset start to limit. This increases the size of * the internal byte array to (size + limit - start). * @param src source byte array to copy from * @param start start offset of src to copy from * @param limit end + 1 offset of src to copy from * @draft ICU 2.8 */ public final void append(byte[] src, int start, int limit) /** * Releases the internal byte array to the caller, resets the internal * byte array to null and its size to 0. * @return internal byte array. * @draft ICU 2.8 */ public final byte[] releaseBytes() /** * Set the internal byte array from offset 0 to (limit - start) with the * contents of src from offset start to limit. If the byte array is null or its length is less than capacity, a * byte array of length (limit - start) will be allocated. * This resets the size of the internal byte array to (limit - start). * @param src source byte array to copy from * @param start start offset of src to copy from * @param limit end + 1 offset of src to copy from */ public final void set(byte[] src, int start, int limit)