Package com.ibm.icu.text

Examples of com.ibm.icu.text.PluralFormat$PluralSelector


    System.out.println(lastNumber + "..." + 199 + ": " + lastValue);
    */
    log("test pattern: '" + testPattern + "'");
    for (int i = 0; i < locales.length; ++i) {
      try {
        PluralFormat plf = new PluralFormat(new ULocale(locales[i]), testPattern);
        log("plf: " + plf);
        String expected = (String) changes.get(new Integer(0));
        for (int n = 0; n < 200; ++n) {
          if (changes.get(new Integer(n)) != null) {
            expected = (String) changes.get(new Integer(n));
          }
          assertEquals("Locale: " + locales[i] + ", number: " + n,
                       expected, plf.format(n));
        }
      } catch (IllegalArgumentException e) {
        errln(e.getMessage() + " locale: " + locales[i] + " pattern: '" + testPattern + "' " + System.currentTimeMillis());
      }
    }
View Full Code Here


            Locale[] locales = { Locale.US }; // main test is in plural rules handler
            PluralFormat[] plfmts = new PluralFormat[locales.length];
            for (int i = 0; i < locales.length; i++) {
                ULocale uloc = ULocale.forLocale(locales[i]);
                try {
                    plfmts[i] = new PluralFormat(uloc, "one{1 foo} other{# foo}");
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return plfmts;
View Full Code Here

                }
            }
            return plfmts;
        }
        public boolean hasSameBehavior(Object a, Object b) {
            PluralFormat pfa = (PluralFormat)a;
            PluralFormat pfb = (PluralFormat)b;
            boolean isSame = true;
            for (int i = 0; i < 10; i++) {
                String texta = pfa.format(i);
                String textb = pfb.format(i);
                if (!texta.equals(textb)) {
                    isSame = false;
                    break;
                }
            }
View Full Code Here

TOP

Related Classes of com.ibm.icu.text.PluralFormat$PluralSelector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.