doc/TaskJuggler/PropertyList.html in taskjuggler-0.0.5 vs doc/TaskJuggler/PropertyList.html in taskjuggler-0.0.6

- old
+ new

@@ -67,35 +67,35 @@ <div id="method-list-section" class="section"> <h3 class="section-header">Methods</h3> <ul class="link-list"> - <li><a href="#M001084">::new</a></li> + <li><a href="#method-c-new">::new</a></li> - <li><a href="#M001090">#addSortingCriteria</a></li> + <li><a href="#method-i-addSortingCriteria">#addSortingCriteria</a></li> - <li><a href="#M001089">#append</a></li> + <li><a href="#method-i-append">#append</a></li> - <li><a href="#M001094">#index</a></li> + <li><a href="#method-i-index">#index</a></li> - <li><a href="#M001096">#indexTree</a></li> + <li><a href="#method-i-indexTree">#indexTree</a></li> - <li><a href="#M001093">#itemIndex</a></li> + <li><a href="#method-i-itemIndex">#itemIndex</a></li> - <li><a href="#M001085">#method_missing</a></li> + <li><a href="#method-i-method_missing">#method_missing</a></li> - <li><a href="#M001088">#resetSorting</a></li> + <li><a href="#method-i-resetSorting">#resetSorting</a></li> - <li><a href="#M001087">#setSorting</a></li> + <li><a href="#method-i-setSorting">#setSorting</a></li> - <li><a href="#M001092">#sort!</a></li> + <li><a href="#method-i-sort%21">#sort!</a></li> - <li><a href="#M001097">#sortInternal</a></li> + <li><a href="#method-i-sortInternal">#sortInternal</a></li> - <li><a href="#M001086">#to_ary</a></li> + <li><a href="#method-i-to_ary">#to_ary</a></li> - <li><a href="#M001091">#treeMode?</a></li> + <li><a href="#method-i-treeMode%3F">#treeMode?</a></li> </ul> </div> @@ -108,10 +108,12 @@ <div id="fileindex-section" class="section project-section"> <h3 class="section-header">Files</h3> <ul> + <li class="file"><a href="../CHANGELOG.html">CHANGELOG</a></li> + <li class="file"><a href="../COPYING.html">COPYING</a></li> <li class="file"><a href="../README.html">README</a></li> </ul> @@ -277,10 +279,12 @@ <li><a href="../TaskJuggler/NikuReport.html">TaskJuggler::NikuReport</a></li> <li><a href="../TaskJuggler/NikuResource.html">TaskJuggler::NikuResource</a></li> + <li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li> + <li><a href="../TaskJuggler/OnShiftCache.html">TaskJuggler::OnShiftCache</a></li> <li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li> <li><a href="../TaskJuggler/ProcessIntercomIface.html">TaskJuggler::ProcessIntercomIface</a></li> @@ -291,10 +295,12 @@ <li><a href="../TaskJuggler/ProjectBrokerIface.html">TaskJuggler::ProjectBrokerIface</a></li> <li><a href="../TaskJuggler/ProjectFileParser.html">TaskJuggler::ProjectFileParser</a></li> + <li><a href="../TaskJuggler/ProjectFileScanner.html">TaskJuggler::ProjectFileScanner</a></li> + <li><a href="../TaskJuggler/ProjectRecord.html">TaskJuggler::ProjectRecord</a></li> <li><a href="../TaskJuggler/ProjectServer.html">TaskJuggler::ProjectServer</a></li> <li><a href="../TaskJuggler/ProjectServerIface.html">TaskJuggler::ProjectServerIface</a></li> @@ -307,16 +313,20 @@ <li><a href="../TaskJuggler/PropertyTreeNode.html">TaskJuggler::PropertyTreeNode</a></li> <li><a href="../TaskJuggler/Query.html">TaskJuggler::Query</a></li> + <li><a href="../TaskJuggler/RTFHandlers.html">TaskJuggler::RTFHandlers</a></li> + <li><a href="../TaskJuggler/RTFNavigator.html">TaskJuggler::RTFNavigator</a></li> <li><a href="../TaskJuggler/RTFQuery.html">TaskJuggler::RTFQuery</a></li> <li><a href="../TaskJuggler/RTFReport.html">TaskJuggler::RTFReport</a></li> + <li><a href="../TaskJuggler/RTFReportLink.html">TaskJuggler::RTFReportLink</a></li> + <li><a href="../TaskJuggler/RealFormat.html">TaskJuggler::RealFormat</a></li> <li><a href="../TaskJuggler/RealFormatAttribute.html">TaskJuggler::RealFormatAttribute</a></li> <li><a href="../TaskJuggler/ReferenceAttribute.html">TaskJuggler::ReferenceAttribute</a></li> @@ -331,10 +341,12 @@ <li><a href="../TaskJuggler/ReportServerIface.html">TaskJuggler::ReportServerIface</a></li> <li><a href="../TaskJuggler/ReportServerRecord.html">TaskJuggler::ReportServerRecord</a></li> + <li><a href="../TaskJuggler/ReportServlet.html">TaskJuggler::ReportServlet</a></li> + <li><a href="../TaskJuggler/ReportTable.html">TaskJuggler::ReportTable</a></li> <li><a href="../TaskJuggler/ReportTableCell.html">TaskJuggler::ReportTableCell</a></li> <li><a href="../TaskJuggler/ReportTableColumn.html">TaskJuggler::ReportTableColumn</a></li> @@ -459,10 +471,12 @@ <li><a href="../TaskJuggler/TextScanner/BufferStreamHandle.html">TaskJuggler::TextScanner::BufferStreamHandle</a></li> <li><a href="../TaskJuggler/TextScanner/FileStreamHandle.html">TaskJuggler::TextScanner::FileStreamHandle</a></li> + <li><a href="../TaskJuggler/TextScanner/MacroStackEntry.html">TaskJuggler::TextScanner::MacroStackEntry</a></li> + <li><a href="../TaskJuggler/TextScanner/StreamHandle.html">TaskJuggler::TextScanner::StreamHandle</a></li> <li><a href="../TaskJuggler/TimeSheet.html">TaskJuggler::TimeSheet</a></li> <li><a href="../TaskJuggler/TimeSheetReceiver.html">TaskJuggler::TimeSheetReceiver</a></li> @@ -503,12 +517,16 @@ <li><a href="../TaskJuggler/TjpExportRE.html">TaskJuggler::TjpExportRE</a></li> <li><a href="../TaskJuggler/TjpSyntaxRules.html">TaskJuggler::TjpSyntaxRules</a></li> + <li><a href="../TaskJuggler/URLParameter.html">TaskJuggler::URLParameter</a></li> + <li><a href="../TaskJuggler/UserManual.html">TaskJuggler::UserManual</a></li> + <li><a href="../TaskJuggler/WebServer.html">TaskJuggler::WebServer</a></li> + <li><a href="../TaskJuggler/WorkingHours.html">TaskJuggler::WorkingHours</a></li> <li><a href="../TaskJuggler/WorkingHoursAttribute.html">TaskJuggler::WorkingHoursAttribute</a></li> <li><a href="../TaskJuggler/XMLBlob.html">TaskJuggler::XMLBlob</a></li> @@ -531,10 +549,12 @@ <li><a href="../RuntimeConfig.html">RuntimeConfig</a></li> <li><a href="../String.html">String</a></li> + <li><a href="../StringIO.html">StringIO</a></li> + </ul> <div id="no-class-search-results" style="display: none;">No matching classes.</div> </div> @@ -682,11 +702,11 @@ <div id="public-class-method-details" class="method-section section"> <h3 class="section-header">Public Class Methods</h3> <div id="new-method" class="method-detail "> - <a name="M001084"></a> + <a name="method-c-new"></a> <div class="method-heading"> <span class="method-name">new</span><span class="method-args">(arg, copyItems = true)</span> @@ -747,11 +767,11 @@ <div id="public-instance-method-details" class="method-section section"> <h3 class="section-header">Public Instance Methods</h3> <div id="add-orting-riteria-method" class="method-detail "> - <a name="M001090"></a> + <a name="method-i-addSortingCriteria"></a> <div class="method-heading"> <span class="method-name">addSortingCriteria</span><span class="method-args">(criteria, up, scIdx)</span> @@ -785,18 +805,19 @@ 109: <span class="ruby-keyword kw">else</span> 110: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@propertySet</span>.<span class="ruby-identifier">project</span>.<span class="ruby-identifier">scenario</span>(<span class="ruby-identifier">scIdx</span>).<span class="ruby-identifier">nil?</span> 111: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-node">&quot;Unknown scenario index #{scIdx} used.&quot;</span> 112: <span class="ruby-keyword kw">end</span> 113: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@propertySet</span>.<span class="ruby-identifier">scenarioSpecific?</span>(<span class="ruby-identifier">criteria</span>) -114: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-node">&quot;Attribute #{criteria} is not scenario specific&quot;</span> -115: <span class="ruby-keyword kw">end</span> -116: <span class="ruby-keyword kw">end</span> -117: <span class="ruby-ivar">@sortingCriteria</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">criteria</span>) -118: <span class="ruby-ivar">@sortingUp</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">up</span>) -119: <span class="ruby-ivar">@scenarioIdx</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">scIdx</span>) -120: <span class="ruby-ivar">@sortingLevels</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> -121: <span class="ruby-keyword kw">end</span></pre> +114: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-node">&quot;Attribute #{criteria} is not scenario &quot;</span> <span class="ruby-operator">+</span> +115: <span class="ruby-value str">&quot;specific&quot;</span> +116: <span class="ruby-keyword kw">end</span> +117: <span class="ruby-keyword kw">end</span> +118: <span class="ruby-ivar">@sortingCriteria</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">criteria</span>) +119: <span class="ruby-ivar">@sortingUp</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">up</span>) +120: <span class="ruby-ivar">@scenarioIdx</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">scIdx</span>) +121: <span class="ruby-ivar">@sortingLevels</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> +122: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -804,11 +825,11 @@ </div> <div id="append-method" class="method-detail "> - <a name="M001089"></a> + <a name="method-i-append"></a> <div class="method-heading"> <span class="method-name">append</span><span class="method-args">(list)</span> @@ -851,11 +872,11 @@ </div> <div id="index-method" class="method-detail "> - <a name="M001094"></a> + <a name="method-i-index"></a> <div class="method-heading"> <span class="method-name">index</span><span class="method-args">()</span> @@ -873,17 +894,17 @@ <div class="method-source-code" id="index-source"> <pre> - <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 172</span> -172: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index</span> -173: <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span> -174: <span class="ruby-ivar">@items</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> -175: <span class="ruby-identifier">p</span>.<span class="ruby-identifier">set</span>(<span class="ruby-value str">'index'</span>, <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>) -176: <span class="ruby-keyword kw">end</span> -177: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 173</span> +173: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index</span> +174: <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span> +175: <span class="ruby-ivar">@items</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> +176: <span class="ruby-identifier">p</span>.<span class="ruby-identifier">set</span>(<span class="ruby-value str">'index'</span>, <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>) +177: <span class="ruby-keyword kw">end</span> +178: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -891,11 +912,11 @@ </div> <div id="item-ndex-method" class="method-detail "> - <a name="M001093"></a> + <a name="method-i-itemIndex"></a> <div class="method-heading"> <span class="method-name">itemIndex</span><span class="method-args">(item)</span> @@ -912,14 +933,14 @@ <div class="method-source-code" id="item-ndex-source"> <pre> - <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 166</span> -166: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">itemIndex</span>(<span class="ruby-identifier">item</span>) -167: <span class="ruby-ivar">@items</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">item</span>) -168: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 167</span> +167: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">itemIndex</span>(<span class="ruby-identifier">item</span>) +168: <span class="ruby-ivar">@items</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">item</span>) +169: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -927,11 +948,11 @@ </div> <div id="method-missing-method" class="method-detail "> - <a name="M001085"></a> + <a name="method-i-method_missing"></a> <div class="method-heading"> <span class="method-name">method_missing</span><span class="method-args">(func, *args, &block)</span> @@ -965,11 +986,11 @@ </div> <div id="reset-orting-method" class="method-detail "> - <a name="M001088"></a> + <a name="method-i-resetSorting"></a> <div class="method-heading"> <span class="method-name">resetSorting</span><span class="method-args">()</span> @@ -1004,11 +1025,11 @@ </div> <div id="set-orting-method" class="method-detail "> - <a name="M001087"></a> + <a name="method-i-setSorting"></a> <div class="method-heading"> <span class="method-name">setSorting</span><span class="method-args">(modes)</span> @@ -1043,11 +1064,11 @@ </div> <div id="sort--method" class="method-detail "> - <a name="M001092"></a> + <a name="method-i-sort%21"></a> <div class="method-heading"> <span class="method-name">sort!</span><span class="method-args">()</span> @@ -1064,44 +1085,44 @@ <div class="method-source-code" id="sort--source"> <pre> - <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 131</span> -131: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sort!</span> -132: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">treeMode?</span> -133: <span class="ruby-comment cmt"># Tree sorting is somewhat complex. It will be based on the 'tree'</span> -134: <span class="ruby-comment cmt"># attribute of the PropertyTreeNodes but we have to update them first</span> -135: <span class="ruby-comment cmt"># based on the other sorting criteria.</span> -136: -137: <span class="ruby-comment cmt"># Remove the tree sorting mode first.</span> -138: <span class="ruby-identifier">sc</span> = <span class="ruby-ivar">@sortingCriteria</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-value">0</span>) -139: <span class="ruby-identifier">su</span> = <span class="ruby-ivar">@sortingUp</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-value">0</span>) -140: <span class="ruby-identifier">si</span> = <span class="ruby-ivar">@scenarioIdx</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-value">0</span>) -141: <span class="ruby-ivar">@sortingLevels</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> -142: -143: <span class="ruby-comment cmt"># Sort the list based on the rest of the modes.</span> -144: <span class="ruby-identifier">sortInternal</span> -145: <span class="ruby-comment cmt"># The update the 'index' attributes of the PropertyTreeNodes.</span> -146: <span class="ruby-identifier">index</span> -147: <span class="ruby-comment cmt"># An then the 'tree' attributes.</span> -148: <span class="ruby-identifier">indexTree</span> -149: -150: <span class="ruby-comment cmt"># Restore the 'tree' sorting mode again.</span> -151: <span class="ruby-ivar">@sortingCriteria</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">sc</span>) -152: <span class="ruby-ivar">@sortingUp</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">su</span>) -153: <span class="ruby-ivar">@scenarioIdx</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">si</span>) -154: <span class="ruby-ivar">@sortingLevels</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> -155: -156: <span class="ruby-comment cmt"># Sort again, now based on the updated 'tree' attributes.</span> -157: <span class="ruby-identifier">sortInternal</span> -158: <span class="ruby-keyword kw">else</span> -159: <span class="ruby-identifier">sortInternal</span> -160: <span class="ruby-keyword kw">end</span> -161: <span class="ruby-comment cmt"># Update indexes.</span> -162: <span class="ruby-identifier">index</span> -163: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 132</span> +132: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sort!</span> +133: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">treeMode?</span> +134: <span class="ruby-comment cmt"># Tree sorting is somewhat complex. It will be based on the 'tree'</span> +135: <span class="ruby-comment cmt"># attribute of the PropertyTreeNodes but we have to update them first</span> +136: <span class="ruby-comment cmt"># based on the other sorting criteria.</span> +137: +138: <span class="ruby-comment cmt"># Remove the tree sorting mode first.</span> +139: <span class="ruby-identifier">sc</span> = <span class="ruby-ivar">@sortingCriteria</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-value">0</span>) +140: <span class="ruby-identifier">su</span> = <span class="ruby-ivar">@sortingUp</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-value">0</span>) +141: <span class="ruby-identifier">si</span> = <span class="ruby-ivar">@scenarioIdx</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-value">0</span>) +142: <span class="ruby-ivar">@sortingLevels</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> +143: +144: <span class="ruby-comment cmt"># Sort the list based on the rest of the modes.</span> +145: <span class="ruby-identifier">sortInternal</span> +146: <span class="ruby-comment cmt"># The update the 'index' attributes of the PropertyTreeNodes.</span> +147: <span class="ruby-identifier">index</span> +148: <span class="ruby-comment cmt"># An then the 'tree' attributes.</span> +149: <span class="ruby-identifier">indexTree</span> +150: +151: <span class="ruby-comment cmt"># Restore the 'tree' sorting mode again.</span> +152: <span class="ruby-ivar">@sortingCriteria</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">sc</span>) +153: <span class="ruby-ivar">@sortingUp</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">su</span>) +154: <span class="ruby-ivar">@scenarioIdx</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">si</span>) +155: <span class="ruby-ivar">@sortingLevels</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> +156: +157: <span class="ruby-comment cmt"># Sort again, now based on the updated 'tree' attributes.</span> +158: <span class="ruby-identifier">sortInternal</span> +159: <span class="ruby-keyword kw">else</span> +160: <span class="ruby-identifier">sortInternal</span> +161: <span class="ruby-keyword kw">end</span> +162: <span class="ruby-comment cmt"># Update indexes.</span> +163: <span class="ruby-identifier">index</span> +164: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -1109,11 +1130,11 @@ </div> <div id="to-ary-method" class="method-detail "> - <a name="M001086"></a> + <a name="method-i-to_ary"></a> <div class="method-heading"> <span class="method-name">to_ary</span><span class="method-args">()</span> @@ -1143,11 +1164,11 @@ </div> <div id="tree-ode--method" class="method-detail "> - <a name="M001091"></a> + <a name="method-i-treeMode%3F"></a> <div class="method-heading"> <span class="method-name">treeMode?</span><span class="method-args">()</span> @@ -1166,14 +1187,14 @@ <div class="method-source-code" id="tree-ode--source"> <pre> - <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 126</span> -126: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">treeMode?</span> -127: <span class="ruby-ivar">@sortingLevels</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'tree'</span> -128: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 127</span> +127: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">treeMode?</span> +128: <span class="ruby-ivar">@sortingLevels</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'tree'</span> +129: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -1187,11 +1208,11 @@ <div id="private-instance-method-details" class="method-section section"> <h3 class="section-header">Private Instance Methods</h3> <div id="index-ree-method" class="method-detail "> - <a name="M001096"></a> + <a name="method-i-indexTree"></a> <div class="method-heading"> <span class="method-name">indexTree</span><span class="method-args">()</span> @@ -1209,27 +1230,27 @@ <div class="method-source-code" id="index-ree-source"> <pre> - <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 194</span> -194: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">indexTree</span> -195: <span class="ruby-ivar">@items</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">property</span><span class="ruby-operator">|</span> -196: <span class="ruby-comment cmt"># The indicies are an Array if the 'index' attributes for this</span> -197: <span class="ruby-comment cmt"># property and all its parents.</span> -198: <span class="ruby-identifier">treeIdcs</span> = <span class="ruby-identifier">property</span>.<span class="ruby-identifier">getIndicies</span> -199: <span class="ruby-comment cmt"># Now convert them to a String.</span> -200: <span class="ruby-identifier">tree</span> = <span class="ruby-value str">''</span> -201: <span class="ruby-identifier">treeIdcs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">idx</span><span class="ruby-operator">|</span> -202: <span class="ruby-comment cmt"># Prefix the level index with zeros so that we always have a 6</span> -203: <span class="ruby-comment cmt"># digit long String. 6 digits should be large enough for all</span> -204: <span class="ruby-comment cmt"># real-world projects.</span> -205: <span class="ruby-identifier">tree</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">idx</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">rjust</span>(<span class="ruby-value">6</span>, <span class="ruby-value str">'0'</span>) -206: <span class="ruby-keyword kw">end</span> -207: <span class="ruby-identifier">property</span>.<span class="ruby-identifier">set</span>(<span class="ruby-value str">'tree'</span>, <span class="ruby-identifier">tree</span>) -208: <span class="ruby-keyword kw">end</span> -209: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 195</span> +195: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">indexTree</span> +196: <span class="ruby-ivar">@items</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">property</span><span class="ruby-operator">|</span> +197: <span class="ruby-comment cmt"># The indicies are an Array if the 'index' attributes for this</span> +198: <span class="ruby-comment cmt"># property and all its parents.</span> +199: <span class="ruby-identifier">treeIdcs</span> = <span class="ruby-identifier">property</span>.<span class="ruby-identifier">getIndicies</span> +200: <span class="ruby-comment cmt"># Now convert them to a String.</span> +201: <span class="ruby-identifier">tree</span> = <span class="ruby-value str">''</span> +202: <span class="ruby-identifier">treeIdcs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">idx</span><span class="ruby-operator">|</span> +203: <span class="ruby-comment cmt"># Prefix the level index with zeros so that we always have a 6</span> +204: <span class="ruby-comment cmt"># digit long String. 6 digits should be large enough for all</span> +205: <span class="ruby-comment cmt"># real-world projects.</span> +206: <span class="ruby-identifier">tree</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">idx</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">rjust</span>(<span class="ruby-value">6</span>, <span class="ruby-value str">'0'</span>) +207: <span class="ruby-keyword kw">end</span> +208: <span class="ruby-identifier">property</span>.<span class="ruby-identifier">set</span>(<span class="ruby-value str">'tree'</span>, <span class="ruby-identifier">tree</span>) +209: <span class="ruby-keyword kw">end</span> +210: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -1237,11 +1258,11 @@ </div> <div id="sort-nternal-method" class="method-detail "> - <a name="M001097"></a> + <a name="method-i-sortInternal"></a> <div class="method-heading"> <span class="method-name">sortInternal</span><span class="method-args">()</span> @@ -1256,54 +1277,54 @@ <div class="method-source-code" id="sort-nternal-source"> <pre> - <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 211</span> -211: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sortInternal</span> -212: <span class="ruby-ivar">@items</span>.<span class="ruby-identifier">sort!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span><span class="ruby-operator">|</span> -213: <span class="ruby-identifier">res</span> = <span class="ruby-value">0</span> -214: <span class="ruby-ivar">@sortingLevels</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> -215: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@query</span> -216: <span class="ruby-comment cmt"># In case we have a Query reference, we get the two values with this</span> -217: <span class="ruby-comment cmt"># query.</span> -218: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">scenarioIdx</span> = <span class="ruby-ivar">@scenarioIdx</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@scenarioIdx</span>[<span class="ruby-identifier">i</span>] -219: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">attributeId</span> = <span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>] -220: -221: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">property</span> = <span class="ruby-identifier">a</span> -222: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">process</span> -223: <span class="ruby-identifier">aVal</span> = <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">to_sort</span> -224: -225: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">property</span> = <span class="ruby-identifier">b</span> -226: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">process</span> -227: <span class="ruby-identifier">bVal</span> = <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">to_sort</span> -228: <span class="ruby-keyword kw">else</span> -229: <span class="ruby-comment cmt"># In case we don't have a query, we use the static mechanism.</span> -230: <span class="ruby-comment cmt"># If the scenario index is negative we have a non-scenario-specific</span> -231: <span class="ruby-comment cmt"># attribute.</span> -232: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@scenarioIdx</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> -233: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'id'</span> -234: <span class="ruby-identifier">aVal</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">fullId</span> -235: <span class="ruby-identifier">bVal</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">fullId</span> -236: <span class="ruby-keyword kw">else</span> -237: <span class="ruby-identifier">aVal</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">get</span>(<span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>]) -238: <span class="ruby-identifier">bVal</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">get</span>(<span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>]) -239: <span class="ruby-keyword kw">end</span> -240: <span class="ruby-keyword kw">else</span> -241: <span class="ruby-identifier">aVal</span> = <span class="ruby-identifier">a</span>[<span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>], <span class="ruby-ivar">@scenarioIdx</span>[<span class="ruby-identifier">i</span>]] -242: <span class="ruby-identifier">bVal</span> = <span class="ruby-identifier">b</span>[<span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>], <span class="ruby-ivar">@scenarioIdx</span>[<span class="ruby-identifier">i</span>]] -243: <span class="ruby-keyword kw">end</span> -244: <span class="ruby-keyword kw">end</span> -245: <span class="ruby-identifier">res</span> = <span class="ruby-identifier">aVal</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">bVal</span> -246: <span class="ruby-comment cmt"># Invert the result if we have to sort in decreasing order.</span> -247: <span class="ruby-identifier">res</span> = <span class="ruby-operator">-</span><span class="ruby-identifier">res</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@sortingUp</span>[<span class="ruby-identifier">i</span>] -248: <span class="ruby-comment cmt"># If the two elements are equal on this compare level we try the next</span> -249: <span class="ruby-comment cmt"># level.</span> -250: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> -251: <span class="ruby-keyword kw">end</span> -252: <span class="ruby-identifier">res</span> -253: <span class="ruby-keyword kw">end</span> -254: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/PropertyList.rb, line 212</span> +212: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sortInternal</span> +213: <span class="ruby-ivar">@items</span>.<span class="ruby-identifier">sort!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span><span class="ruby-operator">|</span> +214: <span class="ruby-identifier">res</span> = <span class="ruby-value">0</span> +215: <span class="ruby-ivar">@sortingLevels</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> +216: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@query</span> +217: <span class="ruby-comment cmt"># In case we have a Query reference, we get the two values with this</span> +218: <span class="ruby-comment cmt"># query.</span> +219: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">scenarioIdx</span> = <span class="ruby-ivar">@scenarioIdx</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@scenarioIdx</span>[<span class="ruby-identifier">i</span>] +220: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">attributeId</span> = <span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>] +221: +222: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">property</span> = <span class="ruby-identifier">a</span> +223: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">process</span> +224: <span class="ruby-identifier">aVal</span> = <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">to_sort</span> +225: +226: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">property</span> = <span class="ruby-identifier">b</span> +227: <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">process</span> +228: <span class="ruby-identifier">bVal</span> = <span class="ruby-ivar">@query</span>.<span class="ruby-identifier">to_sort</span> +229: <span class="ruby-keyword kw">else</span> +230: <span class="ruby-comment cmt"># In case we don't have a query, we use the static mechanism.</span> +231: <span class="ruby-comment cmt"># If the scenario index is negative we have a non-scenario-specific</span> +232: <span class="ruby-comment cmt"># attribute.</span> +233: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@scenarioIdx</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> +234: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'id'</span> +235: <span class="ruby-identifier">aVal</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">fullId</span> +236: <span class="ruby-identifier">bVal</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">fullId</span> +237: <span class="ruby-keyword kw">else</span> +238: <span class="ruby-identifier">aVal</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">get</span>(<span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>]) +239: <span class="ruby-identifier">bVal</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">get</span>(<span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>]) +240: <span class="ruby-keyword kw">end</span> +241: <span class="ruby-keyword kw">else</span> +242: <span class="ruby-identifier">aVal</span> = <span class="ruby-identifier">a</span>[<span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>], <span class="ruby-ivar">@scenarioIdx</span>[<span class="ruby-identifier">i</span>]] +243: <span class="ruby-identifier">bVal</span> = <span class="ruby-identifier">b</span>[<span class="ruby-ivar">@sortingCriteria</span>[<span class="ruby-identifier">i</span>], <span class="ruby-ivar">@scenarioIdx</span>[<span class="ruby-identifier">i</span>]] +244: <span class="ruby-keyword kw">end</span> +245: <span class="ruby-keyword kw">end</span> +246: <span class="ruby-identifier">res</span> = <span class="ruby-identifier">aVal</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">bVal</span> +247: <span class="ruby-comment cmt"># Invert the result if we have to sort in decreasing order.</span> +248: <span class="ruby-identifier">res</span> = <span class="ruby-operator">-</span><span class="ruby-identifier">res</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@sortingUp</span>[<span class="ruby-identifier">i</span>] +249: <span class="ruby-comment cmt"># If the two elements are equal on this compare level we try the next</span> +250: <span class="ruby-comment cmt"># level.</span> +251: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> +252: <span class="ruby-keyword kw">end</span> +253: <span class="ruby-identifier">res</span> +254: <span class="ruby-keyword kw">end</span> +255: <span class="ruby-keyword kw">end</span></pre> </div> </div>