/** * Creates a new cardinal-number <code>PluralFormat</code> for a given set of rules. * The standard number formatting will be done using the given locale. * @param ulocale the default number formatting will be done using this * locale. * @param rules defines the behavior of the <code>PluralFormat</code> * object. * @stable ICU 3.8 */ public PluralFormat(ULocale ulocale, PluralRules rules) { init(rules, PluralType.CARDINAL, ulocale, null); }
/** * Creates a new cardinal-number <code>PluralFormat</code> for a given locale. * @param ulocale the <code>PluralFormat</code> will be configured with * rules for this locale. This locale will also be used for standard * number formatting. * @stable ICU 3.8 */ public PluralFormat(ULocale ulocale) { init(null, PluralType.CARDINAL, ulocale, null); }
/** * Creates a new <code>PluralFormat</code> for the plural type. * The standard number formatting will be done using the given locale. * @param ulocale the default number formatting will be done using this * locale. * @param type The plural type (e.g., cardinal or ordinal). * @stable ICU 50 */ public PluralFormat(ULocale ulocale, PluralType type) { init(null, type, ulocale, null); }
/** * Creates a new cardinal-number <code>PluralFormat</code> for a given set of rules. * The standard number formatting will be done using the default <code>FORMAT</code> locale. * @param rules defines the behavior of the <code>PluralFormat</code> * object. * @see Category#FORMAT * @stable ICU 3.8 */ public PluralFormat(PluralRules rules) { init(rules, PluralType.CARDINAL, ULocale.getDefault(Category.FORMAT), null); }
/** * Creates a new cardinal-number <code>PluralFormat</code> for the default <code>FORMAT</code> locale. * This locale will be used to get the set of plural rules and for standard * number formatting. * @see Category#FORMAT * @stable ICU 3.8 */ public PluralFormat() { init(null, PluralType.CARDINAL, ULocale.getDefault(Category.FORMAT), null); }
/** * Creates a new cardinal-number <code>PluralFormat</code> for a given set of rules, a * pattern and a locale. * @param ulocale the <code>PluralFormat</code> will be configured with * rules for this locale. This locale will also be used for standard * number formatting. * @param rules defines the behavior of the <code>PluralFormat</code> * object. * @param pattern the pattern for this <code>PluralFormat</code>. * @throws IllegalArgumentException if the pattern is invalid. * @stable ICU 3.8 */ public PluralFormat(ULocale ulocale, PluralRules rules, String pattern) { init(rules, PluralType.CARDINAL, ulocale, null); applyPattern(pattern); }
/** * Creates a new <code>PluralFormat</code> for a plural type, a * pattern and a locale. * @param ulocale the <code>PluralFormat</code> will be configured with * rules for this locale. This locale will also be used for standard * number formatting. * @param type The plural type (e.g., cardinal or ordinal). * @param pattern the pattern for this <code>PluralFormat</code>. * @param numberFormat The number formatter to use. * @throws IllegalArgumentException if the pattern is invalid. */ /*package*/ PluralFormat(ULocale ulocale, PluralType type, String pattern, NumberFormat numberFormat) { init(null, type, ulocale, numberFormat); applyPattern(pattern); }
/** * Creates a new <code>PluralFormat</code> for a plural type, a * pattern and a locale. * @param ulocale the <code>PluralFormat</code> will be configured with * rules for this locale. This locale will also be used for standard * number formatting. * @param type The plural type (e.g., cardinal or ordinal). * @param pattern the pattern for this <code>PluralFormat</code>. * @throws IllegalArgumentException if the pattern is invalid. * @stable ICU 50 */ public PluralFormat(ULocale ulocale, PluralType type, String pattern) { init(null, type, ulocale, null); applyPattern(pattern); }
/** * Creates a new cardinal-number <code>PluralFormat</code> for a given pattern string and * locale. * The locale will be used to get the set of plural rules and for * standard number formatting. * <p>Example code:{@.jcite com.ibm.icu.samples.text.pluralformat.PluralFormatSample:---PluralFormatExample} * @param ulocale the <code>PluralFormat</code> will be configured with * rules for this locale. This locale will also be used for standard * number formatting. * @param pattern the pattern for this <code>PluralFormat</code>. * @throws IllegalArgumentException if the pattern is invalid. * @stable ICU 3.8 */ public PluralFormat(ULocale ulocale, String pattern) { init(null, PluralType.CARDINAL, ulocale, null); applyPattern(pattern); }
/** * Sets the locale used by this <code>PluraFormat</code> object. * Note: Calling this method resets this <code>PluraFormat</code> object, * i.e., a pattern that was applied previously will be removed, * and the NumberFormat is set to the default number format for * the locale. The resulting format behaves the same as one * constructed from {@link #PluralFormat(ULocale, PluralRules.PluralType)} * with PluralType.CARDINAL. * @param ulocale the <code>ULocale</code> used to configure the * formatter. If <code>ulocale</code> is <code>null</code>, the * default <code>FORMAT</code> locale will be used. * @see Category#FORMAT * @deprecated ICU 50 This method clears the pattern and might create * a different kind of PluralRules instance; * use one of the constructors to create a new instance instead. */ @Deprecated public void setLocale(ULocale ulocale) { if (ulocale == null) { ulocale = ULocale.getDefault(Category.FORMAT); } init(null, PluralType.CARDINAL, ulocale, null); }
/** * Creates a new cardinal-number <code>PluralFormat</code> for a given pattern string. * The default <code>FORMAT</code> locale will be used to get the set of plural rules and for * standard number formatting. * @param pattern the pattern for this <code>PluralFormat</code>. * @throws IllegalArgumentException if the pattern is invalid. * @see Category#FORMAT * @stable ICU 3.8 */ public PluralFormat(String pattern) { init(null, PluralType.CARDINAL, ULocale.getDefault(Category.FORMAT), null); applyPattern(pattern); }
/** * Creates a new cardinal-number <code>PluralFormat</code> for a given set of rules and a * pattern. * The standard number formatting will be done using the default <code>FORMAT</code> locale. * @param rules defines the behavior of the <code>PluralFormat</code> * object. * @param pattern the pattern for this <code>PluralFormat</code>. * @throws IllegalArgumentException if the pattern is invalid. * @see Category#FORMAT * @stable ICU 3.8 */ public PluralFormat(PluralRules rules, String pattern) { init(rules, PluralType.CARDINAL, ULocale.getDefault(Category.FORMAT), null); applyPattern(pattern); }