.TH "KJS::List" 3 "28 Jan 2004" "kjs Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KJS::List \- Native list type.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <types.h>\fP
.PP
Inherits \fBKJS::Value\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBList\fP (ListImp *v)"
.br
.ti -1c
.RI "\fBList\fP (const  \fBList\fP &v)"
.br
.ti -1c
.RI "\fBList\fP & \fBoperator=\fP (const  \fBList\fP &v)"
.br
.ti -1c
.RI "void \fBappend\fP (const  \fBValue\fP &val)"
.br
.RI "\fIAppend an object to the end of the list. \fP"
.ti -1c
.RI "void \fBprepend\fP (const  \fBValue\fP &val)"
.br
.RI "\fIInsert an object at the beginning of the list. \fP"
.ti -1c
.RI "void \fBappendList\fP (const  \fBList\fP &lst)"
.br
.RI "\fIAppends the items of another list at the end of this one. \fP"
.ti -1c
.RI "void \fBprependList\fP (const  \fBList\fP &lst)"
.br
.RI "\fIPrepend the items of another list to this one. \fP"
.ti -1c
.RI "void \fBremoveFirst\fP ()"
.br
.RI "\fIRemove the element at the beginning of the list. \fP"
.ti -1c
.RI "void \fBremoveLast\fP ()"
.br
.RI "\fIRemove the element at the end of the list. \fP"
.ti -1c
.RI "void \fBremove\fP (const  \fBValue\fP &val)"
.br
.ti -1c
.RI "void \fBclear\fP ()"
.br
.RI "\fIRemove all elements from the list. \fP"
.ti -1c
.RI "\fBList\fP \fBcopy\fP () const "
.br
.RI "\fIReturns a deep copy of the list. \fP"
.ti -1c
.RI "\fBListIterator\fP \fBbegin\fP () const "
.br
.ti -1c
.RI "\fBListIterator\fP \fBend\fP () const "
.br
.ti -1c
.RI "bool \fBisEmpty\fP () const "
.br
.ti -1c
.RI "int \fBsize\fP () const "
.br
.ti -1c
.RI "\fBValue\fP \fBat\fP (int i) const "
.br
.RI "\fIRetrieve an element at an indexed position. \fP"
.ti -1c
.RI "\fBValue\fP \fBoperator[]\fP (int i) const "
.br
.RI "\fIEquivalent to \fBat\fP. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBList\fP \fBdynamicCast\fP (const  \fBValue\fP &v)"
.br
.RI "\fIConverts a \fBValue\fP into an \fBList\fP. \fP"
.ti -1c
.RI "const  \fBList\fP \fBempty\fP ()"
.br
.RI "\fIReturns a pointer to a static instance of an empty list. \fP"
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBListIterator\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 \fBcopy()\fP returns a deep copy of the list the referenced objects are still shared. 
.PP
Definition at line 132 of file types.h.
.SH "Member Function Documentation"
.PP 
.SS "\fBList\fP List::dynamicCast (const \fBValue\fP & v)\fC [static]\fP"
.PP
Converts a \fBValue\fP into an \fBList\fP. If the value's type is not ListType, a null object will be returned (i.e. one with it's internal pointer set to 0). If you do not know for sure whether the value is of type \fBList\fP, you should check the \fBisNull\fP() methods afterwards before calling any methods on the returned value.
.PP
\fBReturns:\fP
.RS 4
The value converted to an \fBList\fP 
.RE
.PP
Definition at line 189 of file types.cpp.
.PP
References KJS::Value::imp(), KJS::Value::isNull(), and KJS::Value::type().
.SS "void List::append (const \fBValue\fP & val)"
.PP
Append an object to the end of the list. \fBParameters:\fP
.RS 4
\fIval\fP Pointer to object. 
.RE
.PP
Definition at line 197 of file types.cpp.
.PP
Referenced by KJS::Error::create().
.SS "void List::prepend (const \fBValue\fP & val)"
.PP
Insert an object at the beginning of the list. \fBParameters:\fP
.RS 4
\fIval\fP Pointer to object. 
.RE
.PP
Definition at line 202 of file types.cpp.
.SS "void List::appendList (const \fBList\fP & lst)"
.PP
Appends the items of another list at the end of this one. Definition at line 207 of file types.cpp.
.SS "void List::prependList (const \fBList\fP & lst)"
.PP
Prepend the items of another list to this one. The first item of \fClst\fP will become the first item of the list. Definition at line 212 of file types.cpp.
.SS "void List::removeFirst ()"
.PP
Remove the element at the beginning of the list. Definition at line 217 of file types.cpp.
.SS "void List::removeLast ()"
.PP
Remove the element at the end of the list. Definition at line 222 of file types.cpp.
.SS "void List::clear ()"
.PP
Remove all elements from the list. Definition at line 232 of file types.cpp.
.SS "\fBList\fP List::copy () const"
.PP
Returns a deep copy of the list. Ownership is passed to the user who is responsible for deleting the list then. Definition at line 237 of file types.cpp.
.SS "\fBListIterator\fP List::begin () const"
.PP
\fBReturns:\fP
.RS 4
A \fBKJS::ListIterator\fP pointing to the first element. 
.RE
.PP
Definition at line 242 of file types.cpp.
.SS "\fBListIterator\fP List::end () const"
.PP
\fBReturns:\fP
.RS 4
A \fBKJS::ListIterator\fP pointing to the last element. 
.RE
.PP
Definition at line 247 of file types.cpp.
.SS "bool List::isEmpty () const"
.PP
\fBReturns:\fP
.RS 4
true if the list is empty. false otherwise. 
.RE
.PP
Definition at line 252 of file types.cpp.
.SS "int List::size () const"
.PP
\fBReturns:\fP
.RS 4
the current size of the list. 
.RE
.PP
Definition at line 257 of file types.cpp.
.SS "\fBValue\fP List::at (int i) const"
.PP
Retrieve an element at an indexed position. 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
Definition at line 262 of file types.cpp.
.SS "\fBValue\fP List::operator[] (int i) const"
.PP
Equivalent to \fBat\fP. Definition at line 267 of file types.cpp.
.SS "const  \fBList\fP List::empty ()\fC [static]\fP"
.PP
Returns a pointer to a static instance of an empty list. Useful if a function has a \fBList\fP parameter. Definition at line 272 of file types.cpp.

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