Package com.ibm.icu.util

Examples of com.ibm.icu.util.ChineseCalendar

This class should not be subclassed.

ChineseCalendar usually should be instantiated using {@link com.ibm.icu.util.Calendar#getInstance(ULocale)} passing in a ULocalewith the tag "@calendar=chinese".

@see com.ibm.icu.text.ChineseDateFormat @see com.ibm.icu.util.Calendar @author Alan Liu @stable ICU 2.8

    public void TestChineseDateFormatLocalizedPatternChars() {
        // jb 4904
        // make sure we can display localized versions of the chars used in the default
        // chinese date format patterns
        Calendar chineseCalendar = new ChineseCalendar();
        chineseCalendar.setTimeInMillis((new Date()).getTime());
        SimpleDateFormat longChineseDateFormat =
            (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();
View Full Code Here


        rb = null;
        sym = new DateFormatSymbols(GregorianCalendar.class, foo);
        sym.equals(null);
       
        sym = new ChineseDateFormatSymbols();
        sym = new ChineseDateFormatSymbols(new ChineseCalendar(), foo);
        // cover new ChineseDateFormatSymbols(Calendar, ULocale)
        ChineseCalendar ccal = new ChineseCalendar();
        sym = new ChineseDateFormatSymbols(ccal, ULocale.CHINA); //gclsh1 add
       
        StringBuffer buf = new StringBuffer();
        FieldPosition pos = new FieldPosition(0);
       
View Full Code Here

    {
        public Object[] getTestObjects()
        {
            Locale locales[] = SerializableTest.getLocales();
            TimeZone cst = TimeZone.getTimeZone("Asia/Shanghai");
            ChineseCalendar calendars[] = new ChineseCalendar[locales.length];
           
            for (int i = 0; i < locales.length; i += 1) {
                calendars[i] = new ChineseCalendar(cst, locales[i]);
            }
           
            return calendars;
        }
View Full Code Here

               
            case JAPANESE:
                return new JapaneseCalendar (icuTimeZone, locale);
              
            case CHINESE:
                return new ChineseCalendar (icuTimeZone, locale);
              
            case BUDDHIST:
                return new BuddhistCalendar (icuTimeZone, locale);
               
            case HEBREW:
View Full Code Here

     * @param locale the locale
     * @draft ICU 4.2
     */
   public ChineseDateFormat(String pattern, String override, ULocale locale) {
       super(pattern, new ChineseDateFormatSymbols(locale),
               new ChineseCalendar(TimeZone.getDefault(), locale), locale, true, override);
    }
View Full Code Here

     * @param locale the locale
     * @deprecated ICU 50
     */
   public ChineseDateFormat(String pattern, String override, ULocale locale) {
       super(pattern, new ChineseDateFormatSymbols(locale),
               new ChineseCalendar(TimeZone.getDefault(), locale), locale, true, override);
    }
View Full Code Here

TOP

Related Classes of com.ibm.icu.util.ChineseCalendar

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.