아랍어 단어 목록이 있습니다.android에서 아랍어 단어 정렬하기
الأحد, الاثنين, الثلاثاء, الأربعاء, الخميس, الجمعة, السبت
이
어떻게 내가 (알파벳으로 정렬) 정렬 할 수 있습니다?
업데이트 :
가 어떻게 컬렉션에 arrabicCollator을 설정할 수 있습니까?
Locale arrabic= new Locale("ar");
Collator arrabicCollator = Collator.getInstance(arrabic);
Collections.sort(arr_items, new Comparator<Helper>() {
@Override
public int compare(Helper one, Helper two) {
// TODO Auto-generated method stub
return one.getTitle().compareTo(two.getTitle());
}
});
해결 :
Locale arabic = new Locale("ar");
final Collator arabicCollator = Collator.getInstance(arabic);
Collections.sort(arr_items, new Comparator<Helper>() {
@Override
public int compare(Helper one, Helper two) {
// TODO Auto-generated method stub
return arabicCollator.compare(one.getTitle(), two.getTitle());
}
});
helper
는 세터와 게터 기능을 포함하고 arr_items
배열되는 클래스 경우 헬퍼 :
의 ArrayList arr_items = 새로운 ArrayList를 <> ();
무엇을 의미합니까? 다른 단어 목록을 정렬하는 것과 어떻게 다른가요? – njzk2
알파벳 정렬을 의미합니까? – Neige
단어 단위로 정렬 하시겠습니까? 줄 단위로? 단락별로? 편지로? –