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

voidremoveSortColumns(List selectColumns, List sorts, List ascending)
remove Sort Columns
List<String> removedSorts = new ArrayList<String>();
for (String sort : sorts) {
    if (!containsColumnByAlias(selectColumns, sort)) {
        removedSorts.add(sort);
for (String sort : removedSorts) {
    removeSortByColumnName(sorts, ascending, sort);
...
intsearchSorted(List a, double v)
Search sorted list index
int idx = -1;
int n = a.size();
if (a.get(1).doubleValue() > a.get(0).doubleValue()) {
    if (v < a.get(0).doubleValue()) {
        return idx;
    if (v > a.get(n - 1).doubleValue()) {
        return idx;
...
ListsetToSortedList(final Set set, final Comparator comparator)
Converts a Set into a sorted List.
final List<T> list = new LinkedList<T>(set);
Collections.sort(list, comparator);
return list;
Ssort(S list)
sort
Collections.sort(list);
return list;
Listsort(Collection list)
sort
return sort(list, true);
ArrayListSort(Collection list)
Convenience methods that makes it easier to sort a collection
ArrayList<String> newList = new ArrayList<String>(list);
Collections.sort(newList);
return newList;
Listsort(Collection list)
sort
List<T> list1 = new ArrayList<>(list);
Collections.sort(list1);
return list1;
Listsort(final List list)
Sorts the specified string list.
List<String> listSorted = null;
if (list != null) {
    listSorted = new ArrayList<String>();
    for (final String str : list) {
        listSorted.add(getIndexForSortedInsert(listSorted, str), str);
return listSorted;
...
Listsort(List list)
Sort ascending a list structure.
for (int i = 0; list != null && i < list.size(); i++) {
    String actual = (String) list.get(i);
    for (int j = i; j < list.size(); j++) {
        String next = (String) list.get(j);
        if (actual.compareTo(next) > 0) {
            list.set(i, next);
            list.set(j, actual);
            actual = next;
...
Listsort(List list)
sort
Collections.sort(list);
return list;