Java List Sort sortString(Set lists)

Here you can find the source of sortString(Set lists)

Description

sort String

License

Apache License

Declaration

public static List<String> sortString(Set<String> lists) 

Method Source Code


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

import java.util.ArrayList;
import java.util.Collections;

import java.util.List;
import java.util.Set;

public class Main {
    public static List<String> sortString(Set<String> lists) {
        if (lists == null) {
            return null;
        } else {//from   w w w  .  j  av  a2  s  .  c  o m
            List<String> result = new ArrayList<String>();
            for (String domain : lists) {
                result.add(domain);
            }
            Collections.sort(result);
            return result;
        }
    }

    public static List<String> sort(List<String> lists) {
        Collections.sort(lists);
        return lists;
    }

    public static List<String> sort(Set<String> lists) {
        if (lists == null) {
            return null;
        } else {
            List<String> result = new ArrayList<String>();
            for (String temp : lists) {
                result.add(temp);
            }
            return sort(result);
        }
    }
}

Related

  1. sortMessages(List ms)
  2. sortNames(List nameLs, String splitStr)
  3. sortRepositorynames(List list)
  4. sortSimpleName(List list)
  5. sortSimpleName(List list)
  6. sortStringEnumeration(Enumeration list)
  7. sortStringList(List l, boolean ascending)
  8. sortStringList(List stringList)
  9. sortStringList(String[] listToSort, String[] priorityList)