Class GeoRegion


  • public class GeoRegion
    extends Object
    Representation of a specific geographical or political region.

    Structure of a GeoRegion

    Every region is defined by a country code and up to five codes of administrative units at different subdivision levels. The overall region code is composed of the individual codes separated by a comma.

    Regions are strictly hierarchical, however the administrative units at some subdivision levels may be skipped. This situation can be found in Germany, for instance, where the subdivision level of "governmental districts" (orig. "Regierungsbezirke") is defined only in some of the "federal states" (orig. "Bundesländer").

    Predefined GeoRegions

    Region codes defined by this library can be found in the StandardGeoRegions class and its inner classes. Custom-defined region codes shall be compatible with these codes.

    Default GeoRegion

    Similarly to Locale, this class defines a default region. The default region is set at class loading time from the "user.georegion" system property. If the property is not defined or if its value is empty, a qualified guess of the default region is made from the default locale. If the qualified guess fails, a GeoRegionException is thrown. The default region can be changed at any time using the setDefault(GeoRegion) method.
    Since:
    1.0