org.ahmadsoft.postal
Interface PostalRetrievalStrategy

All Known Implementing Classes:
DiskStrategy, InMemoryStrategy, ReadOnceStrategy

public interface PostalRetrievalStrategy

Encapsulates a strategy for retrieving postal codes.

Author:
Amin Ahmad

Method Summary
 void dispose()
           
 java.util.List getCandidates(int postalCode)
          Retrieves a list of candidate cities for a specified postal code.
 void initialize(java.io.File indexFile, java.io.File dataFile)
          Initializes the retrieval strategy with the postal code index and data files.
 

Method Detail

initialize

void initialize(java.io.File indexFile,
                java.io.File dataFile)
                throws java.lang.Exception
Initializes the retrieval strategy with the postal code index and data files.

Parameters:
indexFile -
dataFile -
Throws:
java.lang.Exception

dispose

void dispose()
             throws java.lang.Exception
Throws:
java.lang.Exception

getCandidates

java.util.List getCandidates(int postalCode)
Retrieves a list of candidate cities for a specified postal code.

Parameters:
postalCode - the postal code.
Returns:
a list of candidate cities.


Copyright © 2006-2009 Ahmadsoft. All Rights Reserved.