/libcore/ojluni/src/test/java/time/test/java/util/ |
D | TestFormatter.java | 119 for (Locale locale : locales) { in test() 121 testDate(fmtStr, locale, zdt, cal); in test() 124 testTime(fmtStr, locale, zdt, cal); in test() 126 testZoneId(locale, zdt, cal); in test() 127 testInstant(locale, instant, zdt, cal); in test() 157 private String test(String fmtStr, Locale locale, in test() argument 160 new StringBuilder(), locale).format(fmtStr, dt).out().toString(); in test() 174 private void printFmtStr(Locale locale, String fmtStr) { in printFmtStr() argument 177 System.out.printf("[%s, %s]%n", locale.toString(), fmtStr); in printFmtStr() 181 private void testDate(String fmtStr, Locale locale, in testDate() argument [all …]
|
/libcore/ojluni/src/test/java/time/test/java/time/format/ |
D | TestZoneTextPrinterParser.java | 63 protected static DateTimeFormatter getFormatter(Locale locale, TextStyle style) { in getFormatter() argument 65 .toFormatter(locale) in getFormatter() 66 .withDecimalStyle(DecimalStyle.of(locale)); in getFormatter() 83 for (Locale locale : locales) { in test_printText() 85 if (locale.getLanguage().equals("ji")) { in test_printText() 104 printText(locale, zdt, TextStyle.FULL, tz, in test_printText() 105 tz.getDisplayName(isDST, TimeZone.LONG, locale)); in test_printText() 106 printText(locale, zdt, TextStyle.SHORT, tz, in test_printText() 107 tz.getDisplayName(isDST, TimeZone.SHORT, locale)); in test_printText() 113 …private void printText(Locale locale, ZonedDateTime zdt, TextStyle style, TimeZone zone, String ex… in printText() argument [all …]
|
D | AbstractTestPrinterParser.java | 87 protected Locale locale; field in AbstractTestPrinterParser 96 locale = Locale.ENGLISH; in setUp() 117 return builder.toFormatter(locale).withDecimalStyle(decimalStyle); in getFormatter() 121 return builder.appendLiteral(c).toFormatter(locale).withDecimalStyle(decimalStyle); in getFormatter() 125 return builder.appendLiteral(s).toFormatter(locale).withDecimalStyle(decimalStyle); in getFormatter() 129 return builder.appendText(field).toFormatter(locale).withDecimalStyle(decimalStyle); in getFormatter() 133 return builder.appendText(field, style).toFormatter(locale).withDecimalStyle(decimalStyle); in getFormatter() 137 …return builder.appendValue(field, minWidth, maxWidth, signStyle).toFormatter(locale).withDecimalSt… in getFormatter() 141 …return builder.appendOffset(pattern, noOffsetText).toFormatter(locale).withDecimalStyle(decimalSty… in getFormatter() 145 return builder.appendPattern(pattern).toFormatter(locale).withDecimalStyle(decimalStyle); in getPatternFormatter()
|
/libcore/luni/src/main/java/libcore/icu/ |
D | LocaleData.java | 175 private LocaleData(Locale locale) { in LocaleData() argument 176 mLocale = locale; in LocaleData() 184 public static Locale mapInvalidAndNullLocales(Locale locale) { in mapInvalidAndNullLocales() argument 185 if (locale == null) { in mapInvalidAndNullLocales() 189 if ("und".equals(locale.toLanguageTag())) { in mapInvalidAndNullLocales() 193 return locale; in mapInvalidAndNullLocales() 202 public static Locale getCompatibleLocaleForBug159514442(Locale locale) { in getCompatibleLocaleForBug159514442() argument 203 if (Locale.ROOT.equals(locale)) { in getCompatibleLocaleForBug159514442() 209 locale = LOCALE_EN_US_POSIX; in getCompatibleLocaleForBug159514442() 212 return locale; in getCompatibleLocaleForBug159514442() [all …]
|
D | ICU.java | 59 for (Locale locale : new Locale[] {Locale.US, Locale.getDefault()}) { 60 getTimePattern(locale, false, false); in getTimePattern() argument 61 getTimePattern(locale, false, true); in getTimePattern() argument 62 getTimePattern(locale, true, false); in getTimePattern() argument 63 getTimePattern(locale, true, true); in getTimePattern() argument 289 /* package */ static String getTimePattern(Locale locale, boolean is24Hour, boolean withSecond) { in getTimePattern() argument 296 return getBestDateTimePattern(skeleton, locale); in getTimePattern() 300 public static String getBestDateTimePattern(String skeleton, Locale locale) { in getBestDateTimePattern() argument 301 String languageTag = locale.toLanguageTag(); in getBestDateTimePattern() 306 pattern = getBestDateTimePattern0(skeleton, locale); in getBestDateTimePattern() [all …]
|
D | TimeZoneNames.java | 52 @Override protected String[][] create(Locale locale) { in create() argument 56 … String[][] result = TimeZoneNamesNative.getFilledZoneStrings(locale, availableTimeZoneIds); in create() 67 System.logI("Loaded time zone names for \"" + locale + "\" in " + duration + "ms" + in create() 142 public static String[][] getZoneStrings(Locale locale) { in getZoneStrings() argument 143 if (locale == null) { in getZoneStrings() 144 locale = Locale.getDefault(); in getZoneStrings() 146 return cachedZoneStrings.get(locale); in getZoneStrings()
|
/libcore/ojluni/src/main/java/sun/util/locale/provider/ |
D | CalendarDataUtility.java | 26 package sun.util.locale.provider; 104 Locale locale) { in retrieveFieldValueName() argument 127 String[] names = getNames(id, field, style, locale); in retrieveFieldValueName() 151 Locale locale) { in retrieveJavaTimeFieldValueName() argument 153 return retrieveFieldValueName(id, field, value, style, locale); in retrieveJavaTimeFieldValueName() 167 Locale locale) { in retrieveFieldValueNames() argument 170 names = retrieveFieldValueNamesImpl(id, field, SHORT_FORMAT, locale); in retrieveFieldValueNames() 172 names.putAll(retrieveFieldValueNamesImpl(id, field, st, locale)); in retrieveFieldValueNames() 176 names = retrieveFieldValueNamesImpl(id, field, style, locale); in retrieveFieldValueNames() 198 int style, Locale locale) { in retrieveJavaTimeFieldValueNames() argument [all …]
|
/libcore/luni/src/test/java/libcore/java/text/ |
D | DecimalFormatTest.java | 171 …erAndFractionByLocale(String value, int multiplier, int fraction, Locale locale, String expectedRe… in assertDecFmtWithMultiplierAndFractionByLocale() argument 172 DecimalFormat df = (DecimalFormat)NumberFormat.getIntegerInstance(locale); in assertDecFmtWithMultiplierAndFractionByLocale() 310 for (Locale locale : Locale.getAvailableLocales()) { in testCurrencySymbolSpacing() 311 DecimalFormatSymbols dfs = new DecimalFormatSymbols(locale); in testCurrencySymbolSpacing() 314 assertCurrencyFormat("USD" + formattedZero, "\u00a4\u00a40", dfs, currency, locale); in testCurrencySymbolSpacing() 315 assertCurrencyFormat(formattedZero + "USD", "0\u00a4\u00a4", dfs, currency, locale); in testCurrencySymbolSpacing() 316 assertCurrencyFormat(currency.getSymbol(locale) + formattedZero, "\u00a40", dfs, in testCurrencySymbolSpacing() 317 currency, locale); in testCurrencySymbolSpacing() local 318 assertCurrencyFormat(formattedZero + currency.getSymbol(locale), "0\u00a4", dfs, in testCurrencySymbolSpacing() 319 currency, locale); in testCurrencySymbolSpacing() [all …]
|
/libcore/ojluni/src/main/java/java/text/ |
D | BreakIterator.java | 453 public static BreakIterator getWordInstance(Locale locale) in getWordInstance() argument 457 android.icu.text.BreakIterator.getWordInstance(locale)); in getWordInstance() 479 public static BreakIterator getLineInstance(Locale locale) in getLineInstance() argument 483 android.icu.text.BreakIterator.getLineInstance(locale)); in getLineInstance() 505 public static BreakIterator getCharacterInstance(Locale locale) in getCharacterInstance() argument 509 android.icu.text.BreakIterator.getCharacterInstance(locale)); in getCharacterInstance() 531 public static BreakIterator getSentenceInstance(Locale locale) in getSentenceInstance() argument 535 android.icu.text.BreakIterator.getSentenceInstance(locale)); in getSentenceInstance()
|
D | DateFormatSymbols.java | 139 public DateFormatSymbols(Locale locale) in DateFormatSymbols() argument 141 initializeData(locale); in DateFormatSymbols() 283 Locale locale = null; field in DateFormatSymbols 406 public static final DateFormatSymbols getInstance(Locale locale) { in getInstance() argument 408 return (DateFormatSymbols) getCachedInstance(locale).clone(); in getInstance() 417 static final DateFormatSymbols getInstanceRef(Locale locale) { in getInstanceRef() argument 419 return getCachedInstance(locale); in getInstanceRef() 430 private static DateFormatSymbols getCachedInstance(Locale locale) { in getCachedInstance() argument 431 Locale cacheKey = LocaleData.getCompatibleLocaleForBug159514442(locale); in getCachedInstance() 435 dfs = new DateFormatSymbols(locale); in getCachedInstance() [all …]
|
D | DecimalFormatSymbols.java | 101 public DecimalFormatSymbols( Locale locale ) { in DecimalFormatSymbols() argument 102 initialize( locale ); in DecimalFormatSymbols() 154 public static final DecimalFormatSymbols getInstance(Locale locale) { in getInstance() argument 156 return new DecimalFormatSymbols(locale); in getInstance() 454 currencySymbol = currency.getSymbol(locale); in setInternationalCurrencySymbol() 492 currencySymbol = currency.getSymbol(locale); in setCurrency() 615 locale.equals(other.locale)); in equals() 639 result = result * 37 + locale.hashCode(); in hashCode() 647 private void initialize( Locale locale ) { in initialize() argument 648 this.locale = locale; in initialize() [all …]
|
D | MessageFormat.java | 362 this.locale = Locale.getDefault(Locale.Category.FORMAT); in MessageFormat() 379 public MessageFormat(String pattern, Locale locale) { in MessageFormat() argument 380 this.locale = locale; in MessageFormat() 401 public void setLocale(Locale locale) { in setLocale() argument 402 this.locale = locale; in setLocale() 411 return locale; in getLocale() 534 if (fmt.equals(NumberFormat.getInstance(locale))) { in toPattern() 536 } else if (fmt.equals(NumberFormat.getCurrencyInstance(locale))) { in toPattern() 538 } else if (fmt.equals(NumberFormat.getPercentInstance(locale))) { in toPattern() 540 } else if (fmt.equals(NumberFormat.getIntegerInstance(locale))) { in toPattern() [all …]
|
/libcore/luni/src/test/java/libcore/libcore/icu/ |
D | ICUCalendarTest.java | 41 for (ULocale locale : ULocale.getAvailableLocales()) { in testAllDefaultCalendar_Gregorian() 42 assertTrue("Default calendar should be Gregorian: " + locale, in testAllDefaultCalendar_Gregorian() 43 Calendar.getInstance(locale) instanceof GregorianCalendar); in testAllDefaultCalendar_Gregorian() 46 for (ULocale locale : ULocale.getAvailableLocales()) { in testAllDefaultCalendar_Gregorian() 51 ICUData.ICU_BASE_NAME, locale); in testAllDefaultCalendar_Gregorian() 53 assertEquals("calendar/default should be Gregorian: " + locale, "gregorian", calType); in testAllDefaultCalendar_Gregorian()
|
D | AlphabeticIndexTest.java | 45 Locale locale = Locale.forLanguageTag(language); in testBucketCount_withNoIndexCharacters() local 47 ULocale.forLocale(locale), 0, LocaleData.ES_INDEX); in testBucketCount_withNoIndexCharacters() 49 localeWithNoIndexCharacters = locale; in testBucketCount_withNoIndexCharacters() 64 private void verifyIndex(Locale locale) { in verifyIndex() argument 65 ULocale uLocale = ULocale.forLocale(locale); in verifyIndex() 74 … assertTrue("Locale(" + locale + ") does not have enough buckets: " + index.getBucketLabels(), in verifyIndex()
|
D | ICULocaleDataTest.java | 45 for (ULocale locale : ULocale.getAvailableLocales()) { in testGetDelimiter() 46 LocaleData localeData = LocaleData.getInstance(locale); in testGetDelimiter() 50 assertNotNull("Delimiter is null in this locale " + locale, delimiter); in testGetDelimiter() 51 assertFalse("Delimiter is empty in this locale " + locale, delimiter.isEmpty()); in testGetDelimiter()
|
/libcore/ojluni/src/main/java/java/util/ |
D | Currency.java | 320 public static Currency getInstance(Locale locale) { in getInstance() argument 321 String country = locale.getCountry(); in getInstance() 363 android.icu.util.Currency.getInstance(locale); in getInstance() 364 String variant = locale.getVariant(); in getInstance() 371 throw new IllegalArgumentException("Unsupported ISO 3166 country: " + locale); in getInstance() 479 public String getSymbol(Locale locale) { in getSymbol() argument 494 if (locale == null) { in getSymbol() 497 return icuCurrency.getSymbol(locale); in getSymbol() 561 public String getDisplayName(Locale locale) { in getDisplayName() argument 576 return icuCurrency.getDisplayName(Objects.requireNonNull(locale)); in getDisplayName()
|
D | ResourceBundle.java | 64 import sun.util.locale.BaseLocale; 65 import sun.util.locale.LocaleObjectCache; 343 private Locale locale = null; field in ResourceBundle 463 return locale; in getLocale() 541 private Locale locale; field in ResourceBundle.CacheKey 565 CacheKey(String baseName, Locale locale, ClassLoader loader) { in CacheKey() argument 567 this.locale = locale; in CacheKey() 589 return locale; in getLocale() 592 CacheKey setLocale(Locale locale) { in setLocale() argument 593 if (!this.locale.equals(locale)) { in setLocale() [all …]
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | OldAndroidLocaleTest.java | 36 Locale locale = new Locale("en"); in testLocale() local 37 assertEquals("en", locale.toString()); in testLocale() 39 locale = new Locale("en", "US"); in testLocale() 40 assertEquals("en_US", locale.toString()); in testLocale() 42 locale = new Locale("en", "", "POSIX"); in testLocale() 43 assertEquals("en__POSIX", locale.toString()); in testLocale() 45 locale = new Locale("en", "US", "POSIX"); in testLocale() 46 assertEquals("en_US_POSIX", locale.toString()); in testLocale()
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | BreakIteratorBenchmark.java | 39 final Locale locale; field in BreakIteratorBenchmark.Text 42 Text(Locale locale, String text) { in Text() argument 44 this.locale = locale; in Text() 52 BreakIterator it = BreakIterator.getLineInstance(text.locale); in timeBreakIterator() 63 android.icu.text.BreakIterator.getLineInstance(text.locale); in timeIcuBreakIterator()
|
/libcore/ojluni/src/main/java/java/time/format/ |
D | DateTimeTextProvider.java | 93 import sun.util.locale.provider.CalendarDataUtility; 141 public String getText(TemporalField field, long value, TextStyle style, Locale locale) { in getText() argument 142 Object store = findStore(field, locale); in getText() 165 TextStyle style, Locale locale) { in getText() argument 168 return getText(field, value, style, locale); in getText() 200 chrono.getCalendarType(), fieldIndex, fieldValue, style.toCalendarStyle(), locale); in getText() 219 …terator<Entry<String, Long>> getTextIterator(TemporalField field, TextStyle style, Locale locale) { in getTextIterator() argument 220 Object store = findStore(field, locale); in getTextIterator() 245 TextStyle style, Locale locale) { in getTextIterator() argument 248 return getTextIterator(field, style, locale); in getTextIterator() [all …]
|
D | DecimalStyle.java | 154 public static DecimalStyle of(Locale locale) { in of() argument 155 Objects.requireNonNull(locale, "locale"); in of() 156 DecimalStyle info = CACHE.get(locale); in of() 158 info = create(locale); in of() 159 CACHE.putIfAbsent(locale, info); in of() 160 info = CACHE.get(locale); in of() 165 private static DecimalStyle create(Locale locale) { in create() argument 166 DecimalFormatSymbols oldSymbols = DecimalFormatSymbols.getInstance(locale); in create()
|
/libcore/ojluni/src/test/java/time/tck/java/time/format/ |
D | TCKLocalizedPrinterParser.java | 144 …blic void test_date_print(LocalDate date, FormatStyle dateStyle, int dateStyleOld, Locale locale) { in test_date_print() argument 145 DateFormat old = DateFormat.getDateInstance(dateStyleOld, locale); in test_date_print() 149 DateTimeFormatter f = builder.appendLocalized(dateStyle, null).toFormatter(locale); in test_date_print() 156 …blic void test_date_parse(LocalDate date, FormatStyle dateStyle, int dateStyleOld, Locale locale) { in test_date_parse() argument 157 DateFormat old = DateFormat.getDateInstance(dateStyleOld, locale); in test_date_parse() 161 DateTimeFormatter f = builder.appendLocalized(dateStyle, null).toFormatter(locale); in test_date_parse() 197 …blic void test_time_print(LocalTime time, FormatStyle timeStyle, int timeStyleOld, Locale locale) { in test_time_print() argument 198 DateFormat old = DateFormat.getTimeInstance(timeStyleOld, locale); in test_time_print() 202 DateTimeFormatter f = builder.appendLocalized(null, timeStyle).toFormatter(locale); in test_time_print() 209 …blic void test_time_parse(LocalTime time, FormatStyle timeStyle, int timeStyleOld, Locale locale) { in test_time_parse() argument [all …]
|
D | TCKLocalizedFieldParser.java | 99 WeekFields weekDef = WeekFields.of(locale); in test_parse_textField() 120 DateTimeFormatter dtf = b.toFormatter(locale); in test_parse_textField() 152 DateTimeFormatter dtf = b.toFormatter(locale); in test_parse_textLocalDate() 159 assertEquals(parsed.isSupported(WeekFields.of(locale).dayOfWeek()), true); in test_parse_textLocalDate() 160 assertEquals(parsed.isSupported(WeekFields.of(locale).weekOfMonth()) || in test_parse_textLocalDate() 161 parsed.isSupported(WeekFields.of(locale).weekOfYear()), true); in test_parse_textLocalDate() 189 DateTimeFormatter dtf = b.toFormatter(locale); in test_parse_WeekBasedYear() 194 WeekFields weekDef = WeekFields.of(locale); in test_parse_WeekBasedYear()
|
/libcore/libart/src/main/java/java/lang/ |
D | CaseMapper.java | 45 public static String toLowerCase(Locale locale, String s) { in toLowerCase() argument 48 String languageCode = locale.getLanguage(); in toLowerCase() 50 return CaseMapperNative.toLowerCase(s, locale); in toLowerCase() 59 return CaseMapperNative.toLowerCase(s, locale); in toLowerCase() 146 public static String toUpperCase(Locale locale, String s, int count) { in toUpperCase() argument 147 String languageCode = locale.getLanguage(); in toUpperCase() 149 return CaseMapperNative.toUpperCase(s, locale); in toUpperCase() 160 return CaseMapperNative.toUpperCase(s, locale); in toUpperCase()
|
/libcore/luni/src/main/native/ |
D | ScopedIcuULoc.h | 25 static void getLocale(const char* localeName, std::string& locale, UErrorCode* status) { in getLocale() argument 34 locale = buffer; in getLocale() 48 locale = buffer.get(); in getLocale() 81 const char* locale() const { in locale() function
|