Java Utililty Methods List Sort

List of utility methods to do List Sort

Description

The list of methods to do List Sort are organized into topic(s).

Method

voidsortRepositorynames(List list)
Sort grouped repository names.
Collections.sort(list, new Comparator<String>() {
    @Override
    public int compare(String o1, String o2) {
        return compareRepositoryNames(o1, o2);
});
ListsortSimpleName(List list)
sort Simple Name
if (list != null && list.size() > 0) {
    Collections.sort(list, SIMPLE_NAME_COMPARATOR);
return list;
ListsortSimpleName(List list)
sort Simple Name
if (list != null && list.size() > 0) {
    Collections.sort(list, SIMPLE_NAME_COMPARATOR);
return list;
ListsortString(Set lists)
sort String
if (lists == null) {
    return null;
} else {
    List<String> result = new ArrayList<String>();
    for (String domain : lists) {
        result.add(domain);
    Collections.sort(result);
...
VectorsortStringEnumeration(Enumeration list)
Sort the given String enumeration.
Vector sorted = new Vector();
while (list.hasMoreElements())
    orderedStringInsert((String) list.nextElement(), sorted);
sorted.trimToSize();
return sorted;
ListsortStringList(List l, boolean ascending)
sort String List
List<String> ret = new ArrayList<String>();
ret.addAll(l);
return ret;
ListsortStringList(List stringList)
sort String List
List<String> newList = new ArrayList<String>();
newList.addAll(stringList);
Collections.sort(newList);
return newList;
String[]sortStringList(String[] listToSort, String[] priorityList)
sort String List
List<String> list = new ArrayList<>();
for (String item : listToSort) {
    if (isSupported(priorityList, item)) {
        list.add(item);
for (String item : listToSort) {
    if (!isSupported(priorityList, item)) {
...
ListsortUniq(List list)
sort Uniq
HashSet<String> tmp = new HashSet<String>();
for (String a : list) {
    tmp.add(a);
List<String> result = new ArrayList<String>();
result.addAll(tmp);
Collections.sort(result);
return result;
...
ListsortUniqueTags(List unsortedTags)
sort Unique Tags
List<String> sorted = new ArrayList<String>();
for (String t : unsortedTags) {
    t = t.trim();
    if (sorted.contains(t) == false) {
        sorted.add(t);
return sorted;
...