/* * PostalCodeConstants.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; /** * A collection of constants used by the Postal Code Service * library. Groups of constants use the commonly used * GroupName_MemberName syntax. * * @author Amin Ahmad */ public class PostalCodeConstants { /** * Indicates a PostalCodeEntry that holds the * actual city and state for a given postal code. */ public static final short CITY_ACTUAL = 1; /** * Indicates a PostalCodeEntry that holds an * city and state combination defined as acceptable for * a given postal code by the US Postal Service. */ public static final short CITY_ACCEPTABLE = 2; /** * Indicates a PostalCodeEntry that holds an * city and state combination defined as unacceptable for * a given postal code by the US Postal Service. */ public static final short CITY_UNACCEPTABLE = 3; /** * Indicates a PostalCodeEntry that holds an * unknown city and state combination for the given postal * code. */ public static final short CITY_UNKNOWN = 4; /** * Returns a string representation of a given postal * code constant. This method is suitable for debugging * purposes, but should not be used to convert codes * for an end user. * * @param constant the constant to represent as a string. * @return a string representation of the specified constant. */ public static String toString(int constant) { switch (constant) { case CITY_ACCEPTABLE: return "acceptable"; case CITY_ACTUAL: return "actual"; case CITY_UNACCEPTABLE: return "unacceptable"; case CITY_UNKNOWN: return "unknown"; default: return null; } } }