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


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

Inheritance diagram for KJS::List:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=49pt]{classKJS_1_1List__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KJS::List:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=59pt]{classKJS_1_1List__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf List} (List\-Imp $\ast$v)\label{classKJS_1_1List_a1}

\item 
{\bf List} (const  {\bf List} \&v)\label{classKJS_1_1List_a2}

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

\item 
void {\bf append} (const  {\bf Value} \&val)
\begin{CompactList}\small\item\em Append an object to the end of the list. \item\end{CompactList}\item 
void {\bf prepend} (const  {\bf Value} \&val)
\begin{CompactList}\small\item\em Insert an object at the beginning of the list. \item\end{CompactList}\item 
void {\bf append\-List} (const  {\bf List} \&lst)
\begin{CompactList}\small\item\em Appends the items of another list at the end of this one. \item\end{CompactList}\item 
void {\bf prepend\-List} (const  {\bf List} \&lst)
\begin{CompactList}\small\item\em Prepend the items of another list to this one. \item\end{CompactList}\item 
void {\bf remove\-First} ()
\begin{CompactList}\small\item\em Remove the element at the beginning of the list. \item\end{CompactList}\item 
void {\bf remove\-Last} ()
\begin{CompactList}\small\item\em Remove the element at the end of the list. \item\end{CompactList}\item 
void {\bf remove} (const  {\bf Value} \&val)\label{classKJS_1_1List_a11}

\item 
void {\bf clear} ()
\begin{CompactList}\small\item\em Remove all elements from the list. \item\end{CompactList}\item 
{\bf List} {\bf copy} () const 
\begin{CompactList}\small\item\em Returns a deep copy of the list. \item\end{CompactList}\item 
{\bf List\-Iterator} {\bf begin} () const 
\item 
{\bf List\-Iterator} {\bf end} () const 
\item 
bool {\bf is\-Empty} () const 
\item 
int {\bf size} () const 
\item 
{\bf Value} {\bf at} (int i) const 
\begin{CompactList}\small\item\em Retrieve an element at an indexed position. \item\end{CompactList}\item 
{\bf Value} {\bf operator[$\,$]} (int i) const 
\begin{CompactList}\small\item\em Equivalent to {\bf at}{\rm (p.\,\pageref{classKJS_1_1List_a18})}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf List} {\bf dynamic\-Cast} (const  {\bf Value} \&v)
\begin{CompactList}\small\item\em Converts a {\bf Value}{\rm (p.\,\pageref{classKJS_1_1Value})} into an {\bf List}{\rm (p.\,\pageref{classKJS_1_1List})}. \item\end{CompactList}\item 
const  {\bf List} {\bf empty} ()
\begin{CompactList}\small\item\em Returns a pointer to a static instance of an empty list. \item\end{CompactList}\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf List\-Iterator}\label{classKJS_1_1List_n0}

\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()}{\rm (p.\,\pageref{classKJS_1_1List_a13})} returns a deep copy of the list the referenced objects are still shared. 



Definition at line 132 of file types.h.

\subsection{Member Function Documentation}
\index{KJS::List@{KJS::List}!dynamicCast@{dynamicCast}}
\index{dynamicCast@{dynamicCast}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf List} List::dynamic\-Cast (const {\bf Value} \& {\em v})\hspace{0.3cm}{\tt  [static]}}\label{classKJS_1_1List_e0}


Converts a {\bf Value}{\rm (p.\,\pageref{classKJS_1_1Value})} into an {\bf List}{\rm (p.\,\pageref{classKJS_1_1List})}. 

If the value's type is not List\-Type, 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 {\bf List}{\rm (p.\,\pageref{classKJS_1_1List})}, you should check the {\bf is\-Null}{\rm (p.\,\pageref{classKJS_1_1Value_a6})}() methods afterwards before calling any methods on the returned value.

\begin{Desc}
\item[Returns:]The value converted to an {\bf List}{\rm (p.\,\pageref{classKJS_1_1List})} \end{Desc}


Definition at line 189 of file types.cpp.

References KJS::Value::imp(), KJS::Value::is\-Null(), and KJS::Value::type().\index{KJS::List@{KJS::List}!append@{append}}
\index{append@{append}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void List::append (const {\bf Value} \& {\em val})}\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 197 of file types.cpp.

Referenced by KJS::Error::create().\index{KJS::List@{KJS::List}!prepend@{prepend}}
\index{prepend@{prepend}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void List::prepend (const {\bf Value} \& {\em val})}\label{classKJS_1_1List_a6}


Insert an object at the beginning of the list. 

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


Definition at line 202 of file types.cpp.\index{KJS::List@{KJS::List}!appendList@{appendList}}
\index{appendList@{appendList}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void List::append\-List (const {\bf List} \& {\em lst})}\label{classKJS_1_1List_a7}


Appends the items of another list at the end of this one. 



Definition at line 207 of file types.cpp.\index{KJS::List@{KJS::List}!prependList@{prependList}}
\index{prependList@{prependList}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void List::prepend\-List (const {\bf List} \& {\em lst})}\label{classKJS_1_1List_a8}


Prepend the items of another list to this one. 

The first item of {\tt lst} will become the first item of the list. 

Definition at line 212 of file types.cpp.\index{KJS::List@{KJS::List}!removeFirst@{removeFirst}}
\index{removeFirst@{removeFirst}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void List::remove\-First ()}\label{classKJS_1_1List_a9}


Remove the element at the beginning of the list. 



Definition at line 217 of file types.cpp.\index{KJS::List@{KJS::List}!removeLast@{removeLast}}
\index{removeLast@{removeLast}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void List::remove\-Last ()}\label{classKJS_1_1List_a10}


Remove the element at the end of the list. 



Definition at line 222 of file types.cpp.\index{KJS::List@{KJS::List}!clear@{clear}}
\index{clear@{clear}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void List::clear ()}\label{classKJS_1_1List_a12}


Remove all elements from the list. 



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


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.\index{KJS::List@{KJS::List}!begin@{begin}}
\index{begin@{begin}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf List\-Iterator} List::begin () const}\label{classKJS_1_1List_a14}


\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 242 of file types.cpp.\index{KJS::List@{KJS::List}!end@{end}}
\index{end@{end}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf List\-Iterator} List::end () const}\label{classKJS_1_1List_a15}


\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 247 of file types.cpp.\index{KJS::List@{KJS::List}!isEmpty@{isEmpty}}
\index{isEmpty@{isEmpty}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool List::is\-Empty () const}\label{classKJS_1_1List_a16}


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


Definition at line 252 of file types.cpp.\index{KJS::List@{KJS::List}!size@{size}}
\index{size@{size}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int List::size () const}\label{classKJS_1_1List_a17}


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


Definition at line 257 of file types.cpp.\index{KJS::List@{KJS::List}!at@{at}}
\index{at@{at}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Value} List::at (int {\em i}) const}\label{classKJS_1_1List_a18}


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 262 of file types.cpp.\index{KJS::List@{KJS::List}!operator[]@{operator[]}}
\index{operator[]@{operator[]}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Value} List::operator[$\,$] (int {\em i}) const}\label{classKJS_1_1List_a19}


Equivalent to {\bf at}{\rm (p.\,\pageref{classKJS_1_1List_a18})}. 



Definition at line 267 of file types.cpp.\index{KJS::List@{KJS::List}!empty@{empty}}
\index{empty@{empty}!KJS::List@{KJS::List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const  {\bf List} List::empty ()\hspace{0.3cm}{\tt  [static]}}\label{classKJS_1_1List_e1}


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

Useful if a function has a {\bf List}{\rm (p.\,\pageref{classKJS_1_1List})} parameter. 

Definition at line 272 of file types.cpp.

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