FileDocCategorySizeDatePackage
ISOCountry.javaAPI DocJaudiotagger 2.0.412529Fri May 13 18:03:32 BST 2011org.jaudiotagger.tag.reference

ISOCountry

public class ISOCountry extends Object
Represents the ISO 3166-1 Country List with ISO 3166-1-alpha-2 code

Contains an enum of countries, their two letter code and description with additional method to allow an enum to be found by its two letter code or its description. More details at http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm#c

Fields Summary
private static Map
codeMap
private static Map
descriptionMap
Constructors Summary
Methods Summary
public static org.jaudiotagger.tag.reference.ISOCountry$CountrygetCountryByCode(java.lang.String code)

param
code
return
enum with this two letter code

        codeMap = new HashMap<String, Country>();
        for (Country country : Country.values())
        {
            codeMap.put(country.code, country);
        }

        descriptionMap = new HashMap<String, Country>();
        for (Country country : Country.values())
        {
            descriptionMap.put(country.description, country);
        }

    
        return codeMap.get(code);
    
public static org.jaudiotagger.tag.reference.ISOCountry$CountrygetCountryByDescription(java.lang.String description)

param
description
return
enum with this description

        return descriptionMap.get(description);
    
public static java.lang.String[]getDescriptionsAsArray()

        List<String> descriptions = new ArrayList<String>();
        for (Country country : Country.values())
        {
            descriptions.add(country.description);
        }
        return descriptions.toArray(new String[0]);