Java List Sort sortUniq(List list)

Here you can find the source of sortUniq(List list)

Description

sort Uniq

License

Open Source License

Declaration

public static List<String> sortUniq(List<String> list) 

Method Source Code


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

import java.util.*;

public class Main {
    public static List<String> sortUniq(List<String> list) {
        HashSet<String> tmp = new HashSet<String>();
        for (String a : list) {
            tmp.add(a);/*from   ww  w.j ava2s .com*/
        }
        List<String> result = new ArrayList<String>();
        result.addAll(tmp);
        Collections.sort(result);
        return result;
    }
}

Related

  1. sortString(Set lists)
  2. sortStringEnumeration(Enumeration list)
  3. sortStringList(List l, boolean ascending)
  4. sortStringList(List stringList)
  5. sortStringList(String[] listToSort, String[] priorityList)
  6. sortUniqueTags(List unsortedTags)
  7. sortVersions(List versions)
  8. stringListSort(List list)
  9. subtractSortedLists(List a, List b, Comparator comparator)