3 <!-- This HTML file has been created by texi2html 1.54
4 from suif1.texi on 28 April 1999 -->
6 <TITLE>The SUIF Version
1 Library - Association Lists
</TITLE>
7 <link href=
"suif1_95.html" rel=Next
>
8 <link href=
"suif1_93.html" rel=Previous
>
9 <link href=
"suif1_toc.html" rel=ToC
>
13 <p>Go to the
<A HREF=
"suif1_1.html">first
</A>,
<A HREF=
"suif1_93.html">previous
</A>,
<A HREF=
"suif1_95.html">next
</A>,
<A HREF=
"suif1_113.html">last
</A> section,
<A HREF=
"suif1_toc.html">table of contents
</A>.
17 <H2><A NAME=
"SEC94" HREF=
"suif1_toc.html#TOC94">Association Lists
</A></H2>
26 An association list element contains both a key and a data pointer. The
27 data associated with a particular key can be retrieved with a simple
28 lookup method. The key and data fields are both
<CODE>void*
</CODE> pointers.
29 Association lists are implemented by the
<CODE>alist
</CODE> and
<CODE>alist_e
</CODE>
30 classes in the files
<TT>`alist.h'
</TT> and
<TT>`alist.cc'
</TT>. These classes
31 are derived from the generic list classes (see section
<A HREF=
"suif1_92.html#SEC92">Generic Lists
</A>) and
37 The
<CODE>amtflist
</CODE> class has the same interface as the
<CODE>alist
</CODE>
38 class and provides the same functionality. The only difference is that
39 it is based on the move-to-front list class. See section
<A HREF=
"suif1_93.html#SEC93">Move-to-front Lists
</A>. You may want to use this if you expect your application to
40 access list elements with a high degree of locality.
45 Like all of the other SUIF lists, the association lists have iterators
46 to make it easy for you to traverse them. The
<CODE>alist_iter
</CODE> class
47 uses the same interface as the generic list iterator and works for both
48 <CODE>alist
</CODE> and
<CODE>amtflist
</CODE> objects.
53 <p>Go to the
<A HREF=
"suif1_1.html">first
</A>,
<A HREF=
"suif1_93.html">previous
</A>,
<A HREF=
"suif1_95.html">next
</A>,
<A HREF=
"suif1_113.html">last
</A> section,
<A HREF=
"suif1_toc.html">table of contents
</A>.