Arraylist methods syntax: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Automatically generated page update)
(Automatically generated page update)
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
{{Template:Syntax list header|class=Arraylist}}
{{Template:Syntax list header|class=Arraylist}}
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top:1px solid;"><span class="squareb">[</span><span class="term">%count</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">al</span><span class="literal">:[[Add (Arraylist function)|Add]]</span><span class="literal">(</span> <span class="term" title="List">itemList</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top:1px solid;"><span class="squareb">[</span><span class="term">%count</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">al</span><span class="literal">:[[Add (Arraylist function)|Add]]</span><span class="literal">(</span> <span class="term" title="List">itemList</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">al</span><span class="literal">:[[Audit (Arraylist subroutine)|Audit]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">method</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">NumWidth=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Separator=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span>                 -
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">al</span><span class="literal">:[[Audit (Arraylist subroutine)|Audit]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">itemFunction</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">NumWidth=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Separator=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span>           -
           <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">MaxItems=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Label=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
           <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">MaxItems=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Label=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%average</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Average (Arraylist function)|Average]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">method</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%average</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Average (Arraylist function)|Average]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">itemFunction</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%copyList</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Copy (Arraylist function)|Copy]]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%copyList</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Copy (Arraylist function)|Copy]]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%count</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Count (Arraylist property)|Count]]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%count</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Count (Arraylist property)|Count]]</span></p>
Line 12: Line 12:
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%item</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">al</span><span class="literal">:[[Dequeue (Arraylist function)|Dequeue]]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%item</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">al</span><span class="literal">:[[Dequeue (Arraylist function)|Dequeue]]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%count</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">al</span><span class="literal">:[[Enqueue (Arraylist function)|Enqueue]]</span><span class="literal">(</span> <span class="term" title="CollectionItem">collectionItem</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%count</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">al</span><span class="literal">:[[Enqueue (Arraylist function)|Enqueue]]</span><span class="literal">(</span> <span class="term" title="CollectionItem">collectionItem</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%item</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[FindNextItem (Arraylist function)|FindNextItem]]</span><span class="literal">(</span> <span class="term" title="SelectionCriterion">selectionCriterion</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%item</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[FindNextItem (Arraylist function)|FindNextItem]]</span><span class="literal">(</span> <span class="term" title="SelectionCriterion">selectionCriterion</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="literal">)</span>
 
Throws [[ItemNotFound class|ItemNotFound]]</p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[FindNextItemNumber (Arraylist function)|FindNextItemNumber]]</span><span class="literal">(</span> <span class="term" title="SelectionCriterion">selectionCriterion</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[FindNextItemNumber (Arraylist function)|FindNextItemNumber]]</span><span class="literal">(</span> <span class="term" title="SelectionCriterion">selectionCriterion</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%item</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[FindPreviousItem (Arraylist function)|FindPreviousItem]]</span><span class="literal">(</span> <span class="term" title="SelectionCriterion">selectionCriterion</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%item</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[FindPreviousItem (Arraylist function)|FindPreviousItem]]</span><span class="literal">(</span> <span class="term" title="SelectionCriterion">selectionCriterion</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="literal">)</span>
 
Throws [[ItemNotFound class|ItemNotFound]]</p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[FindPreviousItemNumber (Arraylist function)|FindPreviousItemNumber]]</span><span class="literal">(</span> <span class="term" title="SelectionCriterion">selectionCriterion</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[FindPreviousItemNumber (Arraylist function)|FindPreviousItemNumber]]</span><span class="literal">(</span> <span class="term" title="SelectionCriterion">selectionCriterion</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentItem</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[FirstItem (Arraylist property)|FirstItem]]</span>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentItem</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[FirstItem (Arraylist property)|FirstItem]]</span>
Line 24: Line 28:
<span class="term">al</span><span class="literal">:[[LastItem (Arraylist property)|LastItem]]</span> <span class="literal">= </span><span class="term">newItem</span></p>
<span class="term">al</span><span class="literal">:[[LastItem (Arraylist property)|LastItem]]</span> <span class="literal">= </span><span class="term">newItem</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%newList</span><span class="literal"> =</span> <span class="squareb">[</span><span class="literal">%(Arraylist Of </span><span class="term">itemType</span><span class="literal">):</span><span class="squareb">]</span><span class="literal">[[List (Arraylist function)|List]]</span><span class="literal">(</span> <span class="term" title="List">itemList</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%newList</span><span class="literal"> =</span> <span class="squareb">[</span><span class="literal">%(Arraylist Of </span><span class="term">itemType</span><span class="literal">):</span><span class="squareb">]</span><span class="literal">[[List (Arraylist function)|List]]</span><span class="literal">(</span> <span class="term" title="List">itemList</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Maximum (Arraylist function)|Maximum]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">method</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Maximum (Arraylist function)|Maximum]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">itemFunction</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%item</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[MaximumItem (Arraylist function)|MaximumItem]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">method</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%item</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[MaximumItem (Arraylist function)|MaximumItem]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">itemFunction</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Minimum (Arraylist function)|Minimum]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">method</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Minimum (Arraylist function)|Minimum]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">itemFunction</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%item</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[MinimumItem (Arraylist function)|MinimumItem]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">method</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%item</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[MinimumItem (Arraylist function)|MinimumItem]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">itemFunction</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%al</span><span class="literal"> =</span> <span class="squareb">[</span><span class="literal">%(Arraylist Of </span><span class="term">itemType</span><span class="literal">):</span><span class="squareb">]</span><span class="literal">[[New (Arraylist constructor)|New]]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%al</span><span class="literal"> =</span> <span class="squareb">[</span><span class="literal">%(Arraylist Of </span><span class="term">itemType</span><span class="literal">):</span><span class="squareb">]</span><span class="literal">[[New (Arraylist constructor)|New]]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%item</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">al</span><span class="literal">:[[Pop (Arraylist function)|Pop]]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%item</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">al</span><span class="literal">:[[Pop (Arraylist function)|Pop]]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">al</span><span class="literal">:[[Print (Arraylist subroutine)|Print]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">method</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">NumWidth=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Separator=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span>                 -
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">al</span><span class="literal">:[[Print (Arraylist subroutine)|Print]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">itemFunction</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">NumWidth=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Separator=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span>           -
           <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">MaxItems=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Label=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
           <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">MaxItems=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Label=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%count</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">al</span><span class="literal">:[[Push (Arraylist function)|Push]]</span><span class="literal">(</span> <span class="term" title="CollectionItem">collectionItem</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%count</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">al</span><span class="literal">:[[Push (Arraylist function)|Push]]</span><span class="literal">(</span> <span class="term" title="CollectionItem">collectionItem</span><span class="literal">)</span></p>
Line 36: Line 40:
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">al</span><span class="literal">:[[Sort (Arraylist subroutine)|Sort]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="SortOrder">sortOrder</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">al</span><span class="literal">:[[Sort (Arraylist subroutine)|Sort]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="SortOrder">sortOrder</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%newList</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[SortNew (Arraylist function)|SortNew]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="SortOrder">sortOrder</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%newList</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[SortNew (Arraylist function)|SortNew]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="SortOrder">sortOrder</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%standardDev</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[StandardDeviation (Arraylist function)|StandardDeviation]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">method</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%standardDev</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[StandardDeviation (Arraylist function)|StandardDeviation]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">itemFunction</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%newList</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[SubsetNew (Arraylist function)|SubsetNew]]</span><span class="literal">(</span> <span class="term" title="SelectionCriterion">selectionCriterion</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%newList</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[SubsetNew (Arraylist function)|SubsetNew]]</span><span class="literal">(</span> <span class="term" title="SelectionCriterion">selectionCriterion</span><span class="literal">)</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%sum</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Sum (Arraylist function)|Sum]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">method</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%sum</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Sum (Arraylist function)|Sum]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">itemFunction</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">al</span><span class="literal">:[[Trace (Arraylist subroutine)|Trace]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">method</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">NumWidth=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Separator=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span>                 -
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">al</span><span class="literal">:[[Trace (Arraylist subroutine)|Trace]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">itemFunction</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">NumWidth=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Separator=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span>           -
           <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">MaxItems=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Label=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
           <span class="squareb">[</span><span class="literal" title="Number">Start=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="Number">MaxItems=</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="literal" title="String">Label=</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%variance</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Variance (Arraylist function)|Variance]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">method</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%variance</span><span class="literal"> =</span> <span class="term">al</span><span class="literal">:[[Variance (Arraylist function)|Variance]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="term" title="ItemFunction">itemFunction</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p>

Latest revision as of 22:02, 2 March 2014

The syntax for each of the Arraylist class methods is shown below.

Square brackets indicate optional elements of the method invocation. See also the notation conventions for methods and the List of Arraylist methods.

[%count =] al:Add( itemList)

al:Audit[( [itemFunction], [NumWidth= number], [Separator= string], - [Start= number], [MaxItems= number], [Label= string])]

%average = al:Average[( [itemFunction])]

%copyList = al:Copy

%count = al:Count

%count = al:CountSubset( selectionCriterion)

%copyList = al:DeepCopy

[%item =] al:Dequeue

[%count =] al:Enqueue( collectionItem)

%item = al:FindNextItem( selectionCriterion, [Start= number]) Throws ItemNotFound

%number = al:FindNextItemNumber( selectionCriterion, [Start= number])

%item = al:FindPreviousItem( selectionCriterion, [Start= number]) Throws ItemNotFound

%number = al:FindPreviousItemNumber( selectionCriterion, [Start= number])

%currentItem = al:FirstItem al:FirstItem = newItem

[%count =] al:Insert( number, itemList)

%currentItem = al:Item( number) al:Item( number) = newItem

%currentItem = al:LastItem al:LastItem = newItem

%newList = [%(Arraylist Of itemType):]List( itemList)

%number = al:Maximum[( [itemFunction])]

%item = al:MaximumItem[( [itemFunction])]

%number = al:Minimum[( [itemFunction])]

%item = al:MinimumItem[( [itemFunction])]

%al = [%(Arraylist Of itemType):]New

[%item =] al:Pop

al:Print[( [itemFunction], [NumWidth= number], [Separator= string], - [Start= number], [MaxItems= number], [Label= string])]

[%count =] al:Push( collectionItem)

[%count =] al:RemoveItem( number)

al:Sort[( [sortOrder])]

%newList = al:SortNew[( [sortOrder])]

%standardDev = al:StandardDeviation[( [itemFunction])]

%newList = al:SubsetNew( selectionCriterion)

%sum = al:Sum[( [itemFunction])]

al:Trace[( [itemFunction], [NumWidth= number], [Separator= string], - [Start= number], [MaxItems= number], [Label= string])]

%variance = al:Variance[( [itemFunction])]