Arraylist methods syntax

From m204wiki
Jump to navigation Jump to search

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])]