/libcore/luni/src/main/java/java/util/ |
D | Currency.java | 66 public static Currency getInstance(Locale locale) { in getInstance() argument 68 if (locale == null) { in getInstance() 71 Currency currency = localesToCurrencies.get(locale); in getInstance() 75 String country = locale.getCountry(); in getInstance() 76 String variant = locale.getVariant(); in getInstance() 84 throw new IllegalArgumentException("Unsupported ISO 3166 country: " + locale); in getInstance() 89 localesToCurrencies.put(locale, result); in getInstance() 128 public String getDisplayName(Locale locale) { in getDisplayName() argument 129 return ICU.getCurrencyDisplayName(locale, currencyCode); in getDisplayName() 151 public String getSymbol(Locale locale) { in getSymbol() argument [all …]
|
D | ResourceBundle.java | 92 private Locale locale; field in ResourceBundle 154 public static ResourceBundle getBundle(String bundleName, Locale locale) { in getBundle() argument 159 return getBundle(bundleName, locale, classLoader); in getBundle() 211 public static ResourceBundle getBundle(String bundleName, Locale locale, in getBundle() argument 224 if (!locale.equals(defaultLocale)) { in getBundle() 225 bundle = handleGetBundle(false, bundleName, locale, loader); in getBundle() 230 throw missingResourceException(bundleName + '_' + locale, ""); in getBundle() 347 for (Locale locale : locales) { in processGetBundle() 351 bundle = control.newBundle(baseName, locale, format, in processGetBundle() 352 loader, control.needsReload(baseName, locale, in processGetBundle() [all …]
|
D | Calendar.java | 728 protected Calendar(TimeZone timezone, Locale locale) { in Calendar() argument 730 locale = LocaleData.mapInvalidAndNullLocales(locale); in Calendar() 731 LocaleData localeData = LocaleData.get(locale); in Calendar() 979 public static synchronized Calendar getInstance(Locale locale) { in getInstance() argument 980 return new GregorianCalendar(locale); in getInstance() 995 public static synchronized Calendar getInstance(TimeZone timezone, Locale locale) { in getInstance() argument 996 return new GregorianCalendar(timezone, locale); in getInstance() 1289 public String getDisplayName(int field, int style, Locale locale) { in getDisplayName() argument 1294 String[] array = getDisplayNameArray(field, style, locale); in getDisplayName() 1299 private String[] getDisplayNameArray(int field, int style, Locale locale) { in getDisplayNameArray() argument [all …]
|
D | Locale.java | 540 public Builder setLocale(Locale locale) { in setLocale() argument 541 if (locale == null) { in setLocale() 552 setLanguage(locale.getLanguage()); in setLocale() 553 setRegion(locale.getCountry()); in setLocale() 554 setVariant(locale.getVariant()); in setLocale() 566 this.script = locale.getScript(); in setLocale() 569 extensions.putAll(locale.extensions); in setLocale() 572 keywords.putAll(locale.unicodeKeywords); in setLocale() 575 attributes.addAll(locale.unicodeAttributes); in setLocale() 1024 public String getDisplayCountry(Locale locale) { in getDisplayCountry() argument [all …]
|
/libcore/luni/src/main/java/libcore/icu/ |
D | LocaleData.java | 125 public static Locale mapInvalidAndNullLocales(Locale locale) { in mapInvalidAndNullLocales() argument 126 if (locale == null) { in mapInvalidAndNullLocales() 130 if ("und".equals(locale.toLanguageTag())) { in mapInvalidAndNullLocales() 134 return locale; in mapInvalidAndNullLocales() 140 public static LocaleData get(Locale locale) { in get() argument 141 if (locale == null) { in get() 145 final String languageTag = locale.toLanguageTag(); in get() 152 LocaleData newLocaleData = initLocaleData(locale); in get() 205 private static LocaleData initLocaleData(Locale locale) { in initLocaleData() argument 207 if (!ICU.initLocaleDataNative(locale.toLanguageTag(), localeData)) { in initLocaleData() [all …]
|
D | NativeBreakIterator.java | 144 public static NativeBreakIterator getCharacterInstance(Locale locale) { in getCharacterInstance() argument 145 …return new NativeBreakIterator(getCharacterInstanceImpl(locale.toLanguageTag()), BI_CHAR_INSTANCE); in getCharacterInstance() 148 public static NativeBreakIterator getLineInstance(Locale locale) { in getLineInstance() argument 149 … return new NativeBreakIterator(getLineInstanceImpl(locale.toLanguageTag()), BI_LINE_INSTANCE); in getLineInstance() 152 public static NativeBreakIterator getSentenceInstance(Locale locale) { in getSentenceInstance() argument 153 … return new NativeBreakIterator(getSentenceInstanceImpl(locale.toLanguageTag()), BI_SENT_INSTANCE); in getSentenceInstance() 156 public static NativeBreakIterator getWordInstance(Locale locale) { in getWordInstance() argument 157 … return new NativeBreakIterator(getWordInstanceImpl(locale.toLanguageTag()), BI_WORD_INSTANCE); in getWordInstance() 160 private static native long getCharacterInstanceImpl(String locale); in getCharacterInstanceImpl() argument 161 private static native long getWordInstanceImpl(String locale); in getWordInstanceImpl() argument [all …]
|
D | TimeZoneNames.java | 60 @Override protected String[][] create(Locale locale) { in create() argument 70 fillZoneStrings(locale.toString(), result); in create() 80 System.logI("Loaded time zone names for \"" + locale + "\" in " + duration + "ms" + in create() 130 public static String[][] getZoneStrings(Locale locale) { in getZoneStrings() argument 131 if (locale == null) { in getZoneStrings() 132 locale = Locale.getDefault(); in getZoneStrings() 134 return cachedZoneStrings.get(locale); in getZoneStrings() 144 public static String[] forLocale(Locale locale) { in forLocale() argument 145 String countryCode = locale.getCountry(); in forLocale() 160 public static native String getExemplarLocation(String locale, String tz); in getExemplarLocation() argument [all …]
|
D | ICU.java | 276 public static String getBestDateTimePattern(String skeleton, Locale locale) { in getBestDateTimePattern() argument 277 String languageTag = locale.toLanguageTag(); in getBestDateTimePattern() 349 public static String toLowerCase(String s, Locale locale) { in toLowerCase() argument 350 return toLowerCase(s, locale.toLanguageTag()); in toLowerCase() 355 public static String toUpperCase(String s, Locale locale) { in toUpperCase() argument 356 return toUpperCase(s, locale.toLanguageTag()); in toUpperCase() 386 public static String getCurrencyDisplayName(Locale locale, String currencyCode) { in getCurrencyDisplayName() argument 387 return getCurrencyDisplayName(locale.toLanguageTag(), currencyCode); in getCurrencyDisplayName() 395 public static String getCurrencySymbol(Locale locale, String currencyCode) { in getCurrencySymbol() argument 396 return getCurrencySymbol(locale.toLanguageTag(), currencyCode); in getCurrencySymbol() [all …]
|
D | AlphabeticIndex.java | 80 public AlphabeticIndex(Locale locale) { in AlphabeticIndex() argument 81 peer = create(locale.toString()); in AlphabeticIndex() 117 public synchronized AlphabeticIndex addLabels(Locale locale) { in addLabels() argument 118 addLabels(peer, locale.toString()); in addLabels() 161 private static native long create(String locale); in create() argument 165 private static native void addLabels(long peer, String locale); in addLabels() argument
|
D | NativePluralRules.java | 49 public static NativePluralRules forLocale(Locale locale) { in forLocale() argument 50 return new NativePluralRules(forLocaleImpl(locale.toString())); in forLocale()
|
D | NativeCollation.java | 31 public static long openCollator(Locale locale) { in openCollator() argument 32 return openCollator(locale.toLanguageTag()); in openCollator()
|
/libcore/luni/src/main/java/java/text/ |
D | BreakIterator.java | 272 public static BreakIterator getCharacterInstance(Locale locale) { in getCharacterInstance() argument 273 return new RuleBasedBreakIterator(NativeBreakIterator.getCharacterInstance(locale)); in getCharacterInstance() 290 public static BreakIterator getLineInstance(Locale locale) { in getLineInstance() argument 291 return new RuleBasedBreakIterator(NativeBreakIterator.getLineInstance(locale)); in getLineInstance() 308 public static BreakIterator getSentenceInstance(Locale locale) { in getSentenceInstance() argument 309 return new RuleBasedBreakIterator(NativeBreakIterator.getSentenceInstance(locale)); in getSentenceInstance() 326 public static BreakIterator getWordInstance(Locale locale) { in getWordInstance() argument 327 return new RuleBasedBreakIterator(NativeBreakIterator.getWordInstance(locale)); in getWordInstance()
|
D | DateFormatSymbols.java | 72 private final Locale locale; field in DateFormatSymbols 81 zoneStrings = TimeZoneNames.getZoneStrings(locale); in internalZoneStrings() 102 public DateFormatSymbols(Locale locale) { in DateFormatSymbols() argument 103 this.locale = LocaleData.mapInvalidAndNullLocales(locale); in DateFormatSymbols() 106 this.localeData = LocaleData.get(locale); in DateFormatSymbols() 134 public static final DateFormatSymbols getInstance(Locale locale) { in getInstance() argument 135 if (locale == null) { in getInstance() 138 return new DateFormatSymbols(locale); in getInstance() 154 Locale locale = this.locale; in readObject() local 155 if (locale == null) { in readObject() [all …]
|
D | NumberFormat.java | 355 public static NumberFormat getCurrencyInstance(Locale locale) { in getCurrencyInstance() argument 356 if (locale == null) { in getCurrencyInstance() 360 return getInstance(LocaleData.get(locale).currencyPattern, locale); in getCurrencyInstance() 382 public static NumberFormat getIntegerInstance(Locale locale) { in getIntegerInstance() argument 383 if (locale == null) { in getIntegerInstance() 387 NumberFormat result = getInstance(LocaleData.get(locale).integerPattern, locale); in getIntegerInstance() 410 public static NumberFormat getInstance(Locale locale) { in getInstance() argument 411 return getNumberInstance(locale); in getInstance() 414 private static NumberFormat getInstance(String pattern, Locale locale) { in getInstance() argument 415 return new DecimalFormat(pattern, locale); in getInstance() [all …]
|
D | MessageFormat.java | 336 private Locale locale; field in MessageFormat 358 public MessageFormat(String template, Locale locale) { in MessageFormat() argument 359 this.locale = locale; in MessageFormat() 487 return locale.equals(format.locale) in equals() 584 mf.setLocale(locale); in formatImpl() 792 return locale; in getLocale() 807 if (locale != null) { in hashCode() 808 return hashCode + locale.hashCode(); in hashCode() 978 DateFormat.DEFAULT, locale) : DateFormat in parseVariable() 979 .getTimeInstance(DateFormat.DEFAULT, locale); in parseVariable() [all …]
|
D | DecimalFormatSymbols.java | 57 private transient Locale locale; field in DecimalFormatSymbols 83 public DecimalFormatSymbols(Locale locale) { in DecimalFormatSymbols() argument 84 if (locale == null) { in DecimalFormatSymbols() 88 locale = LocaleData.mapInvalidAndNullLocales(locale); in DecimalFormatSymbols() 89 LocaleData localeData = LocaleData.get(locale); in DecimalFormatSymbols() 102 this.locale = locale; in DecimalFormatSymbols() 104 currency = Currency.getInstance(locale); in DecimalFormatSymbols() 105 currencySymbol = currency.getSymbol(locale); in DecimalFormatSymbols() 133 public static DecimalFormatSymbols getInstance(Locale locale) { in getInstance() argument 134 if (locale == null) { in getInstance() [all …]
|
D | DateFormat.java | 396 public static final DateFormat getDateInstance(int style, Locale locale) { in getDateInstance() argument 398 if (locale == null) { in getDateInstance() 401 return new SimpleDateFormat(LocaleData.get(locale).getDateFormat(style), locale); in getDateInstance() 450 … public static final DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale) { in getDateTimeInstance() argument 453 if (locale == null) { in getDateTimeInstance() 456 LocaleData localeData = LocaleData.get(locale); in getDateTimeInstance() 458 return new SimpleDateFormat(pattern, locale); in getDateTimeInstance() 529 public static final DateFormat getTimeInstance(int style, Locale locale) { in getTimeInstance() argument 531 if (locale == null) { in getTimeInstance() 535 return new SimpleDateFormat(LocaleData.get(locale).getTimeFormat(style), locale); in getTimeInstance()
|
/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/luni/src/main/java/java/lang/ |
D | CaseMapper.java | 47 public static String toLowerCase(Locale locale, String s, char[] value, int offset, int count) { in toLowerCase() argument 50 String languageCode = locale.getLanguage(); in toLowerCase() 52 return ICU.toLowerCase(s, locale); in toLowerCase() 62 return ICU.toLowerCase(s, locale); in toLowerCase() 150 public static String toUpperCase(Locale locale, String s, char[] value, int offset, int count) { in toUpperCase() argument 151 String languageCode = locale.getLanguage(); in toUpperCase() 153 return ICU.toUpperCase(s, locale); in toUpperCase() 164 return ICU.toUpperCase(s, locale); in toUpperCase()
|
/libcore/luni/src/main/native/ |
D | libcore_icu_ICU.cpp | 116 return env->NewStringUTF(icuLocale.locale().getScript()); in ICU_getScript() 232 icuTargetLocale.locale().getDisplayCountry(icuLocale.locale(), str); in ICU_getDisplayCountryNative() 247 icuTargetLocale.locale().getDisplayLanguage(icuLocale.locale(), str); in ICU_getDisplayLanguageNative() 262 icuTargetLocale.locale().getDisplayScript(icuLocale.locale(), str); in ICU_getDisplayScriptNative() 277 icuTargetLocale.locale().getDisplayVariant(icuLocale.locale(), str); in ICU_getDisplayVariantNative() 286 return env->NewStringUTF(icuLocale.locale().getISO3Country()); in ICU_getISO3Country() 294 return env->NewStringUTF(icuLocale.locale().getISO3Language()); in ICU_getISO3Language() 385 static void setNumberPatterns(JNIEnv* env, jobject obj, Locale& locale) { in setNumberPatterns() argument 389 …UniquePtr<DecimalFormat> fmt(static_cast<DecimalFormat*>(NumberFormat::createInstance(locale, UNUM… in setNumberPatterns() 393 …fmt.reset(static_cast<DecimalFormat*>(NumberFormat::createInstance(locale, UNUM_DECIMAL, status))); in setNumberPatterns() [all …]
|
D | libcore_icu_NativePluralRules.cpp | 51 Locale locale = Locale::createFromName(localeName.c_str()); in NativePluralRules_forLocaleImpl() local 53 PluralRules* result = PluralRules::forLocale(locale, status); in NativePluralRules_forLocaleImpl()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ |
D | DecimalFormatSymbolsTest.java | 69 for (Locale locale : locales) { in test_getAvailableLocales_no_provider() 70 if (locale.equals(Locale.US)) { in test_getAvailableLocales_no_provider() 98 Locale locale = new Locale("not exist language", "not exist country"); in test_getInstanceLjava_util_Locale() local 99 DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(locale); in test_getInstanceLjava_util_Locale() 285 Locale locale = Locale.CANADA; in test_setCurrencyLjava_util_Currency() local 287 .getCurrencyInstance(locale)).getDecimalFormatSymbols(); in test_setCurrencyLjava_util_Currency() 300 locale), dfs.getCurrencySymbol()); in test_setCurrencyLjava_util_Currency() 368 Locale locale = Locale.CANADA; in test_setInternationalCurrencySymbolLjava_lang_String() local 370 .getCurrencyInstance(locale)).getDecimalFormatSymbols(); in test_setInternationalCurrencySymbolLjava_lang_String() 377 .getSymbol(locale), dfs.getCurrencySymbol()); in test_setInternationalCurrencySymbolLjava_lang_String()
|
D | RuleBasedCollatorTest.java | 108 Locale locale = Locale.forLanguageTag("es-u-co-trad"); in testGetCollationElementIteratorString() local 109 RuleBasedCollator coll = (RuleBasedCollator) Collator.getInstance(locale); in testGetCollationElementIteratorString() 125 Locale locale = new Locale("de", "DE"); in testGetCollationElementIteratorString() local 126 RuleBasedCollator coll = (RuleBasedCollator) Collator.getInstance(locale); in testGetCollationElementIteratorString() 150 Locale locale = Locale.forLanguageTag("es-u-co-trad"); in testGetCollationElementIteratorCharacterIterator() local 151 RuleBasedCollator coll = (RuleBasedCollator) Collator.getInstance(locale); in testGetCollationElementIteratorCharacterIterator() 169 Locale locale = new Locale("de", "DE"); in testGetCollationElementIteratorCharacterIterator() local 170 RuleBasedCollator coll = (RuleBasedCollator) Collator.getInstance(locale); in testGetCollationElementIteratorCharacterIterator()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/org/xml/sax/support/ |
D | MockParser.java | 64 public void setLocale(Locale locale) throws SAXException { in setLocale() argument 65 logger.add("setLocale", locale); in setLocale()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | ResourceBundleTest.java | 214 Locale locale = Locale.GERMAN; in test_getBundle_getClassName() local 217 ResourceBundle.getBundle(nonExistentBundle, locale, this.getClass() in test_getBundle_getClassName() 221 assertEquals(nonExistentBundle + "_" + locale, e.getClassName()); in test_getBundle_getClassName() 225 ResourceBundle.getBundle(nonExistentBundle, locale); in test_getBundle_getClassName() 228 assertEquals(nonExistentBundle + "_" + locale, e.getClassName()); in test_getBundle_getClassName() 231 locale = Locale.getDefault(); in test_getBundle_getClassName() 236 assertEquals(nonExistentBundle + "_" + locale, e.getClassName()); in test_getBundle_getClassName()
|