Here you can find the source of sortedUnion(Set
Parameter | Description |
---|---|
a | a parameter |
b | a parameter |
public static <T> SortedSet<T> sortedUnion(Set<T> a, Set<T> b)
//package com.java2s; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; public class Main { /**/*from w w w .jav a2s . com*/ * Constructs the sorted union of two sets * @param a * @param b * @return the sorted union */ public static <T> SortedSet<T> sortedUnion(Set<T> a, Set<T> b) { SortedSet<T> retVal = new TreeSet<T>(a); retVal.addAll(b); return retVal; } }