Java Utililty Methods Set Sort

List of utility methods to do Set Sort

Description

The list of methods to do Set Sort are organized into topic(s).

Method

List>sort(Collection> entrySet)
sort
List<Entry<T, Integer>> sorted = new ArrayList<Entry<T, Integer>>(entrySet);
Collections.sort(sorted, new Comparator<Entry<T, Integer>>() {
    @Override
    public int compare(Entry<T, Integer> o1, Entry<T, Integer> o2) {
        int i1 = o1.getValue();
        int i2 = o2.getValue();
        if (i1 < i2)
            return 1;
...
Listsort(Set data)
sort
List list = new ArrayList();
for (Iterator it = data.iterator(); it.hasNext();) {
    list.add(it.next());
Collections.sort(list, (Object o1, Object o2) -> o1.toString().compareTo(o2.toString()));
return list;
ListsortByToCloseOrder(Set set)
sort By To Close Order
if (set == null)
    return new ArrayList();
List list = new ArrayList(set);
Collections.sort(list);
Collections.reverse(list);
return list;
StringsortedSetToString(SortedSet sortedSet)
sorted Set To String
String s = "";
if (sortedSet.size() == 0)
    return s;
Iterator it = sortedSet.iterator();
while (it.hasNext()) {
    s += " " + (String) it.next();
return s.trim();
...
ListsortKeys(final Set keySet)
sort Keys
List<String> keys = new ArrayList<String>();
for (String key : keySet) {
    keys.add(key);
Collections.sort(keys);
return keys;
ListsortKeys(Set unsortedKeys)
sort Keys
List<String> sortedKeys = new ArrayList<>();
sortedKeys.addAll(unsortedKeys);
Collections.sort(sortedKeys);
return sortedKeys;
List>sortLong(Collection> entrySet)
sort Long
List<Entry<T, Long>> sorted = new ArrayList<Entry<T, Long>>(entrySet);
Collections.sort(sorted, new Comparator<Entry<T, Long>>() {
    @Override
    public int compare(Entry<T, Long> o1, Entry<T, Long> o2) {
        long i1 = o1.getValue();
        long i2 = o2.getValue();
        if (i1 < i2)
            return 1;
...