Exemplo n.º 1
0
 /*
  * Initializes the <code>PluralRules</code> object.
  * Postcondition:<br/>
  *   <code>ulocale</code>    :  is <code>locale</code><br/>
  *   <code>pluralRules</code>:  if <code>rules</code> != <code>null</code>
  *                              it's set to rules, otherwise it is the
  *                              predefined plural rule set for the locale
  *                              <code>ulocale</code>.<br/>
  *   <code>parsedValues</code>: is <code>null</code><br/>
  *   <code>pattern</code>:      is <code>null</code><br/>
  *   <code>numberFormat</code>: a <code>NumberFormat</code> for the locale
  *                              <code>ulocale</code>.
  */
 private void Init(PluralRules rules, PluralType type, ULocale locale, NumberFormat numberFormat)
 {
     ulocale     = locale;
     pluralRules = (rules == null) ? PluralRules.ForLocale(ulocale, type)
                                   : rules;
     pluralRulesWrapper = new PluralSelectorAdapter(pluralRules); // ICU4N: Have to pass a reference to pluralRules in the constructor
     ResetPattern();
     this.numberFormat = (numberFormat == null) ? NumberFormat.GetInstance(ulocale) : numberFormat;
 }
Exemplo n.º 2
0
 /*
  * Initializes the <code>PluralRules</code> object.
  * Postcondition:<br/>
  *   <code>ulocale</code>    :  is <code>locale</code><br/>
  *   <code>pluralRules</code>:  if <code>rules</code> != <code>null</code>
  *                              it's set to rules, otherwise it is the
  *                              predefined plural rule set for the locale
  *                              <code>ulocale</code>.<br/>
  *   <code>parsedValues</code>: is <code>null</code><br/>
  *   <code>pattern</code>:      is <code>null</code><br/>
  *   <code>numberFormat</code>: a <code>NumberFormat</code> for the locale
  *                              <code>ulocale</code>.
  */
 private void Init(PluralRules rules, PluralType type, UCultureInfo locale, NumberFormat numberFormat)
 {
     ulocale     = locale;
     pluralRules = (rules == null) ? PluralRules.ForLocale(ulocale, type) // ICU4N TODO: Make extension method for UCultureInfo.GetPluralRules(PluralType)..?
                                   : rules;
     pluralRulesWrapper = new PluralSelectorAdapter(pluralRules);         // ICU4N: Have to pass a reference to pluralRules in the constructor
     ResetPattern();
     this.numberFormat = (numberFormat == null) ? NumberFormat.GetInstance(ulocale) : numberFormat;
 }