Arraylist class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 26: Line 26:
</p>
</p>
   
   
The individual <var>Arraylist</var> methods are described in the following subsections.
==List of Arraylist methods==
In the method templates, <var class="term">al</var> is used to represent the object
The [[List of Arraylist methods|"List of Arraylist methods"]] shows all the class methods, with a brief description of each.
to which the method is being applied, sometimes called the "method object"
 
or the "method Arraylist".
Additional conventions are described in [[Notation conventions for methods|"Notation conventions for methods"]].
==See also==
==See also==
<table>
<table>
<tr><th>[[List of Arraylist methods]]</th>
<td>For a list of all methods in the Arraylist class, with a brief description of each.</td></tr>
<tr><th>[[Collections]]</th>
<tr><th>[[Collections]]</th>
<td>For background information about collections and <var>Arraylist</var>s and about
<td>For background information about collections and <var>Arraylist</var>s and about
Line 42: Line 38:
<td>For tips on using collections.</td></tr>
<td>For tips on using collections.</td></tr>
</table>
</table>
[[Category:System classes]]
[[Category:System classes]]

Revision as of 21:32, 23 December 2011

Arraylists can be thought of as traditional arrays with no bounds and much more flexibility.

The following code illustrates several of the Arraylist methods:

%alist is collection Arraylist of longstring %i is float %alist = new %alist:add('Idle') %alist:add('Gumby') %alist:add('Chapman') %alist:add('Pallin') %alist:insert(2, 'Jones') %alist:removeItem(4) %alist(3) = 'Cleese' for %i from 1 to %alist:count print %alist(%i) end for

This code snippet would print:

Idle Jones Cleese Pallin

List of Arraylist methods

The "List of Arraylist methods" shows all the class methods, with a brief description of each.

See also

Collections For background information about collections and Arraylists and about declaring Arraylist object variables.
Coding considerations for collections For tips on using collections.