Java SortedSet sorted(Iterable input)

Here you can find the source of sorted(Iterable input)

Description

sorted

License

Open Source License

Declaration

public static <T> Iterable<T> sorted(Iterable<T> input) 

Method Source Code

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

import java.util.TreeSet;

public class Main {
    public static <T> Iterable<T> sorted(Iterable<T> input) {
        TreeSet<T> ret = new TreeSet<T>();

        for (T t : input) {
            ret.add(t);/*  w  ww.  j a v a 2s  .c  o m*/
        }

        return ret;
    }
}

Related

  1. intersectSorted(final Collection c1, final Collection c2)
  2. mapToSortedSet(Map map)
  3. newSortedSet()
  4. setDistance(SortedSet s1, SortedSet s2)
  5. setminus(SortedSet pSet1, SortedSet pSet2)
  6. sortedByValues(Map map, final boolean asc)
  7. sortedConfigKeys(Iterable> conf)
  8. sortedSet()
  9. splitSorted(String str, String sepStr)