use of java.text.Collator in project cytoscape-api by cytoscape.
the class AbstractCyNetworkReader method sort.
private void sort(final List<String> names) {
if (!names.isEmpty()) {
final Collator collator = Collator.getInstance(Locale.getDefault());
Collections.sort(names, new Comparator<String>() {
@Override
public int compare(String s1, String s2) {
if (s1 == null && s2 == null)
return 0;
if (s1 == null)
return -1;
if (s2 == null)
return 1;
return collator.compare(s1, s2);
}
});
}
}
Aggregations