FloatNamedArraylist class: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
<!-- FloatNamedArraylist class --> | <!-- FloatNamedArraylist class --> | ||
The FloatNamedArraylist class is nearly identical to the NamedArraylist class. | The <var>FloatNamedArraylist</var> class is nearly identical to the <var>NamedArraylist</var> class. | ||
The significant difference is that instead of subscript names for items as in | The significant difference is that instead of subscript names for items as in | ||
the NamedArraylist class, the item subscripts in a FloatNamedArraylist object are | the <var>NamedArraylist</var> class, the item subscripts in a <var>FloatNamedArraylist</var> object are | ||
numeric values. These numeric subscripts are basically like the <var clas="product">Model 204</var> Float datatype, and <var>FloatNamedArraylist</var> items are stored in numeric order by subscript, whereas <var>NamedArraylist</var> items are stored by item name in EBCDIC order. | numeric values. These numeric subscripts are basically like the <var clas="product">Model 204</var> <var>Float</var> datatype, and <var>FloatNamedArraylist</var> items are stored in numeric order by subscript, whereas <var>NamedArraylist</var> items are stored by item name in EBCDIC order. | ||
The <var>FloatNamedArraylist</var> class extends the system <var>[[GenericNamedArraylist class|GenericNamedArraylist]]</var> class, so many of the methods available in the <var>FloatNamedArraylist</var> class are documented as belonging to the<var>GenericNamedArraylist</var> class. Any method available in the <var>GenericNamedArraylist</var> class is also available in the <var>FloatNamedArraylist</var> class. The other classes that extend the <var>GenericNamedArraylist</var>class are the <var>[[NamedArraylist class|NamedArraylist]]</var> class and the <var>[[UnicodeNamedArraylist class|UnicodeNamedArraylist]]</var> class. | The <var>FloatNamedArraylist</var> class extends the system <var>[[GenericNamedArraylist class|GenericNamedArraylist]]</var> class, so many of the methods available in the <var>FloatNamedArraylist</var> class are documented as belonging to the <var>GenericNamedArraylist</var> class. Any method available in the <var>GenericNamedArraylist</var> class is also available in the <var>FloatNamedArraylist</var> class. The other classes that extend the <var>GenericNamedArraylist</var>class are the <var>[[NamedArraylist class|NamedArraylist]]</var> class and the <var>[[UnicodeNamedArraylist class|UnicodeNamedArraylist]]</var> class. | ||
For example, the following request demonstrates the numerically ordered | For example, the following request demonstrates the numerically ordered | ||
result produced by a FloatNamedArraylist but not | result produced by a <var>FloatNamedArraylist</var> but not | ||
by a NamedArraylist: | by a <var>NamedArraylist</var>: | ||
<pre style="xmp"> | <pre style="xmp"> | ||
b | b | ||
Line 51: | Line 51: | ||
For background information about collections and about | For background information about collections and about | ||
declaring collection object variables, | declaring collection object variables, | ||
see [[Collections]]. | see [[Collections|"Collections"]]. | ||
See also [[Collections#Coding considerations for collections|Coding considerations | See also [[Collections#Coding considerations for collections|"Coding considerations | ||
for collections]]. | for collections"]]. | ||
The individual FloatNamedArraylist methods are described in the following subsections. | The individual <var>FloatNamedArraylist</var> methods are described in the following subsections. | ||
In the method templates, <tt>%fnamrayl</tt> is used to represent the object | In the method templates, <tt>%fnamrayl</tt> is used to represent the object | ||
to which the method is being applied, sometimes called the “method object” | to which the method is being applied, sometimes called the “method object” | ||
or the “method FloatNamedArraylist.” | or the “method <var>FloatNamedArraylist</var>.” | ||
Additional conventions are described in [[Notation conventions for methods]]. | Additional conventions are described in [[Notation conventions for methods|"Notation conventions for methods"]]. | ||
==See also== | ==See also== | ||
<table> | <table> |
Revision as of 21:47, 6 April 2011
The FloatNamedArraylist class is nearly identical to the NamedArraylist class. The significant difference is that instead of subscript names for items as in the NamedArraylist class, the item subscripts in a FloatNamedArraylist object are numeric values. These numeric subscripts are basically like the Model 204 Float datatype, and FloatNamedArraylist items are stored in numeric order by subscript, whereas NamedArraylist items are stored by item name in EBCDIC order.
The FloatNamedArraylist class extends the system GenericNamedArraylist class, so many of the methods available in the FloatNamedArraylist class are documented as belonging to the GenericNamedArraylist class. Any method available in the GenericNamedArraylist class is also available in the FloatNamedArraylist class. The other classes that extend the GenericNamedArraylistclass are the NamedArraylist class and the UnicodeNamedArraylist class.
For example, the following request demonstrates the numerically ordered result produced by a FloatNamedArraylist but not by a NamedArraylist:
b %x is collection namedArraylist of string len 32 %y is collection floatNamedArraylist of string len 32 %i is float %x = new %x(7) = 'seven' %x(38) = 'thirty-eight' %x(110) = 'one-hundred-ten' %y = new %y(7) = 'seven' %y(38) = 'thirty-eight' %y(110) = 'one-hundred-ten' for %i from 1 to %x:count print %x:nameByNumber(%i) and %x:itemByNumber(%i) end for for %i from 1 to %y:count print %y:nameByNumber(%i) and %y:itemByNumber(%i) end for end
The request prints:
110 one-hundred-ten 38 thirty-eight 7 seven ----- 7 seven 38 thirty-eight 110 one-hundred-ten
For background information about collections and about declaring collection object variables, see "Collections". See also "Coding considerations for collections".
The individual FloatNamedArraylist methods are described in the following subsections. In the method templates, %fnamrayl is used to represent the object to which the method is being applied, sometimes called the “method object” or the “method FloatNamedArraylist.” Additional conventions are described in "Notation conventions for methods".
See also
List of NamedArraylist methods | For a list of all methods in the NamedArraylist class, with a brief description of each. |
---|---|
List of FloatNamedArraylist methods | For a list of all methods in the FloatNamedArraylist class, with a brief description of each. |
List of UnicodeNamedArraylist methods | For a list of all methods in the UnicodeNamedArraylist class, with a brief description of each. |
Collections | For background information about collections and Arraylists and about declaring Arraylist object variables. |
Coding considerations for collections | For tips on using collections. |