本文整理了Java中java.text.SimpleDateFormat.getAvailableLocales()
方法的一些代码示例,展示了SimpleDateFormat.getAvailableLocales()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SimpleDateFormat.getAvailableLocales()
方法的具体详情如下:
包路径:java.text.SimpleDateFormat
类名称:SimpleDateFormat
方法名:getAvailableLocales
暂无
代码示例来源:origin: org.apache.sling/org.apache.sling.cms.core
public List<Locale> getLocales() {
List<Locale> locales = new ArrayList<>();
for (Locale locale : SimpleDateFormat.getAvailableLocales()) {
locales.add(locale);
}
Collections.sort(locales, new Comparator<Locale>() {
public int compare(Locale o1, Locale o2) {
return o1.toString().compareTo(o2.toString());
}
});
return locales;
}
代码示例来源:origin: remibantos/jeeshop
static public void main(String[] args) {
Locale[] availableLocales = SimpleDateFormat.getAvailableLocales();
List<Locale> list = new ArrayList<Locale>(Arrays.asList(availableLocales));
list.remove(0);
TreeSet<String> set = new TreeSet<>();
int localeLength = 0;
for (Locale a : list) {
if (a.toString().length()>localeLength)
localeLength = a.toString().length();
set.add("{displayName:\"" + a.getDisplayName(Locale.ENGLISH) + "\"," + "name:\"" + a.toString() + "\"},");
}
System.out.println(localeLength);
String buff = "";
for (String i : set){
; buff += i;
if (buff.length()>160){
System.out.println(buff);
buff ="";
}
}
}
内容来源于网络,如有侵权,请联系作者删除!