<HTML> <HEAD> <TITLE>class List</TITLE> <META NAME="Generator" CONTENT="KDOC "> </HEAD> <BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff"> <TABLE WIDTH="100%" BORDER="0"> <TR> <TD> <TABLE BORDER="0"> <TR><TD valign="top" align="left" cellspacing="10"> <h1>class List</h1> </TD> <TD valign="top" align="right" colspan="1">Native list type. <small><A HREF="#longdesc">More...</A></small></TD></TR> </TABLE> <HR> <TABLE BORDER="0"> <TR><TH>Full name</TH><TD><code><A HREF="KJS.html">KJS</A>::List</code></TD></TR> <TR><TH>Definition</TH><TD><code>#include <<A HREF="types_h.html">types.h</A>></code></TD></TR> <TR><TH><A HREF="full-list-KJS__List.html">List of all Methods</A></TH></TR> </TABLE> </TD> <TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR> <TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR> <TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR> <TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR> <TR><TD><small><A HREF="index.html">Index</A></small></TD></TR> </TABLE></TD></TR></TABLE> <h4>Public Methods</h4><ul><LI> <b><A HREF="#ref2">List</A></b> () </LI> <LI> <b><A HREF="#ref3">~List</A></b> () </LI> <LI>void <b><A HREF="#ref4">append</A></b> (const KJSO& obj) </LI> <LI>void <b><A HREF="#ref5">prepend</A></b> (const KJSO& obj) </LI> <LI>void <b><A HREF="#ref6">removeFirst</A></b> () </LI> <LI>void <b><A HREF="#ref7">removeLast</A></b> () </LI> <LI>void <b><A HREF="#ref8">remove</A></b> (const KJSO &obj) </LI> <LI>void <b><A HREF="#ref9">clear</A></b> () </LI> <LI>List * <b><A HREF="#ref10">copy</A></b> () const </LI> <LI>ListIterator <b><A HREF="#ref11">begin</A></b> () const </LI> <LI>ListIterator <b><A HREF="#ref12">end</A></b> () const </LI> <LI>bool <b><A HREF="#ref13">isEmpty</A></b> () const </LI> <LI>int <b><A HREF="#ref14">size</A></b> () const </LI> <LI>KJSO <b><A HREF="#ref15">at</A></b> (int i) const </LI> <LI>KJSO <b><A HREF="#ref16">operator[]</A></b> (int i) const </LI> </ul><h4>Public Static Methods</h4><ul><LI>static const List * <b><A HREF="#ref17">empty</A></b> () </LI> </ul><h4>Public Members</h4><ul><LI>static int <b><A HREF="#ref18">count</A></b></LI> </ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p> </p> <p> List is a native ECMAScript type. List values are only used for intermediate results of expression evaluation and cannot be stored as properties of objects. </p> <p> The list is explicitly shared. Note that while copy() returns a deep copy of the list the referenced objects are still shared. </p> <A NAME="List"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>List</strong> () <br></td><td align="right"><h3><strong>List</strong></h3></td></tr></table><p></p><p> Constructor. </p> <A NAME="~List"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>~List</strong> () <br></td><td align="right"><h3><strong>~List</strong></h3></td></tr></table><p></p><p> Destructor. </p> <A NAME="append"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>append</strong> (const KJSO& obj) <br></td><td align="right"><h3><strong>append</strong></h3></td></tr></table><p></p><p> Append an object to the end of the list. </p> <p></p> <p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5"> <TR><TD align="left" valign="top"><i>obj</i></TD><TD align="left" valign="top">Pointer to object. </TD></TR> </TABLE></P> <A NAME="prepend"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>prepend</strong> (const KJSO& obj) <br></td><td align="right"><h3><strong>prepend</strong></h3></td></tr></table><p></p><p> Insert an object at the beginning of the list. </p> <p></p> <p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5"> <TR><TD align="left" valign="top"><i>obj</i></TD><TD align="left" valign="top">Pointer to object. </TD></TR> </TABLE></P> <A NAME="removeFirst"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>removeFirst</strong> () <br></td><td align="right"><h3><strong>removeFirst</strong></h3></td></tr></table><p></p><p> Remove the element at the beginning of the list. </p> <A NAME="removeLast"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>removeLast</strong> () <br></td><td align="right"><h3><strong>removeLast</strong></h3></td></tr></table><p></p><p> Remove the element at the end of the list. </p> <A NAME="remove"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>remove</strong> (const KJSO &obj) <br></td><td align="right"><h3><strong>remove</strong></h3></td></tr></table><p></p><A NAME="clear"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>clear</strong> () <br></td><td align="right"><h3><strong>clear</strong></h3></td></tr></table><p></p><p> Remove all elements from the list. </p> <A NAME="copy"></A><A NAME="ref10"></A><table width="100%"><tr bgcolor="#eeeeee"><td>List * <strong>copy</strong> () <br></td><td align="right"><h3><strong>copy</strong></h3></td></tr></table><p> <small>[const]</small></p><p> Returns a deep copy of the list. Ownership is passed to the user who is responsible for deleting the list then. </p> <A NAME="begin"></A><A NAME="ref11"></A><table width="100%"><tr bgcolor="#eeeeee"><td>ListIterator <strong>begin</strong> () <br></td><td align="right"><h3><strong>begin</strong></h3></td></tr></table><p> <small>[const]</small></p><p> </p> <p><b>Returns</b>: A <A HREF="KJS__ListIterator.html">KJS::ListIterator</A> pointing to the first element. </p> <A NAME="end"></A><A NAME="ref12"></A><table width="100%"><tr bgcolor="#eeeeee"><td>ListIterator <strong>end</strong> () <br></td><td align="right"><h3><strong>end</strong></h3></td></tr></table><p> <small>[const]</small></p><p> </p> <p><b>Returns</b>: A <A HREF="KJS__ListIterator.html">KJS::ListIterator</A> pointing to the last element. </p> <A NAME="isEmpty"></A><A NAME="ref13"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool <strong>isEmpty</strong> () <br></td><td align="right"><h3><strong>isEmpty</strong></h3></td></tr></table><p> <small>[const]</small></p><p> </p> <p><b>Returns</b>: true if the list is empty. false otherwise. </p> <A NAME="size"></A><A NAME="ref14"></A><table width="100%"><tr bgcolor="#eeeeee"><td>int <strong>size</strong> () <br></td><td align="right"><h3><strong>size</strong></h3></td></tr></table><p> <small>[const]</small></p><p> </p> <p><b>Returns</b>: the current size of the list. </p> <A NAME="at"></A><A NAME="ref15"></A><table width="100%"><tr bgcolor="#eeeeee"><td>KJSO <strong>at</strong> (int i) <br></td><td align="right"><h3><strong>at</strong></h3></td></tr></table><p> <small>[const]</small></p><p> Retrieve an element at an indexed position. If you want to iterate trough the whole list using <A HREF="KJS__ListIterator.html">KJS::ListIterator</A> will be faster. </p> <p></p> <p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5"> <TR><TD align="left" valign="top"><i>i</i></TD><TD align="left" valign="top">List index. </TD></TR> </TABLE></P> <p><b>Returns</b>: Return the element at position i. <A HREF="KJS__Undefined.html">KJS::Undefined</A> if the index is out of range. </p> <A NAME="operator[]"></A><A NAME="ref16"></A><table width="100%"><tr bgcolor="#eeeeee"><td>KJSO <strong>operator[]</strong> (int i) <br></td><td align="right"><h3><strong>operator[]</strong></h3></td></tr></table><p> <small>[const]</small></p><p> Equivalent to <A HREF="KJS__List.html#at">at</A>. </p> <A NAME="empty"></A><A NAME="ref17"></A><table width="100%"><tr bgcolor="#eeeeee"><td> const List * <strong>empty</strong> () <br></td><td align="right"><h3><strong>empty</strong></h3></td></tr></table><p> <small>[static]</small></p><p> Returns a pointer to a static instance of an empty list. Useful if a function has a <A HREF="KJS__List.html">KJS::List</A> parameter. </p> <A NAME="count"></A><A NAME="ref18"></A><table width="100%"><tr bgcolor="#eeeeee"><td>static int <strong>count</strong> </td><td align="right"><h3><strong>count</strong></h3></td></tr></table><p></p><HR> <table> <tr><td><small>Generated by: qateam on updates.mandrakesoft.com on Mon Dec 30 16:09:36 2002, using kdoc 2.0a53.</small></td></tr> </table> </BODY> </HTML>