Maximum (UnicodeNamedArraylist function): Difference between revisions
m (→See also) |
mNo edit summary |
||
Line 12: | Line 12: | ||
<td>A <var>UnicodeNamedArraylist</var>object. </td></tr> | <td>A <var>UnicodeNamedArraylist</var>object. </td></tr> | ||
<tr><th>itemFunction</th> | <tr><th>itemFunction</th> | ||
<td>A method value (a method name literal, a method variable, or even a method that returns a method value) for a method that operates on objects of the type specified on the <var class="term">uniNal</var> declaration and that returns a numeric or string value. | <td>A method value (a method name literal, a [[Method variables|method variable]], or even a method that returns a method value) for a method that operates on objects of the type specified on the <var class="term">uniNal</var> declaration and that returns a numeric or string value. | ||
<p>The special identity function, <var>This</var>, is the default <var class="term">itemFunction</var> value for the <var>Maximum</var> and <var>Minimum</var> methods. See [[Collections#Using the This function as the Maximum parameter|"Using the This function as the Maximum parameter"]].</p></td></tr> | <p>The special identity function, <var>This</var>, is the default <var class="term">itemFunction</var> value for the <var>Maximum</var> and <var>Minimum</var> methods. See [[Collections#Using the This function as the Maximum parameter|"Using the This function as the Maximum parameter"]].</p></td></tr> | ||
</table> | </table> |
Revision as of 19:52, 19 March 2012
Name of item with maximum value or maximum value of function applied to items (UnicodeNamedArraylist class)
Maximum returns the subscript name of the UnicodeNamedArraylist item that has the maximum value after the application of a specified function to each item. The function applied to each UnicodeNamedArraylist item, which you specify with the required itemFunction argument, must be a method that operates on the item type and returns a User Language intrinsic datatype (Float, String, Longstring, or Unicode) value.
Syntax
%unicode = uniNal:Maximum[( [itemFunction])]
Syntax terms
unicode | A Unicode string to contain the subscript name of the item in the indicated UnicodeNamedArraylistthat has the maximum value after the argument function has been applied. |
---|---|
%uniNal | A UnicodeNamedArraylistobject. |
itemFunction | A method value (a method name literal, a method variable, or even a method that returns a method value) for a method that operates on objects of the type specified on the uniNal declaration and that returns a numeric or string value.
The special identity function, This, is the default itemFunction value for the Maximum and Minimum methods. See "Using the This function as the Maximum parameter". |
Usage notes
- If the function applied by Maximum returns string values, Maximum uses the decimal-equivalent value of the character bytes and determines the number of the item that has the greatest value. Lowercase letters are first ranked alphabetically; then uppercase letters, also ranked alphabetically; finally followed by the numbers; that is:
'a'..'z','A'..'Z',0..9
. - If two or more UnicodeNamedArraylist items have equal, maximum, values, Maximum returns the position of the item that appears closest to the beginning of the UnicodeNamedArraylist .
- The parameter for Maximum is a method value, not a User Language expression. That is, you cannot provide a function that itself has an argument (say, ToIntegerPower(2)) as the Maximum parameter. The "Maximum/Minimum with local method" example shows a way to apply ToIntegerPower with Maximum.
Examples
For examples of Maximum (and Minimum) calls, see the "FloatNamedArraylist Minimum function example" in the Minimum method description, and "Finding collection maxima and minima, and sorting".
See also
- The Minimum function is the opposite of the Maximum function.