LocaleListInterface.java revision 01f7e32cdf00e64181661c34a3190b70ad4c79af
1/* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.support.v4.os; 18 19import static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP; 20 21import android.support.annotation.IntRange; 22import android.support.annotation.NonNull; 23import android.support.annotation.Nullable; 24import android.support.annotation.RestrictTo; 25 26import java.util.Locale; 27 28/** 29 * Interface describing backwards-compatible LocaleList APIs. 30 * 31 * @hide Internal use only 32 */ 33@RestrictTo(LIBRARY_GROUP) 34interface LocaleListInterface { 35 void setLocaleList(@NonNull Locale... list); 36 37 Object getLocaleList(); 38 39 Locale get(int index); 40 41 boolean isEmpty(); 42 43 @IntRange(from = 0) 44 int size(); 45 46 @IntRange(from = -1) 47 int indexOf(Locale locale); 48 49 boolean equals(Object other); 50 51 int hashCode(); 52 53 String toString(); 54 55 String toLanguageTags(); 56 57 @Nullable 58 Locale getFirstMatch(String[] supportedLocales); 59} 60