Package org.aksw.commons.collections
Class SetUtils
java.lang.Object
org.aksw.commons.collections.SetUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Set<T>If the argument is already an instance of a set then cast it to a set and return it; otherwise create a new LinkedHashSet initialized with the given itemsstatic <K,V> Set<V> Short hand for Setresult = source.stream().map(fn).collect(Collectors.toSet()) Maps a set of keys to a corresponding set of values via a given map TODO Probably this method can be replaced by something from guava static <T> Set<T>newForwardingSet(Supplier<? extends Set<T>> setSupplier) static <T> Set<T>newLinkedHashSet(Iterator<? extends T> c)
-
Constructor Details
-
SetUtils
public SetUtils()
-
-
Method Details
-
asSet
If the argument is already an instance of a set then cast it to a set and return it; otherwise create a new LinkedHashSet initialized with the given items -
newLinkedHashSet
-
mapSet
Short hand for Setresult = source.stream().map(fn).collect(Collectors.toSet()) Maps a set of keys to a corresponding set of values via a given map TODO Probably this method can be replaced by something from guava - Parameters:
set-map-- Returns:
-
newForwardingSet
-