com.ibm.icu.util
Class GenderInfo

java.lang.Object
  extended by com.ibm.icu.util.GenderInfo

public class GenderInfo
extends Object

Provide information about gender in locales based on data in CLDR. Currently supplies gender of lists.

Author:
markdavis
Status:
Internal. This API is ICU internal only.

Nested Class Summary
static class GenderInfo.Gender
          Gender: OTHER means either the information is unavailable, or the person has declined to state MALE or FEMALE.
static class GenderInfo.ListGenderStyle
          Enum only meant for use in CLDR and in testing.
 
Constructor Summary
GenderInfo(GenderInfo.ListGenderStyle genderStyle)
          Only for testing and use with CLDR.
 
Method Summary
static GenderInfo getInstance(Locale locale)
          Create GenderInfo from a Locale.
static GenderInfo getInstance(ULocale uLocale)
          Create GenderInfo from a ULocale.
 GenderInfo.Gender getListGender(GenderInfo.Gender... genders)
          Get the gender of a list, based on locale usage.
 GenderInfo.Gender getListGender(List<GenderInfo.Gender> genders)
          Get the gender of a list, based on locale usage.
static void setLocaleMapping(Map<ULocale,GenderInfo> newULocaleToListGender)
          Reset the data used for mapping locales to styles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenderInfo

public GenderInfo(GenderInfo.ListGenderStyle genderStyle)
Only for testing and use with CLDR.

Parameters:
genderStyle - gender style
Status:
Internal. This API is ICU internal only.
Method Detail

getInstance

public static GenderInfo getInstance(ULocale uLocale)
Create GenderInfo from a ULocale.

Parameters:
uLocale - desired locale
Status:
Internal. This API is ICU internal only.

getInstance

public static GenderInfo getInstance(Locale locale)
Create GenderInfo from a Locale.

Parameters:
locale - desired locale
Status:
Internal. This API is ICU internal only.

setLocaleMapping

public static void setLocaleMapping(Map<ULocale,GenderInfo> newULocaleToListGender)
Reset the data used for mapping locales to styles. Only for use in CLDR and in testing!

Parameters:
newULocaleToListGender - replacement data, copied internally for safety.
Status:
Internal. This API is ICU internal only.

getListGender

public GenderInfo.Gender getListGender(GenderInfo.Gender... genders)
Get the gender of a list, based on locale usage.

Parameters:
genders - a list of genders.
Returns:
the gender of the list.
Status:
Internal. This API is ICU internal only.

getListGender

public GenderInfo.Gender getListGender(List<GenderInfo.Gender> genders)
Get the gender of a list, based on locale usage.

Parameters:
genders - a list of genders.
Returns:
the gender of the list.
Status:
Internal. This API is ICU internal only.


Copyright (c) 2012 IBM Corporation and others.