ICU-3301 move data from J to C format
X-SVN-Rev: 15474
This commit is contained in:
parent
6d44d8587d
commit
481973c60b
@ -200,6 +200,15 @@ public class BuddhistCalendar extends GregorianCalendar {
|
||||
}
|
||||
return super.handleGetLimit(field, limitType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current Calendar type.
|
||||
* @return type of calendar (gregorian, etc.)
|
||||
* @internal ICU 3.0
|
||||
*/
|
||||
public String getType() {
|
||||
return "buddhist";
|
||||
}
|
||||
|
||||
/*
|
||||
private static CalendarFactory factory;
|
||||
|
@ -10,6 +10,7 @@ import com.ibm.icu.impl.ICUResourceBundle;
|
||||
import com.ibm.icu.impl.ICUService.Factory;
|
||||
import com.ibm.icu.impl.ICULocaleService;
|
||||
import com.ibm.icu.impl.ICULocaleService.LocaleKeyFactory;
|
||||
import com.ibm.icu.impl.CalendarData;
|
||||
import com.ibm.icu.text.DateFormat;
|
||||
import com.ibm.icu.text.DateFormatSymbols;
|
||||
import com.ibm.icu.text.SimpleDateFormat;
|
||||
@ -2857,13 +2858,10 @@ public abstract class Calendar implements Serializable, Cloneable {
|
||||
// See if there are any custom resources for this calendar
|
||||
// If not, just use the default DateFormat
|
||||
DateFormat result = null;
|
||||
|
||||
ResourceBundle bundle = DateFormatSymbols.getDateFormatBundle(cal, loc);
|
||||
|
||||
if (bundle != null) {
|
||||
|
||||
|
||||
try {
|
||||
String[] patterns = bundle.getStringArray("DateTimePatterns");
|
||||
CalendarData calData = new CalendarData(new ULocale(loc), cal.getType());
|
||||
String[] patterns = calData.get("DateTimePatterns").getStringArray();
|
||||
|
||||
String pattern = null;
|
||||
if ((timeStyle >= 0) && (dateStyle >= 0)) {
|
||||
@ -2887,9 +2885,6 @@ public abstract class Calendar implements Serializable, Cloneable {
|
||||
DateFormatSymbols symbols = new DateFormatSymbols(cal, loc);
|
||||
((SimpleDateFormat) result).setDateFormatSymbols(symbols); // aliu
|
||||
}
|
||||
} else {
|
||||
result = SimpleDateFormat.getDateTimeInstance(dateStyle, timeStyle, loc);
|
||||
}
|
||||
result.setCalendar(cal);
|
||||
return result;
|
||||
}
|
||||
@ -3691,15 +3686,15 @@ public abstract class Calendar implements Serializable, Cloneable {
|
||||
WeekData data = (WeekData) cachedLocaleData.get(locale);
|
||||
|
||||
if (data == null) { /* cache miss */
|
||||
ICUResourceBundle dateRes = (ICUResourceBundle)UResourceBundle.getBundleInstance(UResourceBundle.ICU_BASE_NAME,locale);
|
||||
int[] dateTimeElements = dateRes.get("DateTimeElements").getIntVector();
|
||||
String[] weekend = UResourceBundle.getBundleInstance("CalendarData", locale).getStringArray("Weekend");
|
||||
CalendarData calData = new CalendarData(new ULocale(locale), getType());
|
||||
int[] dateTimeElements = calData.get("DateTimeElements").getIntVector();
|
||||
int[] weekend = calData.get("weekend").getIntVector();
|
||||
data = new WeekData(dateTimeElements[0],dateTimeElements[1],
|
||||
Integer.parseInt(weekend[0]),
|
||||
Integer.parseInt(weekend[1]),
|
||||
Integer.parseInt(weekend[2]),
|
||||
Integer.parseInt(weekend[3]),
|
||||
dateRes.getULocale());
|
||||
weekend[0],
|
||||
weekend[1],
|
||||
weekend[2],
|
||||
weekend[3],
|
||||
calData.getULocale());
|
||||
/* cache update */
|
||||
cachedLocaleData.put(locale, data);
|
||||
}
|
||||
@ -4890,6 +4885,16 @@ public abstract class Calendar implements Serializable, Cloneable {
|
||||
return time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current Calendar type.
|
||||
* Note, in 3.0 this function will return 'gregorian' in Calendar to emulate legacy behavior
|
||||
* @return type of calendar (gregorian, etc)
|
||||
* @internal ICU 3.0
|
||||
*/
|
||||
public String getType() {
|
||||
return "gregorian";
|
||||
}
|
||||
|
||||
// -------- BEGIN ULocale boilerplate --------
|
||||
|
||||
/**
|
||||
|
@ -798,6 +798,14 @@ public class ChineseCalendar extends Calendar {
|
||||
return julianDay - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current Calendar type.
|
||||
* @return type of calendar (gregorian, etc.)
|
||||
* @internal ICU 3.0
|
||||
*/
|
||||
public String getType() {
|
||||
return "chinese";
|
||||
}
|
||||
|
||||
/*
|
||||
private static CalendarFactory factory;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1996-2003, International Business Machines
|
||||
* Copyright (C) 1996-2004, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*/
|
||||
package com.ibm.icu.util;
|
||||
@ -844,6 +844,15 @@ public class GregorianCalendar extends Calendar {
|
||||
return julianDay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current Calendar type.
|
||||
* @return type of calendar (gregorian, etc.)
|
||||
* @internal ICU 3.0
|
||||
*/
|
||||
public String getType() {
|
||||
return "gregorian";
|
||||
}
|
||||
|
||||
/*
|
||||
private static CalendarFactory factory;
|
||||
public static CalendarFactory factory() {
|
||||
|
@ -802,6 +802,17 @@ public class HebrewCalendar extends Calendar {
|
||||
return (int) (day + 347997);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current Calendar type.
|
||||
* @return type of calendar (gregorian, etc.)
|
||||
* @internal ICU 3.0
|
||||
*/
|
||||
public String getType() {
|
||||
return "hebrew";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
private static CalendarFactory factory;
|
||||
public static CalendarFactory factory() {
|
||||
|
@ -605,6 +605,15 @@ public class IslamicCalendar extends Calendar {
|
||||
internalSet(DAY_OF_YEAR, dayOfYear);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current Calendar type.
|
||||
* @return type of calendar (gregorian, etc.)
|
||||
* @internal ICU 3.0
|
||||
*/
|
||||
public String getType() {
|
||||
return "islamic";
|
||||
}
|
||||
|
||||
/*
|
||||
private static CalendarFactory factory;
|
||||
public static CalendarFactory factory() {
|
||||
|
@ -561,6 +561,15 @@ public class JapaneseCalendar extends GregorianCalendar {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current Calendar type.
|
||||
* @return type of calendar (gregorian, etc.)
|
||||
* @internal ICU 3.0
|
||||
*/
|
||||
public String getType() {
|
||||
return "japanese";
|
||||
}
|
||||
|
||||
/*
|
||||
private static CalendarFactory factory;
|
||||
public static CalendarFactory factory() {
|
||||
|
Loading…
Reference in New Issue
Block a user