Source

cappuccino-docs / cappuccino docs / cappuccino.org / learn / documentation / class_c_p_sort_descriptor.html

Full commit
<!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">

<!-- Mirrored from cappuccino.org/learn/documentation/class_c_p_sort_descriptor.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:18:06 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Cappuccino API: CPSortDescriptor Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.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>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>CPSortDescriptor Class Reference<br/>
<small>
[<a class="el" href="group__foundation.html">Foundation</a>]</small>
</h1><!-- doxytag: class="CPSortDescriptor" -->
<p>Holds attributes necessary to describe how to sort a set of objects.  
<a href="#_details">More...</a></p>

<p><a href="class_c_p_sort_descriptor-members.html">List of all members.</a></p>
<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">(BOOL)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_sort_descriptor.html#ab236d22719ace27e1476301220f02226">ascending</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(CPComparisonResult)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_sort_descriptor.html#a6b03a04c4a0ce1959e733421b1ad392c">compareObject:withObject:</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_sort_descriptor.html#a484c8ebff65b940ff477db7ddd98c1b0">initWithKey:ascending:</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_sort_descriptor.html#a657e116e03b1d4195820f6abfe46d925">initWithKey:ascending:selector:</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(<a class="el" href="class_c_p_string.html">CPString</a>)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_sort_descriptor.html#a54769acc58a12777ddb80ba17c67d93f">key</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_sort_descriptor.html#a4f2889e5494de6990cbdf8d4bebc6f0f">reversedSortDescriptor</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(SEL)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_sort_descriptor.html#ae5d1e8d0fd7d361ef705fe591e43e6a5">selector</a><code> [implementation]</code></td></tr>
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id)&nbsp;</td><td class="memItemRight" valign="bottom">+ <a class="el" href="class_c_p_sort_descriptor.html#a32486120fb8a3508edf57d2371071459">sortDescriptorWithKey:ascending:</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id)&nbsp;</td><td class="memItemRight" valign="bottom">+ <a class="el" href="class_c_p_sort_descriptor.html#aa441a4b222ca513759bf23200df417c3">sortDescriptorWithKey:ascending:selector:</a><code> [implementation]</code></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Holds attributes necessary to describe how to sort a set of objects. </p>
<p>A <a class="el" href="class_c_p_sort_descriptor.html" title="Holds attributes necessary to describe how to sort a set of objects.">CPSortDescriptor</a> holds the attributes necessary to describe how to sort a set of objects. The sort descriptor instance holds a property key path to the sort item of the objects to compare, the method selector to call for sorting and the sort order. </p>

<p>Definition at line <a class="el" href="_c_p_sort_descriptor_8j_source.html#l00055">55</a> of file <a class="el" href="_c_p_sort_descriptor_8j_source.html">CPSortDescriptor.j</a>.</p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ab236d22719ace27e1476301220f02226"></a><!-- doxytag: member="CPSortDescriptor::ascending" ref="ab236d22719ace27e1476301220f02226" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (BOOL) ascending </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns <code>YES</code> if the sort descriptor's order is ascending. </p>

<p>Definition at line <a class="el" href="_c_p_sort_descriptor_8j_source.html#l00109">109</a> of file <a class="el" href="_c_p_sort_descriptor_8j_source.html">CPSortDescriptor.j</a>.</p>

</div>
</div>
<a class="anchor" id="a6b03a04c4a0ce1959e733421b1ad392c"></a><!-- doxytag: member="CPSortDescriptor::compareObject:withObject:" ref="a6b03a04c4a0ce1959e733421b1ad392c" args="(id lhsObject,[withObject] id rhsObject)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (CPComparisonResult) compareObject: </td>
          <td></td>
          <td class="paramtype">(id)&nbsp;</td>
          <td class="paramname"> <em>lhsObject</em></td>
        </tr>
        <tr>
          <td class="paramkey">withObject:</td>
          <td></td>
          <td class="paramtype">(id)&nbsp;</td>
          <td class="paramname"> <em>rhsObject</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td></td><td></td><td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Compares two objects. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>lhsObject</em>&nbsp;</td><td>the left hand side object to compre </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>rhsObject</em>&nbsp;</td><td>the right hand side object to compare </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the comparison result </dd></dl>

<p>Definition at line <a class="el" href="_c_p_sort_descriptor_8j_source.html#l00137">137</a> of file <a class="el" href="_c_p_sort_descriptor_8j_source.html">CPSortDescriptor.j</a>.</p>

</div>
</div>
<a class="anchor" id="a484c8ebff65b940ff477db7ddd98c1b0"></a><!-- doxytag: member="CPSortDescriptor::initWithKey:ascending:" ref="a484c8ebff65b940ff477db7ddd98c1b0" args="(CPString aKey,[ascending] BOOL isAscending)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (id) initWithKey: </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="class_c_p_string.html">CPString</a>)&nbsp;</td>
          <td class="paramname"> <em>aKey</em></td>
        </tr>
        <tr>
          <td class="paramkey">ascending:</td>
          <td></td>
          <td class="paramtype">(BOOL)&nbsp;</td>
          <td class="paramname"> <em>isAscending</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td></td><td></td><td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Initializes the sort descriptor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>aKey</em>&nbsp;</td><td>the property key path to sort </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>isAscending</em>&nbsp;</td><td>the sort order </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the initialized sort descriptor </dd></dl>

<p>Definition at line <a class="el" href="_c_p_sort_descriptor_8j_source.html#l00074">74</a> of file <a class="el" href="_c_p_sort_descriptor_8j_source.html">CPSortDescriptor.j</a>.</p>

</div>
</div>
<a class="anchor" id="a657e116e03b1d4195820f6abfe46d925"></a><!-- doxytag: member="CPSortDescriptor::initWithKey:ascending:selector:" ref="a657e116e03b1d4195820f6abfe46d925" args="(CPString aKey,[ascending] BOOL isAscending,[selector] SEL aSelector)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (id) initWithKey: </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="class_c_p_string.html">CPString</a>)&nbsp;</td>
          <td class="paramname"> <em>aKey</em></td>
        </tr>
        <tr>
          <td class="paramkey">ascending:</td>
          <td></td>
          <td class="paramtype">(BOOL)&nbsp;</td>
          <td class="paramname"> <em>isAscending</em></td>
        </tr>
        <tr>
          <td class="paramkey">selector:</td>
          <td></td>
          <td class="paramtype">(SEL)&nbsp;</td>
          <td class="paramname"> <em>aSelector</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td></td><td></td><td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Initializes the sort descriptor </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>aKey</em>&nbsp;</td><td>the property key path to sort </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>isAscending</em>&nbsp;</td><td>the sort order </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>aSelector</em>&nbsp;</td><td>this method gets called to compare objects. The method will take one argument (the object to compare against itself, and must return a CPComparisonResult. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_c_p_sort_descriptor_8j_source.html#l00091">91</a> of file <a class="el" href="_c_p_sort_descriptor_8j_source.html">CPSortDescriptor.j</a>.</p>

</div>
</div>
<a class="anchor" id="a54769acc58a12777ddb80ba17c67d93f"></a><!-- doxytag: member="CPSortDescriptor::key" ref="a54769acc58a12777ddb80ba17c67d93f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (<a class="el" href="class_c_p_string.html">CPString</a>) key </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the descriptor's property key </p>

<p>Definition at line <a class="el" href="_c_p_sort_descriptor_8j_source.html#l00117">117</a> of file <a class="el" href="_c_p_sort_descriptor_8j_source.html">CPSortDescriptor.j</a>.</p>

</div>
</div>
<a class="anchor" id="a4f2889e5494de6990cbdf8d4bebc6f0f"></a><!-- doxytag: member="CPSortDescriptor::reversedSortDescriptor" ref="a4f2889e5494de6990cbdf8d4bebc6f0f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (id) reversedSortDescriptor </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Makes a copy of this sort descriptor with a reversed sort order. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the reversed copy of the sort descriptor </dd></dl>

<p>Definition at line <a class="el" href="_c_p_sort_descriptor_8j_source.html#l00146">146</a> of file <a class="el" href="_c_p_sort_descriptor_8j_source.html">CPSortDescriptor.j</a>.</p>

</div>
</div>
<a class="anchor" id="ae5d1e8d0fd7d361ef705fe591e43e6a5"></a><!-- doxytag: member="CPSortDescriptor::selector" ref="ae5d1e8d0fd7d361ef705fe591e43e6a5" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (SEL) selector </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the selector of the method to call when comparing objects. </p>

<p>Definition at line <a class="el" href="_c_p_sort_descriptor_8j_source.html#l00125">125</a> of file <a class="el" href="_c_p_sort_descriptor_8j_source.html">CPSortDescriptor.j</a>.</p>

</div>
</div>
<a class="anchor" id="a32486120fb8a3508edf57d2371071459"></a><!-- doxytag: member="CPSortDescriptor::sortDescriptorWithKey:ascending:" ref="a32486120fb8a3508edf57d2371071459" args="(CPString aKey,[ascending] BOOL isAscending)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">+ (id) sortDescriptorWithKey: </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="class_c_p_string.html">CPString</a>)&nbsp;</td>
          <td class="paramname"> <em>aKey</em></td>
        </tr>
        <tr>
          <td class="paramkey">ascending:</td>
          <td></td>
          <td class="paramtype">(BOOL)&nbsp;</td>
          <td class="paramname"> <em>isAscending</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td></td><td></td><td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_c_p_sort_descriptor_8j_source.html#l00062">62</a> of file <a class="el" href="_c_p_sort_descriptor_8j_source.html">CPSortDescriptor.j</a>.</p>

</div>
</div>
<a class="anchor" id="aa441a4b222ca513759bf23200df417c3"></a><!-- doxytag: member="CPSortDescriptor::sortDescriptorWithKey:ascending:selector:" ref="aa441a4b222ca513759bf23200df417c3" args="(CPString aKey,[ascending] BOOL isAscending,[selector] SEL aSelector)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">+ (id) sortDescriptorWithKey: </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="class_c_p_string.html">CPString</a>)&nbsp;</td>
          <td class="paramname"> <em>aKey</em></td>
        </tr>
        <tr>
          <td class="paramkey">ascending:</td>
          <td></td>
          <td class="paramtype">(BOOL)&nbsp;</td>
          <td class="paramname"> <em>isAscending</em></td>
        </tr>
        <tr>
          <td class="paramkey">selector:</td>
          <td></td>
          <td class="paramtype">(SEL)&nbsp;</td>
          <td class="paramname"> <em>aSelector</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td></td><td></td><td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_c_p_sort_descriptor_8j_source.html#l00079">79</a> of file <a class="el" href="_c_p_sort_descriptor_8j_source.html">CPSortDescriptor.j</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>Foundation/<a class="el" href="_c_p_sort_descriptor_8j_source.html">CPSortDescriptor.j</a></li>
</ul>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Apr 6 10:33:07 2010 for Cappuccino API 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>

<!-- Mirrored from cappuccino.org/learn/documentation/class_c_p_sort_descriptor.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:18:07 GMT -->
</html>