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:30 PST 2006 -->
6<TITLE>
7ReadOnceStrategy (JPostal API)
8</TITLE>
9
10<META NAME="keywords" CONTENT="org.ahmadsoft.postal.ReadOnceStrategy 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="ReadOnceStrategy (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/ReadOnceStrategy.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;<A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html" title="interface in org.ahmadsoft.postal"><B>PREV CLASS</B></A>&nbsp;
55&nbsp;<A HREF="/org/ahmadsoft/postal/USPostalCodeService.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/ReadOnceStrategy.html" target="_top"><B>FRAMES</B></A>  &nbsp;
58&nbsp;<A HREF="ReadOnceStrategy.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 ReadOnceStrategy</H2>
90<PRE>
91java.lang.Object
92  <IMG SRC="/resources/inherit.gif" ALT="extended by "><B>org.ahmadsoft.postal.ReadOnceStrategy</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>ReadOnceStrategy</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 the first time
104 and subsequently reads from cache. The Read-Once strategy
105 is quite acceptable for day to day usage, its main problem
106 being that memory usage limits cannot be enforced.
107<P>
108
109<P>
110<DL>
111<DT><B>Author:</B></DT>
112  <DD>Amin Ahmad</DD>
113</DL>
114<HR>
115
116<P>
117
118<!-- ======== CONSTRUCTOR SUMMARY ======== -->
119
120<A NAME="constructor_summary"><!-- --></A>
121<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
122<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
123<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
124<B>Constructor Summary</B></FONT></TH>
125</TR>
126<TR BGCOLOR="white" CLASS="TableRowColor">
127<TD><CODE><B><A HREF="/org/ahmadsoft/postal/ReadOnceStrategy.html#ReadOnceStrategy()">ReadOnceStrategy</A></B>()</CODE>
128
129<BR>
130&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
131</TR>
132</TABLE>
133&nbsp;
134<!-- ========== METHOD SUMMARY =========== -->
135
136<A NAME="method_summary"><!-- --></A>
137<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
138<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
139<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
140<B>Method Summary</B></FONT></TH>
141</TR>
142<TR BGCOLOR="white" CLASS="TableRowColor">
143<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
144<CODE>&nbsp;void</CODE></FONT></TD>
145<TD><CODE><B><A HREF="/org/ahmadsoft/postal/ReadOnceStrategy.html#dispose()">dispose</A></B>()</CODE>
146
147<BR>
148&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
149</TR>
150<TR BGCOLOR="white" CLASS="TableRowColor">
151<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
152<CODE>&nbsp;java.util.List</CODE></FONT></TD>
153<TD><CODE><B><A HREF="/org/ahmadsoft/postal/ReadOnceStrategy.html#getCandidates(int)">getCandidates</A></B>(int&nbsp;postalCode)</CODE>
154
155<BR>
156&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves a list of candidate cities for a 
157 specified postal code.</TD>
158</TR>
159<TR BGCOLOR="white" CLASS="TableRowColor">
160<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
161<CODE>&nbsp;void</CODE></FONT></TD>
162<TD><CODE><B><A HREF="/org/ahmadsoft/postal/ReadOnceStrategy.html#initialize(java.io.File, java.io.File)">initialize</A></B>(java.io.File&nbsp;_indexFile,
163           java.io.File&nbsp;_dataFile)</CODE>
164
165<BR>
166&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes the retrieval strategy with the
167 postal code index and data files.</TD>
168</TR>
169</TABLE>
170&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
171<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
172<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
173<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
174</TR>
175<TR BGCOLOR="white" CLASS="TableRowColor">
176<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
177</TR>
178</TABLE>
179&nbsp;
180<P>
181
182<!-- ========= CONSTRUCTOR DETAIL ======== -->
183
184<A NAME="constructor_detail"><!-- --></A>
185<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
186<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
187<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
188<B>Constructor Detail</B></FONT></TH>
189</TR>
190</TABLE>
191
192<A NAME="ReadOnceStrategy()"><!-- --></A><H3>
193ReadOnceStrategy</H3>
194<PRE>
195public <B>ReadOnceStrategy</B>()</PRE>
196<DL>
197</DL>
198
199<!-- ============ METHOD DETAIL ========== -->
200
201<A NAME="method_detail"><!-- --></A>
202<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
203<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
204<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
205<B>Method Detail</B></FONT></TH>
206</TR>
207</TABLE>
208
209<A NAME="initialize(java.io.File, java.io.File)"><!-- --></A><H3>
210initialize</H3>
211<PRE>
212public void <B>initialize</B>(java.io.File&nbsp;_indexFile,
213                       java.io.File&nbsp;_dataFile)
214                throws java.lang.Exception</PRE>
215<DL>
216<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>
217<DD>Initializes the retrieval strategy with the
218 postal code index and data files.
219<P>
220<DD><DL>
221<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>
222</DD>
223<DD><DL>
224
225<DT><B>Throws:</B>
226<DD><CODE>java.lang.Exception</CODE></DL>
227</DD>
228</DL>
229<HR>
230
231<A NAME="getCandidates(int)"><!-- --></A><H3>
232getCandidates</H3>
233<PRE>
234public java.util.List <B>getCandidates</B>(int&nbsp;postalCode)</PRE>
235<DL>
236<DD><B>Description copied from interface: <CODE><A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html#getCandidates(int)">PostalRetrievalStrategy</A></CODE></B></DD>
237<DD>Retrieves a list of candidate cities for a 
238 specified postal code.
239<P>
240<DD><DL>
241<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>
242</DD>
243<DD><DL>
244<DT><B>Parameters:</B><DD><CODE>postalCode</CODE> - the postal code.
245<DT><B>Returns:</B><DD>a list of candidate cities.</DL>
246</DD>
247</DL>
248<HR>
249
250<A NAME="dispose()"><!-- --></A><H3>
251dispose</H3>
252<PRE>
253public void <B>dispose</B>()
254             throws java.lang.Exception</PRE>
255<DL>
256<DD><DL>
257<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>
258</DD>
259<DD><DL>
260
261<DT><B>Throws:</B>
262<DD><CODE>java.lang.Exception</CODE></DL>
263</DD>
264</DL>
265<!-- ========= END OF CLASS DATA ========= -->
266<HR>
267
268
269<!-- ======= START OF BOTTOM NAVBAR ====== -->
270<A NAME="navbar_bottom"><!-- --></A>
271<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
272<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
273<TR>
274<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
275<A NAME="navbar_bottom_firstrow"><!-- --></A>
276<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
277  <TR ALIGN="center" VALIGN="top">
278  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/org/ahmadsoft/postal/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
279  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
280  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ReadOnceStrategy.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
281  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
282  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
283  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
284  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
285  </TR>
286</TABLE>
287</TD>
288<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
289</EM>
290</TD>
291</TR>
292
293<TR>
294<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
295&nbsp;<A HREF="/org/ahmadsoft/postal/PostalRetrievalStrategy.html" title="interface in org.ahmadsoft.postal"><B>PREV CLASS</B></A>&nbsp;
296&nbsp;<A HREF="/org/ahmadsoft/postal/USPostalCodeService.html" title="class in org.ahmadsoft.postal"><B>NEXT CLASS</B></A></FONT></TD>
297<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
298  <A HREF="/index.html?org/ahmadsoft/postal/ReadOnceStrategy.html" target="_top"><B>FRAMES</B></A>  &nbsp;
299&nbsp;<A HREF="ReadOnceStrategy.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
300&nbsp;<SCRIPT type="text/javascript">
301  <!--
302  if(window==top) {
303    document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>');
304  }
305  //-->
306</SCRIPT>
307<NOSCRIPT>
308  <A HREF="/allclasses-noframe.html"><B>All Classes</B></A>
309</NOSCRIPT>
310
311
312</FONT></TD>
313</TR>
314<TR>
315<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
316  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
317<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
318DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
319</TR>
320</TABLE>
321<A NAME="skip-navbar_bottom"></A>
322<!-- ======== END OF BOTTOM NAVBAR ======= -->
323
324<HR>
325<i>Copyright &#169; 2006 Ahmadsoft. All Rights Reserved.</i>
326</BODY>
327</HTML>
328