Java List Sort sort(List objs, Comparator cp)

Here you can find the source of sort(List objs, Comparator cp)

Description

sort

License

Open Source License

Declaration

public static <T> List<T> sort(List<T> objs, Comparator<T> cp) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class Main {

    public static <T> List<T> sort(List<T> objs, Comparator<T> cp) {
        List<T> new_objs = new ArrayList<T>();
        new_objs.addAll(objs);
        Collections.sort(new_objs, cp);
        return new_objs;
    }/*from  w w w . ja v  a  2  s. com*/
}

Related

  1. sort(List list)
  2. sort(List list, Comparator c)
  3. sort(List list, Comparator comparator)
  4. sort(List list, Comparator comparator)
  5. sort(List list, Comparator comparator, String sort, boolean sortOrder)
  6. sort(Set list, Comparator comparator)
  7. sort(String prefix, int[] a, List list)
  8. sortAndFormat(List stringList)
  9. sortAndReturn(final List list)