Java List Sort removeSortByColumnName(List sortProperty, List ascending, String columnName)

Here you can find the source of removeSortByColumnName(List sortProperty, List ascending, String columnName)

Description

remove Sort By Column Name

License

Apache License

Declaration

public static boolean removeSortByColumnName(List<String> sortProperty, List<Boolean> ascending,
            String columnName) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static boolean removeSortByColumnName(List<String> sortProperty, List<Boolean> ascending,
            String columnName) {/*  w  w  w .j  a v  a 2  s . c  o  m*/
        if (sortProperty == null) {
            return false;
        }
        int index = -1;
        for (int i = 0, size = sortProperty.size(); i < size; i++) {
            String sort = sortProperty.get(i);
            if (sort.equals(columnName)) {
                index = i;
                break;
            }
        }
        if (index != -1) {
            sortProperty.remove(index);
            ascending.remove(index);
        }
        return (index == 0);
    }
}

Related

  1. mergeLong(List l1, List l2, boolean sort)
  2. mergeSort(List m)
  3. mergeSort(List list)
  4. mergeSortedLists(List dest, List[] src, boolean removeDuplicates)
  5. quickSort(Comparable[] list, int min, int max)
  6. removeSortColumns(List selectColumns, List sorts, List ascending)
  7. removeSortColumns(List selectColumns, List sorts, List ascending)
  8. searchSorted(List a, double v)
  9. setToSortedList(final Set set, final Comparator comparator)