\section{KJS::List Class Reference}
\label{classKJS_1_1List}\index{KJS::List@{KJS::List}}
Native list type.  


{\tt \#include $<$list.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf List} (bool needs\-Marking)\label{classKJS_1_1List_a1}

\item 
{\bf List} (const {\bf List} \&b)\label{classKJS_1_1List_a3}

\item 
{\bf List} \& {\bf operator=} (const {\bf List} \&)\label{classKJS_1_1List_a4}

\item 
void {\bf append} (const {\bf Value} \&val)
\item 
void {\bf append} ({\bf Value\-Imp} $\ast$val)\label{classKJS_1_1List_a6}

\item 
void {\bf clear} ()
\item 
{\bf List} {\bf copy} () const 
\item 
{\bf List} {\bf copy\-Tail} () const 
\item 
bool {\bf is\-Empty} () const 
\item 
int {\bf size} () const 
\item 
{\bf List\-Iterator} {\bf begin} () const 
\item 
{\bf List\-Iterator} {\bf end} () const 
\item 
{\bf Value} {\bf at} (int i) const 
\item 
{\bf Value} {\bf operator[$\,$]} (int i) const 
\item 
{\bf Value\-Imp} $\ast$ {\bf imp\-At} (int i) const \label{classKJS_1_1List_a16}

\item 
void {\bf mark} ()\label{classKJS_1_1List_a17}

\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static const {\bf List} \& {\bf empty} ()
\end{CompactItemize}


\subsection{Detailed Description}
Native list type. 

{\bf List}{\rm (p.\,\pageref{classKJS_1_1List})} is a native ECMAScript type. {\bf List}{\rm (p.\,\pageref{classKJS_1_1List})} values are only used for intermediate results of expression evaluation and cannot be stored as properties of objects.

The list is explicitly shared. Note that while {\bf copy\-Tail()}{\rm (p.\,\pageref{classKJS_1_1List_a9})} returns a copy of the list the referenced objects are still shared. 



Definition at line 48 of file list.h.

\subsection{Member Function Documentation}
\index{KJS::List@{KJS::List}!append@{append}}
\index{append@{append}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJS::List::append (const {\bf Value} \& {\em val})\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1List_a5}


Append an object to the end of the list. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em val}]Pointer to object. \end{description}
\end{Desc}


Definition at line 66 of file list.h.

Referenced by KJS::Error::create().\index{KJS::List@{KJS::List}!clear@{clear}}
\index{clear@{clear}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJS::List::clear ()}\label{classKJS_1_1List_a7}


Remove all elements from the list. 



Definition at line 238 of file list.cpp.\index{KJS::List@{KJS::List}!copy@{copy}}
\index{copy@{copy}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf List} KJS::List::copy () const}\label{classKJS_1_1List_a8}


Make a copy of the list. 



Definition at line 281 of file list.cpp.

References KShortcut::append().

Referenced by copy\-Tail().\index{KJS::List@{KJS::List}!copyTail@{copyTail}}
\index{copyTail@{copyTail}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf List} KJS::List::copy\-Tail () const}\label{classKJS_1_1List_a9}


Make a copy of the list, omitting the first element. 



Definition at line 302 of file list.cpp.

References KShortcut::append(), and copy().\index{KJS::List@{KJS::List}!isEmpty@{isEmpty}}
\index{isEmpty@{isEmpty}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KJS::List::is\-Empty () const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1List_a10}


\begin{Desc}
\item[Returns:]true if the list is empty. false otherwise. \end{Desc}


Definition at line 86 of file list.h.\index{KJS::List@{KJS::List}!size@{size}}
\index{size@{size}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KJS::List::size () const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1List_a11}


\begin{Desc}
\item[Returns:]the current size of the list. \end{Desc}


Definition at line 90 of file list.h.

Referenced by end().\index{KJS::List@{KJS::List}!begin@{begin}}
\index{begin@{begin}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf List\-Iterator} KJS::List::begin () const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1List_a12}


\begin{Desc}
\item[Returns:]A {\bf KJS::List\-Iterator}{\rm (p.\,\pageref{classKJS_1_1ListIterator})} pointing to the first element. \end{Desc}


Definition at line 186 of file list.h.\index{KJS::List@{KJS::List}!end@{end}}
\index{end@{end}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf List\-Iterator} KJS::List::end () const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1List_a13}


\begin{Desc}
\item[Returns:]A {\bf KJS::List\-Iterator}{\rm (p.\,\pageref{classKJS_1_1ListIterator})} pointing to the last element. \end{Desc}


Definition at line 187 of file list.h.

References size().\index{KJS::List@{KJS::List}!at@{at}}
\index{at@{at}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Value} KJS::List::at (int {\em i}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1List_a14}


Retrieve an element at an indexed position. 

If you want to iterate trough the whole list using {\bf KJS::List\-Iterator}{\rm (p.\,\pageref{classKJS_1_1ListIterator})} will be faster.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em i}]{\bf List}{\rm (p.\,\pageref{classKJS_1_1List})} index. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Return the element at position i. {\bf KJS::Undefined}{\rm (p.\,\pageref{classKJS_1_1Undefined})} if the index is out of range. \end{Desc}


Definition at line 108 of file list.h.\index{KJS::List@{KJS::List}!operator[]@{operator[]}}
\index{operator[]@{operator[]}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Value} KJS::List::operator[$\,$] (int {\em i}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1List_a15}


Equivalent to at. 



Definition at line 112 of file list.h.\index{KJS::List@{KJS::List}!empty@{empty}}
\index{empty@{empty}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf List} \& KJS::List::empty ()\hspace{0.3cm}{\tt  [static]}}\label{classKJS_1_1List_e0}


Returns a pointer to a static instance of an empty list. 

Useful if a function has a KJS::List parameter. 

Definition at line 322 of file list.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
list.h\item 
list.cpp\end{CompactItemize}
