MinimumItem (Arraylist function): Difference between revisions
Jump to navigation
Jump to search
m (→Usage notes) |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Template:Arraylist:MinimumItem subtitle}} | {{Template:Arraylist:MinimumItem subtitle}} | ||
<var>MinimumItem</var> is related to the <var>[[Minimum (Arraylist function)|Minimum]]</var> <var>Arraylist</var> method, which | <var>MinimumItem</var> is related to the <var>[[Minimum (Arraylist function)|Minimum]]</var> <var>Arraylist</var> method, which returns the number or name of the item that has the minimum value in an <var>Arraylist</var>. | ||
==Syntax== | ==Syntax== |
Revision as of 21:10, 18 July 2012
Get item that has minimum value (Arraylist class)
[Introduced in Sirius Mods 7.8]
MinimumItem is related to the Minimum Arraylist method, which returns the number or name of the item that has the minimum value in an Arraylist.
Syntax
%item = al:MinimumItem[( [itemFunction])]
Syntax terms
%item | An Arraylist item of the same type as the al object. |
---|---|
al | An Arraylist object. |
method | A function that operates on the type of the items in the Arraylist. It may be a local method or method variable or a class member (Variable, Property), and it must return an intrinsic value. The default method value is the special identity function, This, which simply returns the item value. |
Usage notes
- The optional method parameter lets you further manipulate the Arraylist item values before performing the MinimumItem method's item evaluation. The method default (identity function This) fails against non-intrinsic values, however. If your Arraylist items are not intrinsic values, you must specify a method function that can map the item values to intrinsic values.
Examples
For the ArrayList %al
whose items are the odd integers between 0 and 10, %al:minItem
returns 1
.