Java Code Examples for java.util.stream.Collectors#toSet()

The following examples show how to use java.util.stream.Collectors#toSet() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MapBinToFromTreeTest.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 2
Source File: MapBinToFromTreeTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 3
Source File: TrieSet.java    From cyclops with Apache License 2.0 4 votes vote down vote up
static <T> Collector<T, Set<T>, TrieSet<T>> collector() {
    Collector<T, ?, Set<T>> c  = Collectors.toSet();
    return Collectors.<T, Set<T>, Iterable<T>,TrieSet<T>>collectingAndThen((Collector)c,TrieSet::fromIterable);
}
 
Example 4
Source File: TreeSet.java    From cyclops with Apache License 2.0 4 votes vote down vote up
static <T extends Comparable<? super T>>  Collector<T, Set<T>, TreeSet<T>> collector() {
    Collector<T, ?, Set<T>> c  = Collectors.toSet();
    return Collectors.<T, Set<T>, Iterable<T>,TreeSet<T>>collectingAndThen((Collector)c,TreeSet::fromIterable);
}
 
Example 5
Source File: HashSet.java    From cyclops with Apache License 2.0 4 votes vote down vote up
static <T> Collector<T, Set<T>, HashSet<T>> collector() {
    Collector<T, ?, Set<T>> c  = Collectors.toSet();
    return Collectors.<T, Set<T>, Iterable<T>,HashSet<T>>collectingAndThen((Collector)c,HashSet::fromIterable);
}
 
Example 6
Source File: MapBinToFromTreeTest.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 7
Source File: MapBinToFromTreeTest.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 8
Source File: MapBinToFromTreeTest.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 9
Source File: MapBinToFromTreeTest.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 10
Source File: MapBinToFromTreeTest.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 11
Source File: MapBinToFromTreeTest.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 12
Source File: MapBinToFromTreeTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 13
Source File: MapBinToFromTreeTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 14
Source File: MapBinToFromTreeTest.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 15
Source File: IterableConverter.java    From sailfish-core with Apache License 2.0 4 votes vote down vote up
@Override
public <T> Collector<T, ?, Set<T>> collector() {
    return Collectors.toSet();
}
 
Example 16
Source File: MapBinToFromTreeTest.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 17
Source File: MapBinToFromTreeTest.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 18
Source File: To.java    From essentials4j with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a {@code Collector} that accumulates the input elements into a new {@code Set}.
 * <p>
 * A shortcut for: {@code Collectors.toSet()}.
 *
 * @param <T> the type of the output set elements
 * @return a new collector that accumulates the input elements into a new {@code Set}
 * @see Collectors#toSet()
 */
public static <T> Collector<T, ?, Set<T>> set() {
	return Collectors.toSet();
}