Lines Matching refs:Locale

33 import java.util.Locale;
43 private final Locale[] mList;
50 private static final Locale[] sEmptyList = new Locale[0];
54 * Retrieves the {@link Locale} at the specified index.
57 * @return The {@link Locale} in the given index.
61 Locale get(int index) {
66 * Returns whether the {@link LocaleListHelper} contains no {@link Locale} items.
68 * @return {@code true} if this {@link LocaleListHelper} has no {@link Locale} items,
78 * Returns the number of {@link Locale} items in this {@link LocaleListHelper}.
88 * Searches this {@link LocaleListHelper} for the specified {@link Locale} and returns the index
91 * @param locale The {@link Locale} to search for.
92 * @return The index of the first occurrence of the {@link Locale} or {@code -1} if the item
98 int indexOf(Locale locale) {
115 final Locale[] otherList = ((LocaleListHelper) other).mList;
163 * <p>For empty lists of {@link Locale} items it is better to use {@link #getEmptyLocaleList()},
172 LocaleListHelper(@NonNull Locale... list) {
177 final Locale[] localeList = new Locale[list.length];
178 final HashSet<Locale> seenLocales = new HashSet<Locale>();
181 final Locale l = list[i];
187 final Locale localeClone = (Locale) l.clone();
208 LocaleListHelper(@NonNull Locale topLocale, LocaleListHelper otherLocales) {
223 final Locale[] localeList = new Locale[outputLength];
224 localeList[0] = (Locale) topLocale.clone();
228 localeList[i + 1] = (Locale) otherLocales.mList[i].clone();
232 localeList[i + 1] = (Locale) otherLocales.mList[i].clone();
235 localeList[i] = (Locale) otherLocales.mList[i].clone();
266 * @return A new instance with the {@link Locale} items identified by the given tags.
277 final Locale[] localeArray = new Locale[tags.length];
285 private static String getLikelyScript(Locale locale) {
299 private static final Locale LOCALE_EN_XA = new Locale("en", "XA");
300 private static final Locale LOCALE_AR_XB = new Locale("ar", "XB");
307 private static boolean isPseudoLocale(Locale locale) {
312 private static int matchScore(Locale supported, Locale desired) {
340 private int findFirstMatchIndex(Locale supportedLocale) {
350 private static final Locale EN_LATN = LocaleHelper.forLanguageTag("en-Latn");
372 final Locale supportedLocale = LocaleHelper.forLanguageTag(languageTag);
390 private Locale computeFirstMatch(Collection<String> supportedLocales,
400 * @return The first {@link Locale} from this list that appears in the given array, or
407 Locale getFirstMatch(String[] supportedLocales) {
427 Locale getFirstMatchWithEnglishSupported(String[] supportedLocales) {
484 private static Locale sLastDefaultLocale = null;
487 * The result is guaranteed to include the default Locale returned by Locale.getDefault(), but
493 * <p>Note that the default LocaleListHelper would change if Locale.setDefault() is called. This
494 * method takes that into account by always checking the output of Locale.getDefault() and
502 final Locale defaultLocale = Locale.getDefault();
507 // someone has called Locale.setDefault() since we last set or adjusted the default
511 // The default Locale has changed, but it happens to be the first locale in the
540 * Also sets the default locale by calling Locale.setDefault() with the first locale in the
572 Locale.setDefault(sLastDefaultLocale);