\hypertarget{classDictionaryADT}{
\section{Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$ Class Template Reference}
\label{classDictionaryADT}\index{DictionaryADT@{DictionaryADT}}
}
{\tt \#include $<$Dictionary\-ADT.hh$>$}

Inheritance diagram for Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classDictionaryADT}
\end{center}
\end{figure}


\subsection{Detailed Description}
\subsubsection*{template$<$typename Key\-Type, typename Value\-Type$>$ class Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$}

This abstract class gives the basic interface of the Dictionary\-ADT.

A Dictionary\-ADT is a map type structure which maps keys to values.  Dupliucate keys are not allowed. 



Definition at line 28 of file Dictionary\-ADT.hh.\subsection*{Public Types}
\begin{CompactItemize}
\item 
typedef std::pair$<$ Key\-Type, Value\-Type $>$ \hyperlink{classDictionaryADT_s0}{Entry}
\begin{CompactList}\small\item\em Represents a Key/Value pair in the Dictionary.\item\end{CompactList}\item 
typedef std::vector$<$ \hyperlink{classDictionaryADT_s0}{Entry} $>$ \hyperlink{classDictionaryADT_s1}{Entry\-List}
\begin{CompactList}\small\item\em A list of Key/Value pairs used by the {\tt get\-Entry\-List} function.\item\end{CompactList}\end{CompactItemize}
\subsection*{Public Methods}
\begin{CompactItemize}
\item 
virtual \hyperlink{classDictionaryADT_a0}{$\sim$Dictionary\-ADT} ()
\begin{CompactList}\small\item\em Virtual destructor with trival implementation.\item\end{CompactList}\item 
virtual int \hyperlink{classDictionaryADT_a1}{get\-Size} (void) const=0
\begin{CompactList}\small\item\em Returns the number of elements in the Dictionary.\item\end{CompactList}\item 
virtual bool \hyperlink{classDictionaryADT_a2}{find} (const Key\-Type \&key, Value\-Type \&value) const=0
\begin{CompactList}\small\item\em Given a key, 'returns' (via a reference parameter) the value associated with it in this Dictionary.\item\end{CompactList}\item 
virtual int \hyperlink{classDictionaryADT_a3}{get\-Entry\-List} (\hyperlink{classDictionaryADT_s1}{Entry\-List} \&entries) const=0
\begin{CompactList}\small\item\em \char`\"{}Returns\char`\"{} a list of all the Key/Value pairs in the tree.\item\end{CompactList}\item 
virtual bool \hyperlink{classDictionaryADT_a4}{insert} (const Key\-Type \&key, const Value\-Type \&value)=0
\begin{CompactList}\small\item\em Inserts a new key/value pair into the Dictionary.\item\end{CompactList}\item 
virtual bool \hyperlink{classDictionaryADT_a5}{change\-Value} (const Key\-Type \&old\-Key, const Value\-Type \&new\-Value)=0
\begin{CompactList}\small\item\em Changes the value associated with an existing key in the Dictionary (old\-Key) to a new value.\item\end{CompactList}\item 
virtual bool \hyperlink{classDictionaryADT_a6}{insert} (const \hyperlink{classDictionaryADT_s0}{Entry} \&entry)=0
\begin{CompactList}\small\item\em Same as the the other {\tt insert} function, but takes an {\tt Entry} rather than seperate key and value arguments.\item\end{CompactList}\item 
virtual bool \hyperlink{classDictionaryADT_a7}{change\-Value} (const \hyperlink{classDictionaryADT_s0}{Entry} \&entry)=0
\begin{CompactList}\small\item\em Same as the the other {\tt Change\-Value} function, but takes an {\tt Entry} rather than seperate key and value argument.\item\end{CompactList}\item 
virtual std::ostream \& \hyperlink{classDictionaryADT_a8}{print} (std::ostream \&out=std::cerr) const=0
\begin{CompactList}\small\item\em Pretty-Print out a view of this Dictionary for debugging purposes.\item\end{CompactList}\end{CompactItemize}


\subsection{Member Typedef Documentation}
\hypertarget{classDictionaryADT_s0}{
\index{DictionaryADT@{Dictionary\-ADT}!Entry@{Entry}}
\index{Entry@{Entry}!DictionaryADT@{Dictionary\-ADT}}
\subsubsection[Entry]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Key\-Type, typename Value\-Type$>$ typedef std::pair$<$Key\-Type, Value\-Type$>$ Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::Entry}}
\label{classDictionaryADT_s0}


Represents a Key/Value pair in the Dictionary.



Reimplemented in \hyperlink{classBinarySearchTree_s0}{Binary\-Search\-Tree$<$ Key\-Type, Value\-Type $>$}.

Definition at line 36 of file Dictionary\-ADT.hh.\hypertarget{classDictionaryADT_s1}{
\index{DictionaryADT@{Dictionary\-ADT}!EntryList@{EntryList}}
\index{EntryList@{EntryList}!DictionaryADT@{Dictionary\-ADT}}
\subsubsection[EntryList]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Key\-Type, typename Value\-Type$>$ typedef std::vector$<$\hyperlink{classDictionaryADT_s0}{Entry}$>$ Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::Entry\-List}}
\label{classDictionaryADT_s1}


A list of Key/Value pairs used by the {\tt get\-Entry\-List} function.



Reimplemented in \hyperlink{classBinarySearchTree_s1}{Binary\-Search\-Tree$<$ Key\-Type, Value\-Type $>$}.

Definition at line 39 of file Dictionary\-ADT.hh.

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classDictionaryADT_a0}{
\index{DictionaryADT@{Dictionary\-ADT}!~DictionaryADT@{$\sim$DictionaryADT}}
\index{~DictionaryADT@{$\sim$DictionaryADT}!DictionaryADT@{Dictionary\-ADT}}
\subsubsection[$\sim$DictionaryADT]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Key\-Type, typename Value\-Type$>$ virtual Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::$\sim$Dictionary\-ADT ()\hspace{0.3cm}{\tt  \mbox{[}inline, virtual\mbox{]}}}}
\label{classDictionaryADT_a0}


Virtual destructor with trival implementation.

Why do you think this is necessary? 

Definition at line 45 of file Dictionary\-ADT.hh.

\subsection{Member Function Documentation}
\hypertarget{classDictionaryADT_a7}{
\index{DictionaryADT@{Dictionary\-ADT}!changeValue@{changeValue}}
\index{changeValue@{changeValue}!DictionaryADT@{Dictionary\-ADT}}
\subsubsection[changeValue]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Key\-Type, typename Value\-Type$>$ virtual bool Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::change\-Value (const \hyperlink{classDictionaryADT_s0}{Entry} \& {\em entry})\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}
\label{classDictionaryADT_a7}


Same as the the other {\tt Change\-Value} function, but takes an {\tt Entry} rather than seperate key and value argument.

\begin{Desc}
\item[Returns :]\par
{\tt true} if the data was changed,  {\tt false} otherwise.\end{Desc}
\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
entry}]The entry representing the key/value information  to be changed in the Dictionary. \end{description}
\end{Desc}


Implemented in \hyperlink{classBinarySearchTree_a11}{Binary\-Search\-Tree$<$ Key\-Type, Value\-Type $>$}.\hypertarget{classDictionaryADT_a5}{
\index{DictionaryADT@{Dictionary\-ADT}!changeValue@{changeValue}}
\index{changeValue@{changeValue}!DictionaryADT@{Dictionary\-ADT}}
\subsubsection[changeValue]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Key\-Type, typename Value\-Type$>$ virtual bool Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::change\-Value (const Key\-Type \& {\em old\-Key}, const Value\-Type \& {\em new\-Value})\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}
\label{classDictionaryADT_a5}


Changes the value associated with an existing key in the Dictionary (old\-Key) to a new value.

Assumes 'old\-Key' exists in  the Dictionary.

\begin{Desc}
\item[Returns :]\par
{\tt true} if the data was changed,  {\tt false} otherwise.\end{Desc}
\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
old\-Key}]The key whose value will be changed. \item[{\em 
new\-Value}]The new value to be associated with {\tt old\-Key}. \end{description}
\end{Desc}


Implemented in \hyperlink{classBinarySearchTree_a9}{Binary\-Search\-Tree$<$ Key\-Type, Value\-Type $>$}.\hypertarget{classDictionaryADT_a2}{
\index{DictionaryADT@{Dictionary\-ADT}!find@{find}}
\index{find@{find}!DictionaryADT@{Dictionary\-ADT}}
\subsubsection[find]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Key\-Type, typename Value\-Type$>$ virtual bool Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::find (const Key\-Type \& {\em key}, Value\-Type \& {\em value}) const\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}
\label{classDictionaryADT_a2}


Given a key, 'returns' (via a reference parameter) the value associated with it in this Dictionary.

\begin{Desc}
\item[Returns :]\par
{\tt true} if the key is in the Dictionary,  {\tt false} otherwise. If the key is not in the  Dictionary, the value of {\tt value} is undefined.\end{Desc}
\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
key}]The key to search for. \item[{\em 
value}]output parameter to hold a copy of the value for the given key. \end{description}
\end{Desc}


Implemented in \hyperlink{classBinarySearchTree_a5}{Binary\-Search\-Tree$<$ Key\-Type, Value\-Type $>$}.\hypertarget{classDictionaryADT_a3}{
\index{DictionaryADT@{Dictionary\-ADT}!getEntryList@{getEntryList}}
\index{getEntryList@{getEntryList}!DictionaryADT@{Dictionary\-ADT}}
\subsubsection[getEntryList]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Key\-Type, typename Value\-Type$>$ virtual int Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::get\-Entry\-List (\hyperlink{classDictionaryADT_s1}{Entry\-List} \& {\em entries}) const\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}
\label{classDictionaryADT_a3}


\char`\"{}Returns\char`\"{} a list of all the Key/Value pairs in the tree.

The Key/Value pairs may be in any order.

\begin{Desc}
\item[Returns :]\par
an {\tt int} specifying the number of elements  in the arrays. -1 if there was an error.\end{Desc}
\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
entries}]output parameter that holds the list of key/value pairs in the Dictionary. The original contents of  the list is erased. \end{description}
\end{Desc}


Implemented in \hyperlink{classBinarySearchTree_a6}{Binary\-Search\-Tree$<$ Key\-Type, Value\-Type $>$}.\hypertarget{classDictionaryADT_a1}{
\index{DictionaryADT@{Dictionary\-ADT}!getSize@{getSize}}
\index{getSize@{getSize}!DictionaryADT@{Dictionary\-ADT}}
\subsubsection[getSize]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Key\-Type, typename Value\-Type$>$ virtual int Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::get\-Size (void) const\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}
\label{classDictionaryADT_a1}


Returns the number of elements in the Dictionary.

\begin{Desc}
\item[Returns :]\par
the number of elements in the dictionary. \end{Desc}


Implemented in \hyperlink{classBinarySearchTree_a4}{Binary\-Search\-Tree$<$ Key\-Type, Value\-Type $>$}.\hypertarget{classDictionaryADT_a6}{
\index{DictionaryADT@{Dictionary\-ADT}!insert@{insert}}
\index{insert@{insert}!DictionaryADT@{Dictionary\-ADT}}
\subsubsection[insert]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Key\-Type, typename Value\-Type$>$ virtual bool Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::insert (const \hyperlink{classDictionaryADT_s0}{Entry} \& {\em entry})\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}
\label{classDictionaryADT_a6}


Same as the the other {\tt insert} function, but takes an {\tt Entry} rather than seperate key and value arguments.

\begin{Desc}
\item[Returns :]\par
{\tt true} if this key did not previously exist  in the Dictionary. {\tt false} otherwise.\end{Desc}
\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
entry}]The new key/value pair to be inserted into the  Dictionary. \end{description}
\end{Desc}


Implemented in \hyperlink{classBinarySearchTree_a10}{Binary\-Search\-Tree$<$ Key\-Type, Value\-Type $>$}.\hypertarget{classDictionaryADT_a4}{
\index{DictionaryADT@{Dictionary\-ADT}!insert@{insert}}
\index{insert@{insert}!DictionaryADT@{Dictionary\-ADT}}
\subsubsection[insert]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Key\-Type, typename Value\-Type$>$ virtual bool Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::insert (const Key\-Type \& {\em key}, const Value\-Type \& {\em value})\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}
\label{classDictionaryADT_a4}


Inserts a new key/value pair into the Dictionary.

If the key  previously existed in the Dictionary, will overwrite the old value with  the new value.

\begin{Desc}
\item[Returns :]\par
{\tt true} if this key did not previously exist  in the tree, {\tt false} otherwise.\end{Desc}
\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
key}]The new key with which {\tt value} will be associated. \item[{\em 
value}]the value to be associated with {\tt key}. \end{description}
\end{Desc}


Implemented in \hyperlink{classBinarySearchTree_a8}{Binary\-Search\-Tree$<$ Key\-Type, Value\-Type $>$}.\hypertarget{classDictionaryADT_a8}{
\index{DictionaryADT@{Dictionary\-ADT}!print@{print}}
\index{print@{print}!DictionaryADT@{Dictionary\-ADT}}
\subsubsection[print]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Key\-Type, typename Value\-Type$>$ virtual std::ostream\& Dictionary\-ADT$<$ Key\-Type, Value\-Type $>$::print (std::ostream \& {\em out} = std::cerr) const\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}
\label{classDictionaryADT_a8}


Pretty-Print out a view of this Dictionary for debugging purposes.

This code requires operator$<$$<$ for both Key\-Type and Value\-Type, so  you can remove this if you're not debugging. You can \char`\"{}turn off\char`\"{} printing by compiling in \char`\"{}release mode\char`\"{} (ie, by defining \char`\"{}NDEBUG\char`\"{})

\begin{Desc}
\item[Returns :]\par
The ostream used by the print function. This is  mainly a convienience thing.\end{Desc}
\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
out}]The output stream to pretty-print the Dictionary to. This funciton defaults to cerr. \end{description}
\end{Desc}


Implemented in \hyperlink{classBinarySearchTree_a7}{Binary\-Search\-Tree$<$ Key\-Type, Value\-Type $>$}.

The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
\hyperlink{DictionaryADT_8hh}{Dictionary\-ADT.hh}\end{CompactItemize}
