Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > f51238514e2abe817779ad2fe01b0759 > files > 66

icu-doc-4.4-2.1mdv2010.2.i586.rpm

<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>ICU 4.4: CollationKey Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&nbsp;Structure&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Data&nbsp;Fields</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>CollationKey Class Reference</h1><!-- doxytag: class="CollationKey" --><!-- doxytag: inherits="UObject" -->
<p>Collation keys are generated by the <a class="el" href="classCollator.html" title="The Collator class performs locale-sensitive string comparison.">Collator</a> class.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="sortkey_8h_source.html">sortkey.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for CollationKey:</div>
<div class="dynsection">
 <div class="center">
  <img src="classCollationKey.gif" usemap="#CollationKey_map" alt=""/>
  <map id="CollationKey_map" name="CollationKey_map">
<area href="classUObject.html" alt="UObject" shape="rect" coords="0,56,83,80"/>
<area href="classUMemory.html" alt="UMemory" shape="rect" coords="0,0,83,24"/>
</map>
 </div>
</div>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#a236ce6b7d878eb6a0d5ee583eeb7f6db">CollationKey</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This creates an empty collation key based on the null string.  <a href="#a236ce6b7d878eb6a0d5ee583eeb7f6db"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#aec3b2c31ee34d6019991b24b7a975493">CollationKey</a> (const uint8_t *values, int32_t count)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a collation key based on the collation key values.  <a href="#aec3b2c31ee34d6019991b24b7a975493"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#a62c797dd9568e240cdcdd3e0b8fb466b">CollationKey</a> (const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;other)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Copy constructor.  <a href="#a62c797dd9568e240cdcdd3e0b8fb466b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#a39b57d5e52b60506ad9a99242b19c1b2">~CollationKey</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sort key destructor.  <a href="#a39b57d5e52b60506ad9a99242b19c1b2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#a38541209bbf6084770d4973ed6cada18">operator=</a> (const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;other)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Assignment operator.  <a href="#a38541209bbf6084770d4973ed6cada18"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#a26887fbeff16532382794b91faebaae4">operator==</a> (const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;source) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compare if two collation keys are the same.  <a href="#a26887fbeff16532382794b91faebaae4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#a85bb52c50f3baf2aad76282f719d6193">operator!=</a> (const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;source) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compare if two collation keys are not the same.  <a href="#a85bb52c50f3baf2aad76282f719d6193"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#a2b5cbecf80d0c583ec608eb88628f4bd">isBogus</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Test to see if the key is in an invalid state.  <a href="#a2b5cbecf80d0c583ec608eb88628f4bd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const uint8_t *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#aba4102f9d534cdf6c0ed52e1b5a7578e">getByteArray</a> (int32_t &amp;count) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a pointer to the collation key values.  <a href="#aba4102f9d534cdf6c0ed52e1b5a7578e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCollator.html#a05f22f81363f2613bea18a632b67686f">Collator::EComparisonResult</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#a175ce0d8cb5d392731a238e0de29cdda">compareTo</a> (const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;target) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convenience method which does a string(bit-wise) comparison of the two collation keys.  <a href="#a175ce0d8cb5d392731a238e0de29cdda"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="ucol_8h.html#a8b4e71db8109af87f84ac1576e2b245d">UCollationResult</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#ad480e22ece781340466c767c5e4e69e8">compareTo</a> (const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;target, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convenience method which does a string(bit-wise) comparison of the two collation keys.  <a href="#ad480e22ece781340466c767c5e4e69e8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#afddfbfd2410925a1e6a8309bbcaad82d">hashCode</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates an integer that is unique to the collation key.  <a href="#afddfbfd2410925a1e6a8309bbcaad82d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#aec62adb6b1550b6ff6e18a97de9c725a">getDynamicClassID</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ICU "poor man's RTTI", returns a UClassID for the actual class.  <a href="#aec62adb6b1550b6ff6e18a97de9c725a"></a><br/></td></tr>
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#aa1a3652547245ea10c9d10d4746fc30e">getStaticClassID</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ICU "poor man's RTTI", returns a UClassID for this class.  <a href="#aa1a3652547245ea10c9d10d4746fc30e"></a><br/></td></tr>
<tr><td colspan="2"><h2>Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1918e53ed4bb8208fdd6df3ed4ec2548"></a><!-- doxytag: member="CollationKey::RuleBasedCollator" ref="a1918e53ed4bb8208fdd6df3ed4ec2548" args="" -->
class&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCollationKey.html#a1918e53ed4bb8208fdd6df3ed4ec2548">RuleBasedCollator</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allow private access to <a class="el" href="classRuleBasedCollator.html" title="The RuleBasedCollator class provides the simple implementation of Collator, using...">RuleBasedCollator</a>. <br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Collation keys are generated by the <a class="el" href="classCollator.html" title="The Collator class performs locale-sensitive string comparison.">Collator</a> class. </p>
<p>Use the <a class="el" href="classCollationKey.html" title="Collation keys are generated by the Collator class.">CollationKey</a> objects instead of <a class="el" href="classCollator.html" title="The Collator class performs locale-sensitive string comparison.">Collator</a> to compare strings multiple times. A <a class="el" href="classCollationKey.html" title="Collation keys are generated by the Collator class.">CollationKey</a> preprocesses the comparison information from the <a class="el" href="classCollator.html" title="The Collator class performs locale-sensitive string comparison.">Collator</a> object to make the comparison faster. If you are not going to comparing strings multiple times, then using the <a class="el" href="classCollator.html" title="The Collator class performs locale-sensitive string comparison.">Collator</a> object is generally faster, since it only processes as much of the string as needed to make a comparison. </p>
<p>For example (with strength == tertiary) </p>
<p>When comparing "Abernathy" to "Baggins-Smythworthy", <a class="el" href="classCollator.html" title="The Collator class performs locale-sensitive string comparison.">Collator</a> only needs to process a couple of characters, while a comparison with CollationKeys will process all of the characters. On the other hand, if you are doing a sort of a number of fields, it is much faster to use CollationKeys, since you will be comparing strings multiple times. </p>
<p>Typical use of CollationKeys are in databases, where you store a <a class="el" href="classCollationKey.html" title="Collation keys are generated by the Collator class.">CollationKey</a> in a hidden field, and use it for sorting or indexing.</p>
<p>Example of use: </p>
<pre>
 <div class="fragment"><pre class="fragment">     <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> success = <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78caa43dbfc9499c5f911d04e1a0ca3bf6f9" title="No error, no warning.">U_ZERO_ERROR</a>;
     <a class="code" href="classCollator.html" title="The Collator class performs locale-sensitive string comparison.">Collator</a>* myCollator = <a class="code" href="classCollator.html#a685bc906ba633d0d7653089d1f1a4dc5" title="Creates the Collator object for the current default locale.">Collator::createInstance</a>(success);
     <a class="code" href="classCollationKey.html" title="Collation keys are generated by the Collator class.">CollationKey</a>* keys = <span class="keyword">new</span> <a class="code" href="classCollationKey.html" title="Collation keys are generated by the Collator class.">CollationKey</a> [3];
     myCollator-&gt;<a class="code" href="classCollator.html#ab48ddb212e12b9ef4ffa7163e2d7810a" title="Transforms the string into a series of characters that can be compared with CollationKey::compareTo...">getCollationKey</a>(<span class="stringliteral">&quot;Tom&quot;</span>, keys[0], success );
     myCollator-&gt;<a class="code" href="classCollator.html#ab48ddb212e12b9ef4ffa7163e2d7810a" title="Transforms the string into a series of characters that can be compared with CollationKey::compareTo...">getCollationKey</a>(<span class="stringliteral">&quot;Dick&quot;</span>, keys[1], success );
     myCollator-&gt;<a class="code" href="classCollator.html#ab48ddb212e12b9ef4ffa7163e2d7810a" title="Transforms the string into a series of characters that can be compared with CollationKey::compareTo...">getCollationKey</a>(<span class="stringliteral">&quot;Harry&quot;</span>, keys[2], success );

     <span class="comment">// Inside body of sort routine, compare keys this way:</span>
     <a class="code" href="classCollationKey.html" title="Collation keys are generated by the Collator class.">CollationKey</a> tmp;
     <span class="keywordflow">if</span>(keys[0].<a class="code" href="classCollationKey.html#a175ce0d8cb5d392731a238e0de29cdda" title="Convenience method which does a string(bit-wise) comparison of the two collation...">compareTo</a>( keys[1] ) &gt; 0 ) {
         tmp = keys[0]; keys[0] = keys[1]; keys[1] = tmp;
     }
     <span class="comment">//...</span>
</pre></div>
 </pre> <p>Because <a class="el" href="classCollator.html#aca611b586fa47a756d2b29996f713182" title="The comparison function compares the character data stored in two different strings...">Collator::compare()</a>'s algorithm is complex, it is faster to sort long lists of words by retrieving collation keys with <a class="el" href="classCollator.html#ab48ddb212e12b9ef4ffa7163e2d7810a" title="Transforms the string into a series of characters that can be compared with CollationKey::compareTo...">Collator::getCollationKey()</a>. You can then cache the collation keys and compare them using <a class="el" href="classCollationKey.html#a175ce0d8cb5d392731a238e0de29cdda" title="Convenience method which does a string(bit-wise) comparison of the two collation...">CollationKey::compareTo()</a>. </p>
<p><b>Note:</b> <code><a class="el" href="classCollator.html" title="The Collator class performs locale-sensitive string comparison.">Collator</a></code>s with different <a class="el" href="classLocale.html" title="A Locale object represents a specific geographical, political, or cultural region...">Locale</a>, CollationStrength and DecompositionMode settings will return different CollationKeys for the same set of strings. Locales have specific collation rules, and the way in which secondary and tertiary differences are taken into account, for example, will result in different CollationKeys for same strings. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classCollator.html" title="The Collator class performs locale-sensitive string comparison.">Collator</a> </dd>
<dd>
<a class="el" href="classRuleBasedCollator.html" title="The RuleBasedCollator class provides the simple implementation of Collator, using...">RuleBasedCollator</a> </dd></dl>
<dl class="version"><dt><b>Version:</b></dt><dd>1.3 12/18/96 </dd></dl>
<dl class="author"><dt><b>Author:</b></dt><dd>Helena Shih </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000203">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

<p>Definition at line <a class="el" href="sortkey_8h_source.html#l00096">96</a> of file <a class="el" href="sortkey_8h_source.html">sortkey.h</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a236ce6b7d878eb6a0d5ee583eeb7f6db"></a><!-- doxytag: member="CollationKey::CollationKey" ref="a236ce6b7d878eb6a0d5ee583eeb7f6db" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CollationKey::CollationKey </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This creates an empty collation key based on the null string. </p>
<p>An empty collation key contains no sorting information. When comparing two empty collation keys, the result is Collator::EQUAL. Comparing empty collation key with non-empty collation key is always Collator::LESS. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000204">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

</div>
</div>
<a class="anchor" id="aec3b2c31ee34d6019991b24b7a975493"></a><!-- doxytag: member="CollationKey::CollationKey" ref="aec3b2c31ee34d6019991b24b7a975493" args="(const uint8_t *values, int32_t count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CollationKey::CollationKey </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&nbsp;</td>
          <td class="paramname"> <em>values</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&nbsp;</td>
          <td class="paramname"> <em>count</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a collation key based on the collation key values. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>values</em>&nbsp;</td><td>the collation key values </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>count</em>&nbsp;</td><td>number of collation key values, including trailing nulls. </td></tr>
  </table>
  </dd>
</dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000205">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

</div>
</div>
<a class="anchor" id="a62c797dd9568e240cdcdd3e0b8fb466b"></a><!-- doxytag: member="CollationKey::CollationKey" ref="a62c797dd9568e240cdcdd3e0b8fb466b" args="(const CollationKey &amp;other)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CollationKey::CollationKey </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>other</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Copy constructor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>other</em>&nbsp;</td><td>the object to be copied. </td></tr>
  </table>
  </dd>
</dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000206">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

</div>
</div>
<a class="anchor" id="a39b57d5e52b60506ad9a99242b19c1b2"></a><!-- doxytag: member="CollationKey::~CollationKey" ref="a39b57d5e52b60506ad9a99242b19c1b2" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual CollationKey::~CollationKey </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sort key destructor. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000207">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ad480e22ece781340466c767c5e4e69e8"></a><!-- doxytag: member="CollationKey::compareTo" ref="ad480e22ece781340466c767c5e4e69e8" args="(const CollationKey &amp;target, UErrorCode &amp;status) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="ucol_8h.html#a8b4e71db8109af87f84ac1576e2b245d">UCollationResult</a> CollationKey::compareTo </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>target</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Convenience method which does a string(bit-wise) comparison of the two collation keys. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>target</em>&nbsp;</td><td>target collation key to be compared with </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>error code </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns UCOL_LESS if sourceKey &lt; targetKey, UCOL_GREATER if sourceKey &gt; targetKey and UCOL_EQUAL otherwise. </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000214">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

</div>
</div>
<a class="anchor" id="a175ce0d8cb5d392731a238e0de29cdda"></a><!-- doxytag: member="CollationKey::compareTo" ref="a175ce0d8cb5d392731a238e0de29cdda" args="(const CollationKey &amp;target) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classCollator.html#a05f22f81363f2613bea18a632b67686f">Collator::EComparisonResult</a> CollationKey::compareTo </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>target</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Convenience method which does a string(bit-wise) comparison of the two collation keys. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>target</em>&nbsp;</td><td>target collation key to be compared with </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns Collator::LESS if sourceKey &lt; targetKey, Collator::GREATER if sourceKey &gt; targetKey and Collator::EQUAL otherwise. </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000213">Deprecated:</a></b></dt><dd>ICU 2.6 use the overload with error code </dd></dl>

</div>
</div>
<a class="anchor" id="aba4102f9d534cdf6c0ed52e1b5a7578e"></a><!-- doxytag: member="CollationKey::getByteArray" ref="aba4102f9d534cdf6c0ed52e1b5a7578e" args="(int32_t &amp;count) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const uint8_t * CollationKey::getByteArray </td>
          <td>(</td>
          <td class="paramtype">int32_t &amp;&nbsp;</td>
          <td class="paramname"> <em>count</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a pointer to the collation key values. </p>
<p>The storage is owned by the collation key and the pointer will become invalid if the key is deleted. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>count</em>&nbsp;</td><td>the output parameter of number of collation key values, including any trailing nulls. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a pointer to the collation key values. </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000212">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

<p>Definition at line <a class="el" href="sortkey_8h_source.html#l00314">314</a> of file <a class="el" href="sortkey_8h_source.html">sortkey.h</a>.</p>

</div>
</div>
<a class="anchor" id="aec62adb6b1550b6ff6e18a97de9c725a"></a><!-- doxytag: member="CollationKey::getDynamicClassID" ref="aec62adb6b1550b6ff6e18a97de9c725a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a> CollationKey::getDynamicClassID </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>ICU "poor man's RTTI", returns a UClassID for the actual class. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000216">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

<p>Implements <a class="el" href="classUObject.html#a9b1acc95efd89cb86ec31f2dc947a262">UObject</a>.</p>

</div>
</div>
<a class="anchor" id="aa1a3652547245ea10c9d10d4746fc30e"></a><!-- doxytag: member="CollationKey::getStaticClassID" ref="aa1a3652547245ea10c9d10d4746fc30e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a> CollationKey::getStaticClassID </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>ICU "poor man's RTTI", returns a UClassID for this class. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000217">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

</div>
</div>
<a class="anchor" id="afddfbfd2410925a1e6a8309bbcaad82d"></a><!-- doxytag: member="CollationKey::hashCode" ref="afddfbfd2410925a1e6a8309bbcaad82d" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t CollationKey::hashCode </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates an integer that is unique to the collation key. </p>
<p>NOTE: this is not the same as String.hashCode. </p>
<p>Example of use: </p>
<pre>
 .    UErrorCode status = U_ZERO_ERROR;
 .    <a class="el" href="classCollator.html" title="The Collator class performs locale-sensitive string comparison.">Collator</a> *myCollation = Collator::createInstance(Locale::US, status);
 .    if (<a class="el" href="utypes_8h.html#a4d202200b6aa6f3c965ea370e0c8155f" title="Does the error code indicate a failure?">U_FAILURE(status)</a>) return;
 .    <a class="el" href="classCollationKey.html" title="Collation keys are generated by the Collator class.">CollationKey</a> key1, key2;
 .    UErrorCode status1 = U_ZERO_ERROR, status2 = U_ZERO_ERROR;
 .    myCollation-&gt;getCollationKey("abc", key1, status1);
 .    if (<a class="el" href="utypes_8h.html#a4d202200b6aa6f3c965ea370e0c8155f" title="Does the error code indicate a failure?">U_FAILURE(status1)</a>) { delete myCollation; return; }
 .    myCollation-&gt;getCollationKey("ABC", key2, status2);
 .    if (<a class="el" href="utypes_8h.html#a4d202200b6aa6f3c965ea370e0c8155f" title="Does the error code indicate a failure?">U_FAILURE(status2)</a>) { delete myCollation; return; }
 .    // key1.hashCode() != key2.hashCode()
 </pre> <dl class="return"><dt><b>Returns:</b></dt><dd>the hash value based on the string's collation order. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classUnicodeString.html#a6724ae76d51cf802ded394eaedd7b3fd" title="Generate a hash code for this object.">UnicodeString::hashCode</a> </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000215">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

</div>
</div>
<a class="anchor" id="a2b5cbecf80d0c583ec608eb88628f4bd"></a><!-- doxytag: member="CollationKey::isBogus" ref="a2b5cbecf80d0c583ec608eb88628f4bd" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> CollationKey::isBogus </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Test to see if the key is in an invalid state. </p>
<p>The key will be in an invalid state if it couldn't allocate memory for some operation. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns TRUE if the key is in an invalid, FALSE otherwise. </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000211">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

<p>Definition at line <a class="el" href="sortkey_8h_source.html#l00308">308</a> of file <a class="el" href="sortkey_8h_source.html">sortkey.h</a>.</p>

</div>
</div>
<a class="anchor" id="a85bb52c50f3baf2aad76282f719d6193"></a><!-- doxytag: member="CollationKey::operator!=" ref="a85bb52c50f3baf2aad76282f719d6193" args="(const CollationKey &amp;source) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> CollationKey::operator!= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>source</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Compare if two collation keys are not the same. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>source</em>&nbsp;</td><td>the collation key to compare to. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns TRUE if two collation keys are different, FALSE otherwise. </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000210">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

<p>Definition at line <a class="el" href="sortkey_8h_source.html#l00302">302</a> of file <a class="el" href="sortkey_8h_source.html">sortkey.h</a>.</p>

</div>
</div>
<a class="anchor" id="a38541209bbf6084770d4973ed6cada18"></a><!-- doxytag: member="CollationKey::operator=" ref="a38541209bbf6084770d4973ed6cada18" args="(const CollationKey &amp;other)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classCollationKey.html">CollationKey</a>&amp; CollationKey::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>other</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Assignment operator. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>other</em>&nbsp;</td><td>the object to be copied. </td></tr>
  </table>
  </dd>
</dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000208">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

</div>
</div>
<a class="anchor" id="a26887fbeff16532382794b91faebaae4"></a><!-- doxytag: member="CollationKey::operator==" ref="a26887fbeff16532382794b91faebaae4" args="(const CollationKey &amp;source) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> CollationKey::operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classCollationKey.html">CollationKey</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>source</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Compare if two collation keys are the same. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>source</em>&nbsp;</td><td>the collation key to compare to. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns true if two collation keys are equal, false otherwise. </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000209">Deprecated:</a></b></dt><dd>ICU 2.8 Use <a class="el" href="classCollator.html#ae524fd43a06d4429e2c76bef35874d4c" title="Get the sort key as an array of bytes from an UnicodeString.">Collator::getSortKey</a>(...) instead </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="sortkey_8h_source.html">sortkey.h</a></li>
</ul>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr size="1"/><address style="text-align: right;"><small>Generated on 16 Mar 2010 for ICU 4.4 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>