Here you can find the source of removeSortColumns(List
public static void removeSortColumns(List<String> selectColumns, List<String> sorts, List<Boolean> ascending)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static void removeSortColumns(List<String> selectColumns, List<String> sorts, List<Boolean> ascending) { List<String> removedSorts = new ArrayList<String>(); for (String sort : sorts) { if (!selectColumns.contains(sort)) { removedSorts.add(sort);//from ww w.java 2 s. com } } for (String sort : removedSorts) { removeSortByColumnName(sorts, ascending, sort); } } public static boolean removeSortByColumnName(List<String> sortProperty, List<Boolean> ascending, String columnName) { 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); } }