Java List Sort toSortedList(Collection in)

Here you can find the source of toSortedList(Collection in)

Description

to Sorted List

License

Open Source License

Parameter

Parameter Description
in a parameter

Declaration

static public List<String> toSortedList(Collection<String> in) 

Method Source Code


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

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

public class Main {
    /**//from   w  ww  . j  a v  a  2 s.  com
     * 
     * @param in
     * @return
     */
    static public List<String> toSortedList(Collection<String> in) {
        List<String> out = new ArrayList<>(in);
        Collections.sort(out);
        return Collections.unmodifiableList(out);
    }
}

Related

  1. sortUniq(List list)
  2. sortUniqueTags(List unsortedTags)
  3. sortVersions(List versions)
  4. stringListSort(List list)
  5. subtractSortedLists(List a, List b, Comparator comparator)
  6. toSortedList(Collection collection)
  7. toSortedList(Collection collection)
  8. toSortedList(Collection collection)