Examples of toLocalizedPattern()


Examples of com.ibm.icu.text.ChineseDateFormat.toLocalizedPattern()

       
        // TODO: revisit toLocalizedPattern
        if (false) {
            SimpleDateFormat fmt = new SimpleDateFormat("aabbcc");
            try {
                String pat = fmt.toLocalizedPattern();
                errln("whoops, shouldn't have been able to localize aabbcc");
            }
            catch (IllegalArgumentException e) {
                logln("aabbcc localize ok");
            }
View Full Code Here

Examples of com.ibm.icu.text.DateFormat.toLocalizedPattern()

       
        // TODO: revisit toLocalizedPattern
        if (false) {
            SimpleDateFormat fmt = new SimpleDateFormat("aabbcc");
            try {
                String pat = fmt.toLocalizedPattern();
                errln("whoops, shouldn't have been able to localize aabbcc");
            }
            catch (IllegalArgumentException e) {
                logln("aabbcc localize ok");
            }
View Full Code Here

Examples of com.ibm.icu.text.DecimalFormat.toLocalizedPattern()

     * Test method for 'com.ibm.icu.text.DecimalFormat.toLocalizedPattern()'
     */
    public void testToLocalizedPattern() {
        DecimalFormat df = new DecimalFormat("#,##0.##", new DecimalFormatSymbols(Locale.FRANCE));
        assertEquals("#,##0.##", df.toPattern());
        assertEquals("#\u00a0##0,##", df.toLocalizedPattern());
    }

    /*
     * Test method for 'com.ibm.icu.text.DecimalFormat.applyPattern(String)'
     */
 
View Full Code Here

Examples of com.ibm.icu.text.SimpleDateFormat.toLocalizedPattern()

            (SimpleDateFormat)chineseCalendar.getDateTimeFormat(DateFormat.LONG, DateFormat.LONG, Locale.CHINA );
        DateFormatSymbols dfs = new ChineseDateFormatSymbols( chineseCalendar, Locale.CHINA );
        longChineseDateFormat.setDateFormatSymbols( dfs );
        // This next line throws the exception
        try {
            longChineseDateFormat.toLocalizedPattern();
        }
        catch (Exception e) {
            errln("could not localized pattern: " + e.getMessage());
        }
    }
View Full Code Here

Examples of java.text.DecimalFormat.toLocalizedPattern()

  public void test(TestHarness harness)
  {
    DecimalFormat f = new DecimalFormat(
        "\u00A4#,##0.00", new DecimalFormatSymbols(Locale.UK)
    );
    harness.check(f.toLocalizedPattern(), "\u00A4#,##0.00");
  }

}
View Full Code Here

Examples of java.text.DecimalFormat.toLocalizedPattern()

    // There aren't really many tests we can do, since it doesn't
    // seem like any canonical output format is documented.

    DecimalFormat df = new DecimalFormat("0.##");
    harness.check(df.toPattern(), "#0.##");
    harness.check(df.toLocalizedPattern(), "#0.##");

    DecimalFormatSymbols dfs = df.getDecimalFormatSymbols();
    dfs.setDecimalSeparator(',');
    dfs.setZeroDigit('1');
    dfs.setDigit('X');
View Full Code Here

Examples of java.text.DecimalFormat.toLocalizedPattern()

    dfs.setGroupingSeparator('!');
    df.setDecimalFormatSymbols(dfs);
   
    // dfs is only a copy of the internal
    // symbols so pass symbols back to df
    harness.check(df.toLocalizedPattern(), "X1,XX");

    df.applyPattern("Fr #,##0.##");
   
    String x1 = df.toPattern();
    String x2 = df.toLocalizedPattern();
View Full Code Here

Examples of java.text.DecimalFormat.toLocalizedPattern()

    harness.check(df.toLocalizedPattern(), "X1,XX");

    df.applyPattern("Fr #,##0.##");
   
    String x1 = df.toPattern();
    String x2 = df.toLocalizedPattern();
    harness.check(x1.length(), x2.length());
   
    boolean ok = x1.length() == x2.length();
    for (int i = 0; i < x1.length(); ++i)
      {
View Full Code Here

Examples of java.text.DecimalFormat.toLocalizedPattern()

      // There aren't really many tests we can do, since it doesn't
      // seem like any canonical output format is documented.

      DecimalFormat df = new DecimalFormat ("0.##");
      harness.check (df.toPattern (), "#0.##");
      harness.check (df.toLocalizedPattern (), "#0.##");
     
      DecimalFormatSymbols dfs = df.getDecimalFormatSymbols ();
      dfs.setDecimalSeparator (',');
      dfs.setZeroDigit ('1');
      dfs.setDigit ('X');
View Full Code Here

Examples of java.text.DecimalFormat.toLocalizedPattern()

      dfs.setZeroDigit ('1');
      dfs.setDigit ('X');
      dfs.setGroupingSeparator ('!');
      df.setDecimalFormatSymbols(dfs);   // dfs is only a copy of the internal
                                         // symbols so pass symbols back to df
      harness.check (df.toLocalizedPattern (), "X1,XX");

      df.applyPattern ("Fr #,##0.##");
      String x1 = df.toPattern ();
      String x2 = df.toLocalizedPattern ();
      harness.check (x1.length (), x2.length ());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.