* @return an ordered list of UiListItems.
* @throws IllformedLocaleException if any of the locales in localeSet are malformed.
* @draft ICU 55
+ * @provisional This API might change or be removed in a future release.
*/
public List<UiListItem> getUiList(Set<ULocale> localeSet, boolean inSelf, Comparator<Object> collator) {
return getUiListCompareWholeItems(localeSet, UiListItem.getComparator(collator, inSelf));
* @return an ordered list of UiListItems.
* @throws IllformedLocaleException if any of the locales in localeSet are malformed.
* @draft ICU 55
- */
+ * @provisional This API might change or be removed in a future release.
+ */
public abstract List<UiListItem> getUiListCompareWholeItems(Set<ULocale> localeSet, Comparator<UiListItem> comparator);
/**
* Struct-like class used to return information for constructing a UI list, each corresponding to a locale.
* @draft ICU 55
- */
+ * @provisional This API might change or be removed in a future release.
+ */
public static class UiListItem {
/**
* Returns the minimized locale for an input locale, such as sr-Cyrl → sr
* @draft ICU 55
- */
+ * @provisional This API might change or be removed in a future release.
+ */
public final ULocale minimized;
/**
* Returns the modified locale for an input locale, such as sr → sr-Cyrl, where there is also an sr-Latn in the list
* @draft ICU 55
- */
+ * @provisional This API might change or be removed in a future release.
+ */
public final ULocale modified;
/**
* Returns the name of the modified locale in the display locale, such as "Englisch (VS)" (for 'en-US', where the display locale is 'de').
* @draft ICU 55
- */
+ * @provisional This API might change or be removed in a future release.
+ */
public final String nameInDisplayLocale;
/**
* Returns the name of the modified locale in itself, such as "English (US)" (for 'en-US').
* @draft ICU 55
- */
+ * @provisional This API might change or be removed in a future release.
+ */
public final String nameInSelf;
/**
* @param nameInDisplayLocale name of the modified locale in the display locale
* @param nameInSelf name of the modified locale in itself
* @draft ICU 55
- */
+ * @provisional This API might change or be removed in a future release.
+ */
public UiListItem(ULocale minimized, ULocale modified, String nameInDisplayLocale, String nameInSelf) {
this.minimized = minimized;
this.modified = modified;
this.nameInSelf = nameInSelf;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @draft ICU 55
+ * @provisional This API might change or be removed in a future release.
+ */
@Override
public boolean equals(Object obj) {
UiListItem other = (UiListItem)obj;
&& modified.equals(other.modified);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @draft ICU 55
+ * @provisional This API might change or be removed in a future release.
+ */
@Override
public int hashCode() {
return modified.hashCode() ^ nameInDisplayLocale.hashCode();
}
+ /**
+ * {@inheritDoc}
+ *
+ * @draft ICU 55
+ * @provisional This API might change or be removed in a future release.
+ */
@Override
public String toString() {
return "{" + minimized + ", " + modified + ", " + nameInDisplayLocale + ", " + nameInSelf + "}";
* @param comparator (meant for strings, but because Java Collator doesn't have <String>...)
* @return UiListItem comparator
* @draft ICU 55
+ * @provisional This API might change or be removed in a future release.
*/
public static Comparator<UiListItem> getComparator(Comparator<Object> comparator, boolean inSelf) {
return new UiListItemComparator(comparator, inSelf);