/// <summary> /// CollationKey constructor that forces key to release its internal byte /// array for adoption. key will have a null byte array after this /// construction. /// </summary> /// /// <param name="source">string this CollationKey is to represent</param> /// <param name="key">RawCollationKey object that represents the collation order ofargument source.</param> /// <seealso cref="T:IBM.ICU.Text.Collator"/> /// <seealso cref="T:IBM.ICU.Text.RawCollationKey"/> /// @stable ICU 2.8 public CollationKey(String source, RawCollationKey key) { m_source_ = source; m_key_ = key.ReleaseBytes(); m_hashCode_ = 0; m_length_ = -1; }
/// <summary> /// 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. /// </summary> /// /// <param name="source">the text String to be transformed into a RawCollationKey</param> /// <returns>If key is null, a new instance of RawCollationKey will be created /// and returned, otherwise the user provided key will be returned.</returns> /// <seealso cref="M:IBM.ICU.Text.Collator.Compare(System.String, System.String)"/> /// <seealso cref="M:IBM.ICU.Text.Collator.GetCollationKey(System.String)"/> /// <seealso cref="T:IBM.ICU.Text.RawCollationKey"/> /// @stable ICU 2.8 public abstract RawCollationKey GetRawCollationKey(String source, RawCollationKey key);