OpMath

com.opmath.util.html
Class Countries

java.lang.Object
  |
  +--com.opmath.util.html.Countries

public abstract class Countries
extends Object

Provides an HTML SELECT structure containing all the world's country names.

The class is structured in such a way as to allow for different languages: when a new country selector is created, the language for the NAME components can be chosen.

NOTE 1: Country names and codes are taken from Berg, Clifford J., "Advanced Java Development for Enterprise Applications, 2nd Edition", Sun Microsystems Press, 2000.

NOTE 2: Currently, only English is supported. Java recognises four variants of English, known as CA, GB, IE, and US. All of these four codes are recognised. However, they currently all yield the same country names list.

Copyright: (c) 2002 The Open Math Company Limited

The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.

Version:
utilities-v011
Author:
Bruno Beloff
See Also:
HTMLEncoder

Field Summary
static int CA
          Language selector.
static int GB
          Language selector.
static int IE
          Language selector.
static int US
          Language selector.
 
Constructor Summary
Countries()
           
 
Method Summary
static String getName(int language, String value)
          Gets the NAMES element, for the given language, whose VALUE is equal to value.
static Select select(String id, int language)
          Returns a new SELECT structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CA

public static final int CA
Language selector. Required by Select select(String, int).

Since:
JDK 1.2.2
See Also:
select(String, int), Constant Field Values

GB

public static final int GB
Language selector. Required by Select select(String, int).

Since:
JDK 1.2.2
See Also:
select(String, int), Constant Field Values

IE

public static final int IE
Language selector. Required by Select select(String, int).

Since:
JDK 1.2.2
See Also:
select(String, int), Constant Field Values

US

public static final int US
Language selector. Required by Select select(String, int).

Since:
JDK 1.2.2
See Also:
select(String, int), Constant Field Values
Constructor Detail

Countries

public Countries()
Method Detail

getName

public static String getName(int language,
                             String value)
                      throws ComparableTableException
Gets the NAMES element, for the given language, whose VALUE is equal to value. If value is not known, then getName(int, String) returns null.

Parameters:
language - the int specifying the language.
value - the String specifying the VALUES element.
Returns:
a String carrying the NAMES element, or null.
Throws:
com.opmath.util.html.ComparableTableException - An exception thrown if the value of language is not known to this class.
ComparableTableException
Since:
JDK 1.2.2

select

public static Select select(String id,
                            int language)
                     throws ComparableTableException
Returns a new SELECT structure. The structure is identified by the argument id. The language of the SELECT structure OPTION elements' NAMEs are determined by the argument language.

Parameters:
id - the String for the id.
language - the int specifying the language.
Throws:
com.opmath.util.html.ComparableTableException - An exception thrown if the value of language is not known to this class.
ComparableTableException
Since:
JDK 1.2.2

OpMath

Submit a bug or feature to Open Math
Copyright © 2002 Open Math Company Limited, Brighton, UK