New (NamedArraylist constructor): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%; color:black"><b><section begin=dpl_desc/>Create new NamedArraylist instance<section end=dpl_desc/></b></span>
{{Template:NamedArraylist:New subtitle}}
[[Category:NamedArraylist methods|New constructor]]
 
<!--DPL?? Category:NamedArraylist methods|New constructor: Create new NamedArraylist instance-->
This method returns a new instance of a <var>NamedArraylist</var> object.
<p>
New is a member of the [[NamedArraylist class]].
</p>


This method returns a new instance of a NamedArraylist.
==Syntax==
==Syntax==
  %namrayl = New
{{Template:NamedArraylist:New syntax}}
===Syntax Terms===
===Syntax Terms===
<dl>
<table class="syntaxTable">
<dt><i>%namrayl</i>
<tr><th>%nal</th>
<dd>A NamedArraylist object that is set to a new NamedArraylist object reference.
<td>A <var>NamedArraylist</var> object variable that is set to a new <var>NamedArraylist</var> object reference.</td></tr>
 
<tr><th nowrap="true"><var>[%(NamedArraylist Of </var>itemType<var>):]</var></th>
</dl>
<td>The optional class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See "Usage notes," below, for more information about invoking a collection <var>Constructor</var>.</td></tr>
</table>
==Usage Notes==
==Usage Notes==
<ul>
<ul>
<li>New is a constructor and as such can be called with no
<li>As described in [[Object variables#Using New or other Constructors|"Using New or other Constructors"]], <var>New</var> can be invoked with no object, with an explicit class specification, or with an object variable, even if that object is <var>Null</var>:
object, with an explicit class name, or with an object variable,
<p class="code">%nal = new
even if that object is null:
 
<pre style="xmp">
%nal = %(namedArraylist of longstring):new
    %namrayl = new
 
    %namrayl = %(namedArraylist):new
%nal = %nal:new
    %namrayl = %namrayl:new
</p>
</pre>
'''Note:'''
:note
As shown above, when explicitly indicating the
When using the second of these syntax options of New, which explicitly indicates the
class, both the collection and the item datatype must be
class, both the collection and item datatypes must be
specified just as they are on the collection variable's declaration:
specified just as they are on the collection variable's declaration:
<pre style="xmp">
<p class="code">%nall is namedArraylist of object customer
    %namrayl is collection NamedArraylist of longstring
%nall = %(namedArraylist of object customer):new
    %namrayl = %(NamedArraylist of longstring):new
</p></ul>
</pre>
</ul>

Revision as of 19:17, 6 August 2012

Create a new NamedArraylist object (NamedArraylist class)


This method returns a new instance of a NamedArraylist object.

Syntax

%nal = [%(NamedArraylist Of itemType):]New

Syntax Terms

%nal A NamedArraylist object variable that is set to a new NamedArraylist object reference.
[%(NamedArraylist Of itemType):] The optional class name in parentheses denotes a Constructor. See "Usage notes," below, for more information about invoking a collection Constructor.

Usage Notes

  • As described in "Using New or other Constructors", New can be invoked with no object, with an explicit class specification, or with an object variable, even if that object is Null:

    %nal = new %nal = %(namedArraylist of longstring):new %nal = %nal:new

    Note: As shown above, when explicitly indicating the class, both the collection and the item datatype must be specified just as they are on the collection variable's declaration:

    %nall is namedArraylist of object customer %nall = %(namedArraylist of object customer):new