/** * Constructs a <code>EthiopicCalendar</code> based on the current time * in the given time zone with the given locale. * * @param zone The time zone for the new calendar. * @param aLocale The locale for the new calendar. * @stable ICU 3.4 */ public EthiopicCalendar(TimeZone zone, Locale aLocale) { this(zone, ULocale.forLocale(aLocale)); }
/** * Creates a new cardinal-number <code>PluralFormat</code> for a given * {@link java.util.Locale}. * @param locale the <code>PluralFormat</code> will be configured with * rules for this locale. This locale will also be used for standard * number formatting. * @stable ICU 54 */ public PluralFormat(Locale locale) { this(ULocale.forLocale(locale)); }
/** * Creates a new <code>PluralFormat</code> for the plural type. * The standard number formatting will be done using the given {@link java.util.Locale}. * @param locale the default number formatting will be done using this * locale. * @param type The plural type (e.g., cardinal or ordinal). * @stable ICU 54 */ public PluralFormat(Locale locale, PluralType type) { this(ULocale.forLocale(locale), type); }
/** * Construct DateIntervalInfo for the given {@link java.util.Locale}. * @param locale the interval patterns are loaded from the appropriate * calendar data (specified calendar or default calendar) * in this locale. * @stable ICU 54 */ public DateIntervalInfo(Locale locale) { this(ULocale.forLocale(locale)); }
/** * Constructs a calendar with the specified time zone and locale. * @param zone the time zone to use * @param aLocale the locale for the week data * @stable ICU 2.0 */ protected Calendar(TimeZone zone, Locale aLocale) { this(zone, ULocale.forLocale(aLocale)); }
/** * Construct a ChineseDateFormatSymbols for the provided locale. * @param locale the locale * @deprecated ICU 50 */ @Deprecated public ChineseDateFormatSymbols(Locale locale) { super(ChineseCalendar.class, ULocale.forLocale(locale)); }
/** * Return the name of the collator for the objectLocale, localized for the displayLocale. * If objectLocale is not visible or not defined by the factory, return null. * @param objectLocale the locale identifying the collator * @param displayLocale the locale for which the display name of the collator should be localized * @return the display name * @stable ICU 2.6 */ public String getDisplayName(Locale objectLocale, Locale displayLocale) { return getDisplayName(ULocale.forLocale(objectLocale), ULocale.forLocale(displayLocale)); }
/** * Returns a currency format for the specified locale. * @return a number format for currency * @stable ICU 2.0 */ public static NumberFormat getCurrencyInstance(Locale inLocale) { return getInstance(ULocale.forLocale(inLocale), CURRENCYSTYLE); }
/** * Sets the locale to be used for creating argument Format objects. * This affects subsequent calls to the {@link #applyPattern applyPattern} * method as well as to the <code>format</code> and * {@link #formatToCharacterIterator formatToCharacterIterator} methods. * * @param locale the locale to be used when creating or comparing subformats * @stable ICU 3.0 */ public void setLocale(Locale locale) { setLocale(ULocale.forLocale(locale)); }
/** * Returns a calendar using the default time zone and specified locale. * @param aLocale the locale for the week data * @return a Calendar. * @stable ICU 2.0 */ public static Calendar getInstance(Locale aLocale) { return getInstanceInternal(null, ULocale.forLocale(aLocale)); }
/** * Convenience overload of {@link #getInstance(Locale, DisplayContext...)} that specifies * {@link DisplayContext#STANDARD_NAMES}. * @param locale the display {@link java.util.Locale} * @return a LocaleDisplayNames instance * @stable ICU 54 */ public static LocaleDisplayNames getInstance(Locale locale) { return getInstance(ULocale.forLocale(locale)); };
/** * Returns an instance of LocaleDisplayNames that returns names formatted for the provided * {@link java.util.Locale}, using the provided DisplayContext settings * @param locale the display {@link java.util.Locale} * @param contexts one or more context settings (e.g. for dialect * handling, capitalization, etc. * @return a LocaleDisplayNames instance * @stable ICU 54 */ public static LocaleDisplayNames getInstance(Locale locale, DisplayContext... contexts) { return getInstance(ULocale.forLocale(locale), contexts); }
/** * Returns a percentage format for the specified locale. * @return a number format for percents * @stable ICU 2.0 */ public static NumberFormat getPercentInstance(Locale inLocale) { return getInstance(ULocale.forLocale(inLocale), PERCENTSTYLE); }
/** * Constructs a SimpleNumberFormatFactory with the given locale and the * visibility. * @stable ICU 2.6 */ public SimpleNumberFormatFactory(Locale locale, boolean visible) { localeNames = Collections.singleton(ULocale.forLocale(locale).getBaseName()); this.visible = visible; }
/** * Create GenderInfo from a Locale. * @param locale desired locale * @internal * @deprecated This API is ICU internal only. */ @Deprecated public static GenderInfo getInstance(Locale locale) { return getInstance(ULocale.forLocale(locale)); }
/** * Given a string representing a Locale, returns the ICU4J ULocale object for that string. * * @return A ULocale object built from the string provided */ public static ULocale parseULocale(String localeString) { return ULocale.forLocale(parseLocale(localeString)); } }
/** * Given a string representing a Locale, returns the ICU4J ULocale object for that string. * * @return A ULocale object built from the string provided */ public static ULocale parseULocale(String localeString) { return ULocale.forLocale(parseLocale(localeString)); } }
/** * {@icu} Returns the name of the collator for the objectLocale, localized for the * displayLocale. * @param objectLocale the locale of the collator * @param displayLocale the locale for the collator's display name * @return the display name * @stable ICU 2.6 */ static public String getDisplayName(Locale objectLocale, Locale displayLocale) { return getShim().getDisplayName(ULocale.forLocale(objectLocale), ULocale.forLocale(displayLocale)); }
/** * Construct a ULocale object from a {@link java.util.Locale}. * @param loc a JDK locale */ private ULocale(Locale loc) { this.localeID = getName(forLocale(loc).toString()); this.locale = loc; }
/** * Construct a ULocale object from a {@link java.util.Locale}. * @param loc a {@link java.util.Locale} */ private ULocale(Locale loc) { this.localeID = getName(forLocale(loc).toString()); this.locale = loc; }