/** * Returns a number format of the appropriate type. If the locale * is not supported, return null. If the locale is supported, but * the type is not provided by this service, return null. Otherwise * return an appropriate instance of NumberFormat. * <b>Note:</b> as of ICU4J 3.2, createFormat(ULocale, int) should be * overridden instead of this method. This method is no longer * abstract and delegates to that method. * @param loc the locale for which to create the format * @param formatType the type of format * @return the NumberFormat, or null. * @stable ICU 2.6 */ public NumberFormat createFormat(Locale loc, int formatType) { return createFormat(ULocale.forLocale(loc), formatType); }
/** * Returns a number format of the appropriate type. If the locale * is not supported, return null. If the locale is supported, but * the type is not provided by this service, return null. Otherwise * return an appropriate instance of NumberFormat. * <b>Note:</b> as of ICU4J 3.2, createFormat(ULocale, int) should be * overridden instead of this method. This method is no longer * abstract and delegates to that method. * @param loc the locale for which to create the format * @param formatType the type of format * @return the NumberFormat, or null. * @stable ICU 2.6 */ public NumberFormat createFormat(Locale loc, int formatType) { return createFormat(ULocale.forLocale(loc), formatType); }
/** * Returns a number format of the appropriate type. If the locale * is not supported, return null. If the locale is supported, but * the type is not provided by this service, return null. Otherwise * return an appropriate instance of NumberFormat. * <b>Note:</b> as of ICU4J 3.2, createFormat(ULocale, int) should be * overridden instead of this method. This method is no longer * abstract and delegates to that method. * @param loc the locale for which to create the format * @param formatType the type of format * @return the NumberFormat, or null. * @stable ICU 2.6 */ public NumberFormat createFormat(Locale loc, int formatType) { return createFormat(ULocale.forLocale(loc), formatType); }
/** * Returns a number format of the appropriate type. If the locale * is not supported, return null. If the locale is supported, but * the type is not provided by this service, return null. Otherwise * return an appropriate instance of NumberFormat. * <b>Note:</b> as of ICU4J 3.2, implementations should override * this method instead of createFormat(Locale, int). * @param loc the locale for which to create the format * @param formatType the type of format * @return the NumberFormat, or null. * @stable ICU 3.2 */ public NumberFormat createFormat(ULocale loc, int formatType) { return createFormat(loc.toLocale(), formatType); }
/** * Returns a number format of the appropriate type. If the locale * is not supported, return null. If the locale is supported, but * the type is not provided by this service, return null. Otherwise * return an appropriate instance of NumberFormat. * <b>Note:</b> as of ICU4J 3.2, implementations should override * this method instead of createFormat(Locale, int). * @param loc the locale for which to create the format * @param formatType the type of format * @return the NumberFormat, or null. * @stable ICU 3.2 */ public NumberFormat createFormat(ULocale loc, int formatType) { return createFormat(loc.toLocale(), formatType); }
/** * Returns a number format of the appropriate type. If the locale * is not supported, return null. If the locale is supported, but * the type is not provided by this service, return null. Otherwise * return an appropriate instance of NumberFormat. * <b>Note:</b> as of ICU4J 3.2, implementations should override * this method instead of createFormat(Locale, int). * @param loc the locale for which to create the format * @param formatType the type of format * @return the NumberFormat, or null. * @stable ICU 3.2 */ public NumberFormat createFormat(ULocale loc, int formatType) { return createFormat(loc.toLocale(), formatType); }
public Object create(Key key, ICUService srvc) { if (!handlesKey(key) || !(key instanceof LocaleKey)) { return null; } LocaleKey lkey = (LocaleKey)key; Object result = delegate.createFormat(lkey.canonicalLocale(), lkey.kind()); if (result == null) { result = srvc.getKey(key, null, this); } return result; }