.TH "KJS::List" kde3 "11 Jun 2005" "Version Version 3.4.1" "kjs Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KJS::List \- Native list type.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <list.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBList\fP (bool needsMarking)"
.br
.ti -1c
.RI "\fBList\fP (const \fBList\fP &b)"
.br
.ti -1c
.RI "\fBList\fP & \fBoperator=\fP (const \fBList\fP &)"
.br
.ti -1c
.RI "void \fBappend\fP (const \fBValue\fP &val)"
.br
.ti -1c
.RI "void \fBappend\fP (\fBValueImp\fP *val)"
.br
.ti -1c
.RI "void \fBclear\fP ()"
.br
.ti -1c
.RI "\fBList\fP \fBcopy\fP () const "
.br
.ti -1c
.RI "\fBList\fP \fBcopyTail\fP () const "
.br
.ti -1c
.RI "bool \fBisEmpty\fP () const "
.br
.ti -1c
.RI "int \fBsize\fP () const "
.br
.ti -1c
.RI "\fBListIterator\fP \fBbegin\fP () const "
.br
.ti -1c
.RI "\fBListIterator\fP \fBend\fP () const "
.br
.ti -1c
.RI "\fBValue\fP \fBat\fP (int i) const "
.br
.ti -1c
.RI "\fBValue\fP \fBoperator[]\fP (int i) const "
.br
.ti -1c
.RI "\fBValueImp\fP * \fBimpAt\fP (int i) const "
.br
.ti -1c
.RI "void \fBmark\fP ()"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static const \fBList\fP & \fBempty\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
Native list type. 

\fBList\fP is a native ECMAScript type. \fBList\fP values are only used for intermediate results of expression evaluation and cannot be stored as properties of objects.
.PP
The list is explicitly shared. Note that while \fBcopyTail()\fP returns a copy of the list the referenced objects are still shared. 
.PP
Definition at line 48 of file list.h.
.SH "Member Function Documentation"
.PP 
.SS "void KJS::List::append (const \fBValue\fP & val)\fC [inline]\fP"
.PP
Append an object to the end of the list. 
.PP
\fBParameters:\fP
.RS 4
\fIval\fP Pointer to object. 
.RE
.PP

.PP
Definition at line 66 of file list.h.
.PP
Referenced by KJS::Error::create().
.SS "void KJS::List::clear ()"
.PP
Remove all elements from the list. 
.PP
Definition at line 238 of file list.cpp.
.SS "\fBList\fP KJS::List::copy () const"
.PP
Make a copy of the list. 
.PP
Definition at line 281 of file list.cpp.
.PP
References KShortcut::append().
.PP
Referenced by copyTail().
.SS "\fBList\fP KJS::List::copyTail () const"
.PP
Make a copy of the list, omitting the first element. 
.PP
Definition at line 302 of file list.cpp.
.PP
References KShortcut::append(), and copy().
.SS "bool KJS::List::isEmpty () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
true if the list is empty. false otherwise. 
.RE
.PP

.PP
Definition at line 86 of file list.h.
.SS "int KJS::List::size () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the current size of the list. 
.RE
.PP

.PP
Definition at line 90 of file list.h.
.PP
Referenced by end().
.SS "\fBListIterator\fP KJS::List::begin () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
A \fBKJS::ListIterator\fP pointing to the first element. 
.RE
.PP

.PP
Definition at line 186 of file list.h.
.SS "\fBListIterator\fP KJS::List::end () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
A \fBKJS::ListIterator\fP pointing to the last element. 
.RE
.PP

.PP
Definition at line 187 of file list.h.
.PP
References size().
.SS "\fBValue\fP KJS::List::at (int i) const\fC [inline]\fP"
.PP
Retrieve an element at an indexed position. 
.PP
If you want to iterate trough the whole list using \fBKJS::ListIterator\fP will be faster.
.PP
\fBParameters:\fP
.RS 4
\fIi\fP \fBList\fP index. 
.RE
.PP
\fBReturns:\fP
.RS 4
Return the element at position i. \fBKJS::Undefined\fP if the index is out of range. 
.RE
.PP

.PP
Definition at line 108 of file list.h.
.SS "\fBValue\fP KJS::List::operator[] (int i) const\fC [inline]\fP"
.PP
Equivalent to at. 
.PP
Definition at line 112 of file list.h.
.SS "const \fBList\fP & KJS::List::empty ()\fC [static]\fP"
.PP
Returns a pointer to a static instance of an empty list. 
.PP
Useful if a function has a KJS::List parameter. 
.PP
Definition at line 322 of file list.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for kjs Library from the source code.
