Set instances. Also see this class's counterparts
Lists, Maps and Queues.
See the Guava User Guide article on Sets.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| pack-priv static class | |
| private static class | |
| private static class | |
| private static class | |
| pack-priv abstract static class | Sets.ImprovedAbstractSet<E extends @Nullable Object>
|
| private static class | |
| public abstract static class | Sets.SetView<E extends @Nullable Object>
An unmodifiable view of a set which may be backed by other sets; this view will change as the backing sets do. |
| private static class | |
| pack-priv static class |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static < any common base class shared by all axes (often just B> SetObject) | Returns: the Cartesian product, as an immutable set containing immutable liststhe sets to choose elements from, in the order that the elements chosen from those
sets should appear in the resulting lists sets)Returns every possible list that can be formed by choosing one element from each of the given sets in order; the "n-ary Cartesian product" of the sets. |
| public static < any common base class shared by all axes (often just B> SetObject) | Returns: the Cartesian product, as an immutable set containing immutable liststhe sets to choose elements from, in the order that the elements chosen from those
sets should appear in the resulting lists sets)Returns every possible list that can be formed by choosing one element from each of the given sets in order; the "n-ary Cartesian product" of the sets. |
| public static <E> Set | Returns: the set of all combinations ofsize elements from setthe set of elements to take combinations of set, final int the number of elements per combination size)Returns the set of all subsets of |
| public static <E extends Enum | Returns: a new, modifiableEnumSet containing all values of the enum that aren't present
in the given collectionthe collection whose complement should be stored in the enum set collection)Creates an |
| public static <E extends Enum | Returns: a new, modifiableEnumSet initially containing all the values of the enum not
present in the given collectionthe collection whose complement should be stored in the collection, Class<E> EnumSetthe type of the elements in the set type)Creates an |
| public static <E extends @Nullable Object> Sets. | difference(final Set<E> set1, final Set<?> set2)
Returns an unmodifiable view of the difference of two sets. |
| pack-priv static boolean | |
| public static <E extends @Nullable Object> Set | |
| public static <E extends @Nullable Object> SortedSet | |
| public static <E extends @Nullable Object> NavigableSet | filter(NavigableSet<E> unfiltered, Predicate<? super E> predicate)
Returns the elements of a |
| pack-priv static int | |
| public static <E extends Enum | Returns: an immutable set containing those elements, minus duplicatesone of the elements the set should contain anElement, E... the rest of the elements the set should contain otherElements)Returns an immutable set instance containing the given enum elements. |
| public static <E extends Enum | Returns: an immutable set containing those elements, minus duplicatesthe elements, all of the same elements)enum type, that the set should containReturns an immutable set instance containing the given enum elements. |
| public static <E extends @Nullable Object> Sets. | intersection(final Set<E> set1, final Set<?> set2)
Returns an unmodifiable view of the intersection of two sets. |
| private static <E extends Enum | |
| public static <E> Set | Returns: a new, empty thread-safeSetCreates a thread-safe set backed by a hash map. |
| public static <E> Set | Returns: a new thread-safe set containing those elements (minus duplicates)the elements that the set should contain elements)Creates a thread-safe set backed by a hash map and containing the given elements. |
| public static <E extends @Nullable Object> CopyOnWriteArraySet | Returns: a new, emptyCopyOnWriteArraySetCreates an empty |
| public static <E extends @Nullable Object> CopyOnWriteArraySet | Returns: a newCopyOnWriteArraySet containing those elementsthe elements that the set should contain, in order elements)Creates a |
| public static <E extends Enum | newEnumSet(Iterable<E> iterable, Class<E> elementType)
Returns a new, mutable |
| public static <E extends @Nullable Object> HashSet | |
| public static <E extends @Nullable Object> HashSet | newHashSet(E... elements)
Creates a mutable |
| public static <E extends @Nullable Object> HashSet | newHashSet(Iterable<? extends E> elements)
Creates a mutable |
| public static <E extends @Nullable Object> HashSet | newHashSet(Iterator<? extends E> elements)
Creates a mutable |
| public static <E extends @Nullable Object> HashSet | Returns: a new, empty hash set with enough capacity to holdexpectedSize elements
without resizingthe number of elements you expect to add to the returned set expectedSize)Returns a new hash set using the smallest initial table size that can hold |
| public static <E extends @Nullable Object> Set | |
| public static <E extends @Nullable Object> LinkedHashSet | Returns: a new, emptyLinkedHashSetCreates a mutable, empty |
| public static <E extends @Nullable Object> LinkedHashSet | Returns: a newLinkedHashSet containing those elements (minus duplicates)the elements that the set should contain, in order elements)Creates a mutable |
| public static <E extends @Nullable Object> LinkedHashSet | Returns: a new, emptyLinkedHashSet with enough capacity to hold expectedSize
elements without resizingthe number of elements you expect to add to the returned set expectedSize)Creates a |
| public static <E extends @Nullable Object> Set | Returns: the set backed by the mapthe backing map map)
Deprecated
Use
Returns a set backed by the specified map.
Collections#newSetFromMap instead.
|
| public static <E extends Comparable | Returns: a new, emptyTreeSetCreates a mutable, empty |
| public static <E extends Comparable | Returns: a newTreeSet containing those elements (minus duplicates)the elements that the set should contain elements)Creates a mutable |
| public static <E extends @Nullable Object> TreeSet | Returns: a new, emptyTreeSetthe comparator to use to sort the set comparator)Creates a mutable, empty |
| public static <E> Set | |
| pack-priv static boolean | |
| pack-priv static boolean | |
| public static <K extends Comparable | subSet(NavigableSet<K> set, Range<K> range)
Returns a view of the portion of |
| public static <E extends @Nullable Object> Sets. | symmetricDifference(final Set<? extends E> set1, final Set<? extends E> set2)
Returns an unmodifiable view of the symmetric difference of two sets. |
| public static <E extends @Nullable Object> NavigableSet | Returns: a synchronized view of the specified navigable set.the navigable set to be "wrapped" in a synchronized navigable set. navigableSet)Returns a synchronized (thread-safe) navigable set backed by the specified navigable set. |
| public static <E extends Enum | toImmutableEnumSet()
Returns a |
| public static <E extends @Nullable Object> Sets. | |
| public static <E extends @Nullable Object> NavigableSet | Returns: an unmodifiable view of the specified navigable setthe navigable set for which an unmodifiable view is to be returned set)Returns an unmodifiable view of the specified navigable set. |