FileDocCategorySizeDatePackage
Country4.javaAPI DocExample2414Sun Dec 14 22:47:38 GMT 2003oreilly.hcj.constants

Country4.java

/*
 *     file: Country4.java
 *  package: oreilly.hcj.constants
 *
 * This software is granted under the terms of the Common Public License,
 * CPL, which may be found at the following URL:
 * http://www-124.ibm.com/developerworks/oss/CPLv1.0.htm
 *
 * Copyright(c) 2003-2005 by the authors indicated in the @author tags.
 * All Rights are Reserved by the various authors.
 *
########## DO NOT EDIT ABOVE THIS LINE ########## */

package oreilly.hcj.constants;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**  
 * Holds country constants.
 *
 * @author <a href=mailto:kraythe@arcor.de>Robert Simmons jr. (kraythe)</a>
 * @version $Revision: 1.3 $
 */
public class Country4 implements Serializable {
	/** Holds the Index of the country objects. */
	private static final Map INDEX = new HashMap();

	/** Contry constant for Canada. */
	public static final Country4 CANADA = new Country4("CANADA");

	/** Contry constant for Croatia. */
	public static final Country4 CROATIA = new Country4("CROATIA");

	/** Contry constant for Germany. */
	public static final Country4 GERMANY = new Country4("GERMANY");

	/** Contry constant for Italy. */
	public static final Country4 ITALY = new Country4("ITALY");

	/** Contry constant for Mexico. */
	public static final Country4 MEXICO = new Country4("MEXICO");

	/** Contry constant for the UK. */
	public static final Country4 UK = new Country4("UK");

	/** Contry constant for the USA. */
	public static final Country4 USA = new Country4("USA");

	/** Contry constant for the Venezuela. */
	public static final Country4 VENEZUELA = new Country4("VENEZUELA");

	/** Holds the name of this country. */
	private final String name;

	/** 
	 * Creates a new Country4.
	 *
	 * @param name The name for the exception type.
	 */
	private Country4(final String name) {
		this.name = name;
		INDEX.put(name, this);
	}

	/** 
	 * Get the name of this country.
	 *
	 * @return The name of the country.
	 */
	public String getName() {
		return this.name;
	}

	/** 
	 * Looks up a String to find the associated Country3 object.
	 *
	 * @param name The name to lookup.
	 *
	 * @return The object or null if it does not exist.
	 */
	public static Country4 lookup(final String name) {
		return (Country4)INDEX.get(name);
	}
}

/* ########## End of File ########## */