Java Collection Sort sort(Collection collection, Comparator comparator)

Here you can find the source of sort(Collection collection, Comparator comparator)

Description

sort

License

Apache License

Declaration

public static <T> List<T> sort(Collection<T> collection, Comparator<T> comparator) 

Method Source Code

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

import java.util.ArrayList;

import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;

import java.util.List;

public class Main {

    public static <T> List<T> sort(Collection<T> collection, Comparator<T> comparator) {
        List<T> list = new ArrayList<T>(collection);
        Collections.sort(list, comparator);
        return list;
    }//w ww  .  j av a  2  s .  co m
}

Related

  1. getSorted(Collection collection)
  2. isSort(Collection c)
  3. sort(Collection collection)
  4. sort(Collection items)
  5. sortByDescendingOrder(Map collection)
  6. sortClassesByLevelOfInheritance(Collection> classes)
  7. sorted(Collection coll)