Java Collection Convert toAlphaCollection(Collection collection)

Here you can find the source of toAlphaCollection(Collection collection)

Description

to Alpha Collection

License

Open Source License

Declaration

public static <U extends Comparable<? super U>> Iterable<U> toAlphaCollection(Collection<U> collection) 

Method Source Code


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

import java.util.*;

public class Main {
    public static <U extends Comparable<? super U>> Iterable<U> toAlphaCollection(Collection<U> collection) {
        Iterator<U> it = collection.iterator();
        List<U> list = new ArrayList<U>();
        while (it.hasNext()) {
            list.add(it.next());/*from ww w . j  a v  a 2  s. c o m*/
        }
        Collections.sort(list);
        return list;
    }
}

Related

  1. convertToHqlParameters(Collection numbers)
  2. convertToIntArray(Collection col)
  3. convertToPrimitive(Collection info)
  4. to2DIntArray(Collection coll)
  5. to2DStringArray(Collection coll)
  6. toArray(Collection items, Object array[], boolean convert_to_primitive)
  7. toCollectionString(Collection c, char sep)
  8. toCollectionString(Collection collection_p)
  9. toCommaDelimitedString(Collection c)