Arraylist methods syntax: Difference between revisions
m (Automatically generated page update) |
m (Automatically generated page update) |
||
Line 16: | Line 16: | ||
<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></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">%item</span><span class="literal">=</span> <span class="term">al</span><span class="literal">:[[FirstItem (Arraylist property)|FirstItem]]</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">:[[FirstItem (Arraylist property)|FirstItem]]</span> | ||
<span class="term">al</span><span class="literal">:[[FirstItem (Arraylist property)|FirstItem]]</span> <span class="literal">=</span><span class="term">%item</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">:[[Insert (Arraylist function)|Insert]]</span><span class="literal">(</span> <span class="term" title="Number">number</span><span class="comma">,</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">:[[Insert (Arraylist function)|Insert]]</span><span class="literal">(</span> <span class="term" title="Number">number</span><span class="comma">,</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">:[[Item (Arraylist property)|Item]]</span><span class="literal">(</span> <span class="term" title="Number">number</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">:[[Item (Arraylist property)|Item]]</span><span class="literal">(</span> <span class="term" title="Number">number</span><span class="literal">)</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">%item</span><span class="literal">=</span> <span class="term">al</span><span class="literal">:[[LastItem (Arraylist property)|LastItem]]</span></p> | <span class="term">al</span><span class="literal">:[[Item (Arraylist property)|Item]]</span><span class="literal">(</span> <span class="term" title="Number">number</span><span class="literal">)</span> <span class="literal">=</span><span class="term">%item</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">:[[LastItem (Arraylist property)|LastItem]]</span> | |||
<span class="term">al</span><span class="literal">:[[LastItem (Arraylist property)|LastItem]]</span> <span class="literal">=</span><span class="term">%item</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="literal">%(Arraylist):[[List (Arraylist function)|List]]</span><span class="literal">(</span> <span class="term" title="List">list</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="literal">%(Arraylist):[[List (Arraylist function)|List]]</span><span class="literal">(</span> <span class="term" title="List">list</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="literal">(</span> <span class="term" title="ItemFunction">method</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="literal">(</span> <span class="term" title="ItemFunction">method</span><span class="literal">)</span></p> |
Revision as of 17:42, 31 January 2011
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( collectionItem)
al:Audit( method, [NumWidth= number], [Separator= string], [Start= number], - [MaxItems= number], [Label= string])
%average= al:Average( method)
%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])
%number= al:FindNextItemNumber( selectionCriterion, [Start= number])
%item= al:FindPreviousItem( selectionCriterion, [Start= number])
%number= al:FindPreviousItemNumber( selectionCriterion, [Start= number])
%item= al:FirstItem al:FirstItem =%item
[%count=] al:Insert( number, collectionItem)
%item= al:Item( number) al:Item( number) =%item
%item= al:LastItem al:LastItem =%item
%newList= %(Arraylist):List( list)
%number= al:Maximum( method)
%item= al:MaximumItem( method)
%number= al:Minimum( method)
%item= al:MinimumItem( method)
[%item=] al:Pop
al:Print( method, [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( method)
%newList= al:SubsetNew( selectionCriterion)
%sum= al:Sum( method)
al:Trace( method, [NumWidth= number], [Separator= string], [Start= number], - [MaxItems= number], [Label= string])
%variance= al:Variance( method)