NamedArraylist methods syntax: Difference between revisions
m (Automatically generated page update) |
m (Automatically generated page update) |
||
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="term">%currentItem</span><span class="literal"> =</span> <span class="term">anyNal</span><span class="literal">:[[Default (GenericNamedArraylist property)|Default]]</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">anyNal</span><span class="literal">:[[Default (GenericNamedArraylist property)|Default]]</span> | ||
<span class="term">anyNal</span><span class="literal">:[[Default (GenericNamedArraylist property)|Default]]</span> <span class="literal">= </span><span class="term">newItem</span></p> | <span class="term">anyNal</span><span class="literal">:[[Default (GenericNamedArraylist property)|Default]]</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">%item</span><span class="literal"> =</span> <span class="term">anyNal</span><span class="literal">:[[FindNextItem (GenericNamedArraylist 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">anyNal</span><span class="literal">:[[FindNextItem (GenericNamedArraylist 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">anyNal</span><span class="literal">:[[FindNextItemNumber (GenericNamedArraylist 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">anyNal</span><span class="literal">:[[FindNextItemNumber (GenericNamedArraylist 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">anyNal</span><span class="literal">:[[FindPreviousItem (GenericNamedArraylist 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">anyNal</span><span class="literal">:[[FindPreviousItem (GenericNamedArraylist 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">anyNal</span><span class="literal">:[[FindPreviousItemNumber (GenericNamedArraylist 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">anyNal</span><span class="literal">:[[FindPreviousItemNumber (GenericNamedArraylist 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">anyNal</span><span class="literal">:[[FirstItem (GenericNamedArraylist property)|FirstItem]]</span> | |||
<span class="term">anyNal</span><span class="literal">:[[FirstItem (GenericNamedArraylist property)|FirstItem]]</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">%name</span><span class="literal"> =</span> <span class="term">nal</span><span class="literal">:[[FirstItemName (NamedArraylist function)|FirstItemName]]</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">nal</span><span class="literal">:[[Item (NamedArraylist property)|Item]]</span><span class="literal">(</span> <span class="term" title="String">string</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">%currentItem</span><span class="literal"> =</span> <span class="term">nal</span><span class="literal">:[[Item (NamedArraylist property)|Item]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span> | ||
<span class="term">nal</span><span class="literal">:[[Item (NamedArraylist property)|Item]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span> <span class="literal">= </span><span class="term">newItem</span></p> | <span class="term">nal</span><span class="literal">:[[Item (NamedArraylist property)|Item]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span> <span class="literal">= </span><span class="term">newItem</span> | ||
Throws [[ItemNotPresent class|ItemNotPresent]]</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">anyNal</span><span class="literal">:[[ItemByNumber (GenericNamedArraylist property)|ItemByNumber]]</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">%currentItem</span><span class="literal"> =</span> <span class="term">anyNal</span><span class="literal">:[[ItemByNumber (GenericNamedArraylist property)|ItemByNumber]]</span><span class="literal">(</span> <span class="term" title="Number">number</span><span class="literal">)</span> | ||
<span class="term">anyNal</span><span class="literal">:[[ItemByNumber (GenericNamedArraylist property)|ItemByNumber]]</span><span class="literal">(</span> <span class="term" title="Number">number</span><span class="literal">)</span> <span class="literal">= </span><span class="term">newItem</span></p> | <span class="term">anyNal</span><span class="literal">:[[ItemByNumber (GenericNamedArraylist property)|ItemByNumber]]</span><span class="literal">(</span> <span class="term" title="Number">number</span><span class="literal">)</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">%currentItem</span><span class="literal"> =</span> <span class="term">anyNal</span><span class="literal">:[[LastItem (GenericNamedArraylist property)|LastItem]]</span> | |||
<span class="term">anyNal</span><span class="literal">:[[LastItem (GenericNamedArraylist 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">%name</span><span class="literal"> =</span> <span class="term">nal</span><span class="literal">:[[LastItemName (NamedArraylist function)|LastItemName]]</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">%string</span><span class="literal"> =</span> <span class="term">nal</span><span class="literal">:[[Maximum (NamedArraylist 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">%string</span><span class="literal"> =</span> <span class="term">nal</span><span class="literal">:[[Maximum (NamedArraylist 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">anyNal</span><span class="literal">:[[MaximumItem (GenericNamedArraylist 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">%item</span><span class="literal"> =</span> <span class="term">anyNal</span><span class="literal">:[[MaximumItem (GenericNamedArraylist 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> |
Latest revision as of 15:58, 8 December 2012
The syntax for each of the NamedArraylist 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 NamedArraylist methods.
anyNal:Audit[( [itemFunction], [NumWidth= number], [Separator= string], - [Start= number], [MaxItems= number], [Label= string], - [NameWidth= number])]
%number = anyNal:Average[( [itemFunction])]
%outNal = nal:Copy
%number = anyNal:Count
%number = anyNal:CountSubset( selectionCriterion)
%outNal = nal:DeepCopy
%currentItem = anyNal:Default anyNal:Default = newItem
%item = anyNal:FindNextItem( selectionCriterion, [Start= number]) Throws ItemNotFound
%number = anyNal:FindNextItemNumber( selectionCriterion, [Start= number])
%item = anyNal:FindPreviousItem( selectionCriterion, [Start= number]) Throws ItemNotFound
%number = anyNal:FindPreviousItemNumber( selectionCriterion, [Start= number])
%currentItem = anyNal:FirstItem anyNal:FirstItem = newItem
%name = nal:FirstItemName
%currentItem = nal:Item( string) nal:Item( string) = newItem Throws ItemNotPresent
%currentItem = anyNal:ItemByNumber( number) anyNal:ItemByNumber( number) = newItem
%currentItem = anyNal:LastItem anyNal:LastItem = newItem
%name = nal:LastItemName
%string = nal:Maximum[( [itemFunction])]
%item = anyNal:MaximumItem[( [itemFunction])]
%string = nal:Minimum[( [itemFunction])]
%item = anyNal:MinimumItem[( [itemFunction])]
%name = nal:NameByNumber( number)
%nal = [%(NamedArraylist Of itemType):]New
%number = nal:Number( name)
anyNal:Print[( [itemFunction], [NumWidth= number], [Separator= string], - [Start= number], [MaxItems= number], [Label= string], - [NameWidth= number])]
[%count =] nal:RemoveItem( string)
%al = anyNal:SortNew[( [sortOrder])]
%number = anyNal:StandardDeviation[( [itemFunction])]
%outNal = nal:SubsetNew( selectionCriterion)
%number = anyNal:Sum[( [itemFunction])]
anyNal:Trace[( [itemFunction], [NumWidth= number], [Separator= string], - [Start= number], [MaxItems= number], [Label= string], - [NameWidth= number])]
%currentBoolean = anyNal:UseDefault anyNal:UseDefault = newBoolean
%number = anyNal:Variance[( [itemFunction])]