/* * PostalRetrievalStrategy.java * Copyright (C) 2006 Amin Ahmad * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package org.ahmadsoft.postal; import java.io.File; import java.net.URL; import java.util.List; /** * Encapsulates a strategy for retrieving postal * codes. * @author Amin Ahmad */ public interface PostalRetrievalStrategy { /** * Initializes the retrieval strategy with the * postal code index and data files. * * @param indexFile * @param dataFile */ void initialize(File indexFile, File dataFile) throws Exception; void dispose() throws Exception; /** * Retrieves a list of candidate cities for a * specified postal code. * * @param postalCode the postal code. * @return a list of candidate cities. */ List getCandidates(int postalCode); }