Minimum (UnicodeNamedArraylist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 1: Line 1:
{{Template:UnicodeNamedArraylist:Minimum subtitle}}
{{Template:UnicodeNamedArraylist:Minimum subtitle}}


This function returns the name (subscript) of the UnicodeNamedArraylist item that
This function returns the name (subscript) of the <var>UnicodeNamedArraylist</var> item that
has the minimum value after the application of a specified function to each item.
has the minimum value after the application of a specified function to each item.
The function that gets applied to each UnicodeNamedArraylist item, which
The function that gets applied to each <var>UnicodeNamedArraylist</var> item, which
you identify in the argument to Minimum, must be a method
you identify in the argument to <var>Minimum</var>, must be a method
that operates on the item type and returns a <var class="product">User Language</var> intrinsic
that operates on the item type and returns a <var class="product">User Language</var> [[Intrinsic classes|intrinsic]]
datatype (Float, String, Longstring, or Unicode) value.
datatype (<var>Float</var>, <var>String</var>, <var>Longstring</var>, or <var>Unicode</var>) value.


The system intrinsic classes are discussed in [[Intrinsic classes|"Intrinsic classes"]].
Local methods are discussed in [[??]] refid=localm..
==Syntax==
==Syntax==
{{Template:UnicodeNamedArraylist:Minimum syntax}}
{{Template:UnicodeNamedArraylist:Minimum syntax}}
Line 19: Line 17:
<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.


The special identity function, <tt>This</tt>, is the default ''function'' 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"]].</td></tr>
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 <var>This</var> function as the Maximum parameter"]].</td></tr>


</table>
</table>
Line 30: Line 28:
uses the decimal-equivalent value of the character bytes and determines
uses the decimal-equivalent value of the character bytes and determines
the number of the item that has the lowest value.
the number of the item that has the lowest value.
Therefore, lowercase letters are ranked alphabetically and
Therefore, lowercase letters are ranked alphabetically and the minimum lowercase letter is "a";
the minimum lowercase letter is "a";
the uppercase letters are ranked alphabetically and the minimum uppercase letter is "A";
the uppercase letters are ranked alphabetically and
"z" ranks lower than all the uppercase letters; and all letters rank lower than any number.
the minimum uppercase letter is "A";
"z" ranks lower than all the uppercase letters;
and all letters rank lower than any number.
<li>If one or more <var>UnicodeNamedArraylist</var> items have equal, minimum, values,
<li>If one or more <var>UnicodeNamedArraylist</var> items have equal, minimum, values,
<var>Minimum</var> returns the subscript of the item that appears closest to the beginning
<var>Minimum</var> returns the subscript of the item that appears closest to the beginning

Revision as of 19:52, 19 March 2012

Name of item with minimum value or minimum value of function applied to items (UnicodeNamedArraylist class)


This function returns the name (subscript) of the UnicodeNamedArraylist item that has the minimum value after the application of a specified function to each item. The function that gets applied to each UnicodeNamedArraylist item, which you identify in the argument to Minimum, 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:Minimum[( [itemFunction])]

Syntax terms

unicode A Unicode string to contain the subscript name of the item in uniNal, the method UnicodeNamedArraylist object, that has the minimum value after the argument function has been applied.
uniNal A UnicodeNamedArraylist object.
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 itemFunction returns string values, Minimum uses the decimal-equivalent value of the character bytes and determines the number of the item that has the lowest value. Therefore, lowercase letters are ranked alphabetically and the minimum lowercase letter is "a"; the uppercase letters are ranked alphabetically and the minimum uppercase letter is "A"; "z" ranks lower than all the uppercase letters; and all letters rank lower than any number.
  • If one or more UnicodeNamedArraylist items have equal, minimum, values, Minimum returns the subscript of the item that appears closest to the beginning of the UnicodeNamedArraylist.
  • The Maximum function is the opposite of the Minimum function.
  • The itemFunction argument 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 itemFunction. Example "Maximum/Minimum with local method" shows a way to apply ToIntegerPower with Maximum or Minimum for an Arraylist.

See also