model
Class Country

java.lang.Object
  extended by model.Country

public class Country
extends java.lang.Object

Country objects are used to store the nationality of the player and the default country of the tournament.


Nested Class Summary
(package private) static class Country.CountryComparator
          Inner class CountryComparator is used to enable sorting Country objects by their country names.
 
Field Summary
private  java.lang.String code
           
private static Country[] country_list
           
private static java.util.HashMap<java.lang.String,Country> country_map
           
private  java.lang.String name
           
 
Constructor Summary
protected Country(java.lang.String countrycode, java.lang.String countryname)
          Constructor creates a Country object with a country code and matching country name.
 
Method Summary
 java.lang.String getCode()
          Returns country code.
static Country[] getCountryList()
          Returns a list of countries.
 java.lang.String getName()
          Returns country name.
static Country getUnknownCountry()
          Method returns the default country that is used to set the country field in an EntryInitializer object by default.
static Country parseCountryByCode(java.lang.String country_code)
          Returns corresponding country name from a given country code.
 java.lang.String toString()
          Returns country code in a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code

private final transient java.lang.String code

name

private final transient java.lang.String name

country_map

private static java.util.HashMap<java.lang.String,Country> country_map

country_list

private static Country[] country_list
Constructor Detail

Country

protected Country(java.lang.String countrycode,
                  java.lang.String countryname)
Constructor creates a Country object with a country code and matching country name.

Parameters:
countrycode - two letter country code
countryname - country name
Method Detail

getCode

public java.lang.String getCode()
Returns country code.

Returns:
two letter country code

getName

public java.lang.String getName()
Returns country name.

Returns:
country name

parseCountryByCode

public static Country parseCountryByCode(java.lang.String country_code)
                                  throws GoException
Returns corresponding country name from a given country code.

Parameters:
country_code - country code
Returns:
country name
Throws:
GoException

getCountryList

public static Country[] getCountryList()
Returns a list of countries.

Returns:
country list in an array

toString

public final java.lang.String toString()
Returns country code in a string.

Overrides:
toString in class java.lang.Object

getUnknownCountry

public static Country getUnknownCountry()
                                 throws GoException
Method returns the default country that is used to set the country field in an EntryInitializer object by default.

Returns:
Country object with code FI
Throws:
GoException