public class

RegionInheritance

extends Object
java.lang.Object
   ↳ com.google.gwt.i18n.server.RegionInheritance

Class Overview

Generated maps of regions into parent regions, used for locale inheritance. TODO(jat): make this actually be generated.

Summary

Public Constructors
RegionInheritance()
Public Methods
static String findCommonParent(String region1, String region2)
Finds the first region which is a common parent of two regions.
static List<String> getAllAncestors(String child)
Returns a set of all ancestors of a given region, including the region itself, in order of inheritance (ie, this region first, top-most region last).
static Set<String> getImmediateParents(String region)
Returns the set of immediate parents of a given region, not including this region.
static boolean isParentOf(String parent, String child)
Returns true if parent is equal to the child or is an ancestor.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public RegionInheritance ()

Public Methods

public static String findCommonParent (String region1, String region2)

Finds the first region which is a common parent of two regions. If either region is null or if there is no common parent, returns null. Otherwise, returns the region which contains both regions.

Returns
  • common parent or null if none

public static List<String> getAllAncestors (String child)

Returns a set of all ancestors of a given region, including the region itself, in order of inheritance (ie, this region first, top-most region last).

Returns
  • list of ancestors

public static Set<String> getImmediateParents (String region)

Returns the set of immediate parents of a given region, not including this region.

Returns
  • set of immediate parents

public static boolean isParentOf (String parent, String child)

Returns true if parent is equal to the child or is an ancestor. If both are null, true is returned; otherwise if either is null false is returned.

Returns
  • true if parent is an ancestor of child