1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
5<!-- Generated by javadoc (build 1.5.0_04) on Sun Feb 19 05:15:29 PST 2006 -->
6<TITLE>
7DiskStrategy (JPostal API)
8</TITLE>
9
10<META NAME="keywords" CONTENT="org.ahmadsoft.postal.DiskStrategy class">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="/stylesheet.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17    parent.document.title="DiskStrategy (JPostal API)";
18}
19</SCRIPT>
20<NOSCRIPT>
21</NOSCRIPT>
22
23</HEAD>
24
25<BODY BGCOLOR="white" onload="windowTitle();">
26
27
28<!-- ========= START OF TOP NAVBAR ======= -->
29<A NAME="navbar_top"><!-- --></A>
30<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
31<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
32<TR>
33<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
34<A NAME="navbar_top_firstrow"><!-- --></A>
35<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
36  <TR ALIGN="center" VALIGN="top">
37  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/org/ahmadsoft/postal/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
38  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
39  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DiskStrategy.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
40  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
44  </TR>
45</TABLE>
46</TD>
47<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
48</EM>
49</TD>
50</TR>
51
52<TR>
53<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
54&nbsp;PREV CLASS&nbsp;
55&nbsp;<A HREF="/org/ahmadsoft/postal/InMemoryStrategy.html" title="class in org.ahmadsoft.postal"><B>NEXT CLASS</B></A></FONT></TD>
56<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57  <A HREF="/index.html?org/ahmadsoft/postal/DiskStrategy.html" target="_top"><B>FRAMES</B></A>  &nbsp;
58&nbsp;<A HREF="DiskStrategy.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
59&nbsp;<SCRIPT type="text/javascript">
60  <!--
61  if(window==top) {
62    document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>');
63  }
64  //-->
65</SCRIPT>
66<NOSCRIPT>
67  <A HREF="/allclasses-noframe.html"><B>All Classes</B></A>
68</NOSCRIPT>
69
70
71</FONT></TD>
72</TR>
73<TR>
74<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
75  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
76<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
78</TR>
79</TABLE>
80<A NAME="skip-navbar_top"></A>
81<!-- ========= END OF TOP NAVBAR ========= -->
82
83<HR>
84<!-- ======== START OF CLASS DATA ======== -->
85<H2>
86<FONT SIZE="-1">
87org.ahmadsoft.postal</FONT>
88<BR>
89Class DiskStrategy</H2>
90<PRE>
91java.lang.Object
92  <IMG SRC="/resources/inherit.gif" ALT="extended by "><B>org.ahmadsoft.postal.DiskStrategy</B>
93</PRE>
94<DL>
95<DT><B>All Implemented Interfaces:</B> <DD><A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html" title="interface in org.ahmadsoft.postal">PostalRetrievalStrategy</A></DD>
96</DL>
97<HR>
98<DL>
99<DT><PRE>public class <B>DiskStrategy</B><DT>extends java.lang.Object<DT>implements <A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html" title="interface in org.ahmadsoft.postal">PostalRetrievalStrategy</A></DL>
100</PRE>
101
102<P>
103A retrieval strategy that looks up from disk every time. There is
104 almost no reason to use this strategy except in an interactive program
105 because, due to the fact that lookups are synchronized, and that every
106 lookup results in a disk access, its time characteristics are very poor.
107 However, its space requirements are constant.
108<P>
109
110<P>
111<DL>
112<DT><B>Author:</B></DT>
113  <DD>Amin Ahmad</DD>
114</DL>
115<HR>
116
117<P>
118
119<!-- ======== CONSTRUCTOR SUMMARY ======== -->
120
121<A NAME="constructor_summary"><!-- --></A>
122<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
123<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
124<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
125<B>Constructor Summary</B></FONT></TH>
126</TR>
127<TR BGCOLOR="white" CLASS="TableRowColor">
128<TD><CODE><B><A HREF="/org/ahmadsoft/postal/DiskStrategy.html#DiskStrategy()">DiskStrategy</A></B>()</CODE>
129
130<BR>
131&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
132</TR>
133</TABLE>
134&nbsp;
135<!-- ========== METHOD SUMMARY =========== -->
136
137<A NAME="method_summary"><!-- --></A>
138<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
139<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
140<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
141<B>Method Summary</B></FONT></TH>
142</TR>
143<TR BGCOLOR="white" CLASS="TableRowColor">
144<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
145<CODE>&nbsp;void</CODE></FONT></TD>
146<TD><CODE><B><A HREF="/org/ahmadsoft/postal/DiskStrategy.html#dispose()">dispose</A></B>()</CODE>
147
148<BR>
149&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
150</TR>
151<TR BGCOLOR="white" CLASS="TableRowColor">
152<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
153<CODE>&nbsp;java.util.List</CODE></FONT></TD>
154<TD><CODE><B><A HREF="/org/ahmadsoft/postal/DiskStrategy.html#getCandidates(int)">getCandidates</A></B>(int&nbsp;postalCode)</CODE>
155
156<BR>
157&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves a list of candidate cities for a 
158 specified postal code.</TD>
159</TR>
160<TR BGCOLOR="white" CLASS="TableRowColor">
161<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
162<CODE>&nbsp;void</CODE></FONT></TD>
163<TD><CODE><B><A HREF="/org/ahmadsoft/postal/DiskStrategy.html#initialize(java.io.File, java.io.File)">initialize</A></B>(java.io.File&nbsp;_indexFile,
164           java.io.File&nbsp;_dataFile)</CODE>
165
166<BR>
167&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes the retrieval strategy with the
168 postal code index and data files.</TD>
169</TR>
170</TABLE>
171&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
172<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
173<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
174<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
175</TR>
176<TR BGCOLOR="white" CLASS="TableRowColor">
177<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
178</TR>
179</TABLE>
180&nbsp;
181<P>
182
183<!-- ========= CONSTRUCTOR DETAIL ======== -->
184
185<A NAME="constructor_detail"><!-- --></A>
186<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
187<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
188<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
189<B>Constructor Detail</B></FONT></TH>
190</TR>
191</TABLE>
192
193<A NAME="DiskStrategy()"><!-- --></A><H3>
194DiskStrategy</H3>
195<PRE>
196public <B>DiskStrategy</B>()</PRE>
197<DL>
198</DL>
199
200<!-- ============ METHOD DETAIL ========== -->
201
202<A NAME="method_detail"><!-- --></A>
203<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
204<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
205<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
206<B>Method Detail</B></FONT></TH>
207</TR>
208</TABLE>
209
210<A NAME="initialize(java.io.File, java.io.File)"><!-- --></A><H3>
211initialize</H3>
212<PRE>
213public void <B>initialize</B>(java.io.File&nbsp;_indexFile,
214                       java.io.File&nbsp;_dataFile)
215                throws java.lang.Exception</PRE>
216<DL>
217<DD><B>Description copied from interface: <CODE><A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html#initialize(java.io.File, java.io.File)">PostalRetrievalStrategy</A></CODE></B></DD>
218<DD>Initializes the retrieval strategy with the
219 postal code index and data files.
220<P>
221<DD><DL>
222<DT><B>Specified by:</B><DD><CODE><A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html#initialize(java.io.File, java.io.File)">initialize</A></CODE> in interface <CODE><A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html" title="interface in org.ahmadsoft.postal">PostalRetrievalStrategy</A></CODE></DL>
223</DD>
224<DD><DL>
225
226<DT><B>Throws:</B>
227<DD><CODE>java.lang.Exception</CODE></DL>
228</DD>
229</DL>
230<HR>
231
232<A NAME="getCandidates(int)"><!-- --></A><H3>
233getCandidates</H3>
234<PRE>
235public java.util.List <B>getCandidates</B>(int&nbsp;postalCode)</PRE>
236<DL>
237<DD><B>Description copied from interface: <CODE><A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html#getCandidates(int)">PostalRetrievalStrategy</A></CODE></B></DD>
238<DD>Retrieves a list of candidate cities for a 
239 specified postal code.
240<P>
241<DD><DL>
242<DT><B>Specified by:</B><DD><CODE><A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html#getCandidates(int)">getCandidates</A></CODE> in interface <CODE><A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html" title="interface in org.ahmadsoft.postal">PostalRetrievalStrategy</A></CODE></DL>
243</DD>
244<DD><DL>
245<DT><B>Parameters:</B><DD><CODE>postalCode</CODE> - the postal code.
246<DT><B>Returns:</B><DD>a list of candidate cities.</DL>
247</DD>
248</DL>
249<HR>
250
251<A NAME="dispose()"><!-- --></A><H3>
252dispose</H3>
253<PRE>
254public void <B>dispose</B>()
255             throws java.lang.Exception</PRE>
256<DL>
257<DD><DL>
258<DT><B>Specified by:</B><DD><CODE><A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html#dispose()">dispose</A></CODE> in interface <CODE><A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html" title="interface in org.ahmadsoft.postal">PostalRetrievalStrategy</A></CODE></DL>
259</DD>
260<DD><DL>
261
262<DT><B>Throws:</B>
263<DD><CODE>java.lang.Exception</CODE></DL>
264</DD>
265</DL>
266<!-- ========= END OF CLASS DATA ========= -->
267<HR>
268
269
270<!-- ======= START OF BOTTOM NAVBAR ====== -->
271<A NAME="navbar_bottom"><!-- --></A>
272<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
273<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
274<TR>
275<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
276<A NAME="navbar_bottom_firstrow"><!-- --></A>
277<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
278  <TR ALIGN="center" VALIGN="top">
279  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/org/ahmadsoft/postal/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
280  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
281  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DiskStrategy.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
282  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
283  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
284  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
285  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
286  </TR>
287</TABLE>
288</TD>
289<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
290</EM>
291</TD>
292</TR>
293
294<TR>
295<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
296&nbsp;PREV CLASS&nbsp;
297&nbsp;<A HREF="/org/ahmadsoft/postal/InMemoryStrategy.html" title="class in org.ahmadsoft.postal"><B>NEXT CLASS</B></A></FONT></TD>
298<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
299  <A HREF="/index.html?org/ahmadsoft/postal/DiskStrategy.html" target="_top"><B>FRAMES</B></A>  &nbsp;
300&nbsp;<A HREF="DiskStrategy.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
301&nbsp;<SCRIPT type="text/javascript">
302  <!--
303  if(window==top) {
304    document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>');
305  }
306  //-->
307</SCRIPT>
308<NOSCRIPT>
309  <A HREF="/allclasses-noframe.html"><B>All Classes</B></A>
310</NOSCRIPT>
311
312
313</FONT></TD>
314</TR>
315<TR>
316<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
317  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
318<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
319DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
320</TR>
321</TABLE>
322<A NAME="skip-navbar_bottom"></A>
323<!-- ======== END OF BOTTOM NAVBAR ======= -->
324
325<HR>
326<i>Copyright &#169; 2006 Ahmadsoft. All Rights Reserved.</i>
327</BODY>
328</HTML>
329