ICU-646 update localPatternChars

X-SVN-Rev: 17976
This commit is contained in:
Ram Viswanadha 2005-06-22 18:52:46 +00:00
parent f70af9d462
commit fe05e25ed9
5 changed files with 44 additions and 14 deletions

View file

@ -180,7 +180,9 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
DateFormatSymbols rootSyms = new DateFormatSymbols(new Locale("", "", ""));
assertEquals("patternChars", PATTERN_CHARS, rootSyms.getLocalPatternChars());
assertTrue("DATEFORMAT_FIELD_NAMES", DATEFORMAT_FIELD_NAMES.length == DateFormat.FIELD_COUNT);
assertTrue("Data", DateFormat.FIELD_COUNT == PATTERN_CHARS.length());
if(DateFormat.FIELD_COUNT != PATTERN_CHARS.length()){
errln("Did not get the correct value for DateFormat.FIELD_COUNT. Expected: "+ PATTERN_CHARS.length());
}
// Create test formatters
final int COUNT = 4;
@ -204,17 +206,19 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
// Expected output field values for above DateFormats on aug13
// Fields are given in order of DateFormat field number
final String EXPECTED[] = {
"", "1997", "August", "13", "", "", "34", "12", "",
"Wednesday", "", "", "", "", "PM", "2", "", "PDT", "", "", "", "", "", "", "",
"", "1997", "August", "13", "", "", "34", "12", "",
"Wednesday", "", "", "", "", "PM", "2", "", "PDT", "", "", "", "", "", "", "","","",
"", "1997", "ao\u00FBt", "13", "", "14", "34", "", "",
"mercredi", "", "", "", "", "", "", "", "HAP (\u00C9UA)", "", "", "", "", "", "", "",
"mercredi", "", "", "", "", "", "", "", "HAP (\u00C9UA)", "", "", "", "", "", "", "","","",
"AD", "1997", "8", "13", "14", "14", "34", "12", "5",
"Wed", "225", "2", "33", "3", "PM", "2", "2", "PDT", "1997", "4", "1997", "2450674", "52452513", "-0700", "PT",
"Wed", "225", "2", "33", "3", "PM", "2", "2", "PDT", "1997", "4", "1997", "2450674", "52452513", "-0700", "PT","4","7",
"AD", "1997", "August", "0013", "0014", "0014", "0034", "0012", "5130",
"Wednesday", "0225", "0002", "0033", "0003", "PM", "0002", "0002", "Pacific Daylight Time", "1997", "0004", "1997", "2450674", "52452513", "-0700", "Pacific Time",
"Wednesday", "0225", "0002", "0033", "0003", "PM", "0002", "0002", "Pacific Daylight Time", "1997", "0004", "1997", "2450674", "52452513", "-0700", "Pacific Time","0004","0007"
};
assertTrue("data size", EXPECTED.length == COUNT * DateFormat.FIELD_COUNT);
@ -243,11 +247,10 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
}
}
}
/**
* This MUST be kept in sync with DateFormatSymbols.patternChars.
*/
static final String PATTERN_CHARS = "GyMdkHmsSEDFwWahKzYeugAZv";
static final String PATTERN_CHARS = "GyMdkHmsSEDFwWahKzYeugAZvcL";
/**
* A list of the names of all the fields in DateFormat.
@ -278,7 +281,9 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
"JULIAN_DAY_FIELD",
"MILLISECONDS_IN_DAY_FIELD",
"TIMEZONE_RFC_FIELD",
"GENERIC_TIMEZONE_FIELD",
"GENERIC_TIMEZONE_FIELD",
"STAND_ALONE_DAY_FIELD",
"STAND_ALONE_MONTH_FIELD",
};
/**

View file

@ -328,14 +328,34 @@ public abstract class DateFormat extends UFormat {
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public final static int TIMEZONE_GENERIC_FIELD = 24;
/**
* FieldPosition selector for 'c' field alignment,
* corresponding to the {@link Calendar#DAY} field.
* This displays the stand alone day name, if available.
* @draft ICU 3.4
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public final static int STANDALONE_DAY_FIELD = 25;
/**
* FieldPosition selector for 'L' field alignment,
* corresponding to the {@link Calendar#MONTH} field.
* This displays the stand alone month name, if available.
* @draft ICU 3.4
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public final static int STANDALONE_MONTH_FIELD = 26;
/**
* Number of FieldPosition selectors for DateFormat.
* Valid selectors range from 0 to FIELD_COUNT-1.
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public final static int FIELD_COUNT = 25; // must == DateFormatSymbols.patternChars.length()
public final static int FIELD_COUNT = 27; // must == DateFormatSymbols.patternChars.length()
// Proclaim serial compatibility with 1.1 FCS
private static final long serialVersionUID = 7218322306649953788L;

View file

@ -204,7 +204,7 @@ public class DateFormatSymbols implements Serializable, Cloneable {
* Unlocalized date-time pattern characters. For example: 'y', 'd', etc.
* All locales use the same unlocalized pattern characters.
*/
static final String patternChars = "GyMdkHmsSEDFwWahKzYeugAZv";
static final String patternChars = "GyMdkHmsSEDFwWahKzYeugAZvcL";
/**
* Localized date-time pattern characters. For example, a locale may

View file

@ -1605,7 +1605,8 @@ public final class RuleBasedCollator extends Collator
UCA_INIT_COMPLETE = true;
}
static void checkUCA() throws MissingResourceException {
private static void checkUCA() throws MissingResourceException {
if (UCA_INIT_COMPLETE && UCA_ == null) {
throw new MissingResourceException("Collator UCA data unavailable", "", "");
}

View file

@ -655,7 +655,9 @@ public class SimpleDateFormat extends DateFormat {
/*hKz*/ Calendar.HOUR, Calendar.HOUR, Calendar.ZONE_OFFSET,
/*Yeu*/ Calendar.YEAR_WOY, Calendar.DOW_LOCAL, Calendar.EXTENDED_YEAR,
/*gAZ*/ Calendar.JULIAN_DAY, Calendar.MILLISECONDS_IN_DAY, Calendar.ZONE_OFFSET,
/*v*/ Calendar.ZONE_OFFSET
/*v*/ Calendar.ZONE_OFFSET,
/*c*/ Calendar.DAY_OF_WEEK,
/*L*/ Calendar.MONTH
};
// Map index into pattern character string to DateFormat field number
@ -668,7 +670,9 @@ public class SimpleDateFormat extends DateFormat {
/*hKz*/ DateFormat.HOUR1_FIELD, DateFormat.HOUR0_FIELD, DateFormat.TIMEZONE_FIELD,
/*Yeu*/ DateFormat.YEAR_WOY_FIELD, DateFormat.DOW_LOCAL_FIELD, DateFormat.EXTENDED_YEAR_FIELD,
/*gAZ*/ DateFormat.JULIAN_DAY_FIELD, DateFormat.MILLISECONDS_IN_DAY_FIELD, DateFormat.TIMEZONE_RFC_FIELD,
/*v*/ DateFormat.TIMEZONE_GENERIC_FIELD
/*v*/ DateFormat.TIMEZONE_GENERIC_FIELD,
/*c*/ DateFormat.STANDALONE_DAY_FIELD,
/*L*/ DateFormat.STANDALONE_MONTH_FIELD,
};
/**