Locale.LanguageRange(不是枚举类)
变量
MAX_WEIGHT
MIN_WEIGHT
方法
equals() 当语言范围一致的时候返回。
getRange()
getWeight()
hashCode()
mapEquivalents()看不懂,不知道怎么用
两个parse()看不懂,不知道怎么用
toString()
不理解这句话
import java.util.*; import java.io.*; import static java.util.Locale.*; public class Test { public static void main(String[] args) throws Exception,Throwable { //Locale.LanguageRange //变量 System.out.println(LanguageRange.MAX_WEIGHT); System.out.println(LanguageRange.MIN_WEIGHT); LanguageRange range =new LanguageRange("*-CN"); LanguageRange range2 = new LanguageRange("*-US"); System.out.println(range.equals(range2)); System.out.println(range.getRange()); System.out.println(range2.getRange()); System.out.println(range.getWeight()); System.out.println(range2.getWeight()); System.out.println(range.hashCode()); System.out.println(range2.hashCode()); System.out.println(range.toString()); System.out.println(range2.toString()); System.out.println(LanguageRange.parse("*-CN")); Map> map = new HashMap<>(); map.put("zh",new ArrayList(Arrays.asList(new String[] {"zh"}))); System.out.println(LanguageRange.mapEquivalents(LanguageRange.parse("*-CN"),map )); } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)