Set whose contents will never change, with many other important properties detailed at
ImmutableCollection.
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| pack-priv abstract static class | |
| private static class | |
| pack-priv abstract static class | |
| private static class | ImmutableSet.JdkBackedSetBuilderImpl<E>
SetBuilderImpl version that uses a JDK HashSet, which has built in hash flooding protection. |
| private static class | ImmutableSet.RegularSetBuilderImpl<E>
Default implementation of the guts of ImmutableSet.Builder, creating an open-addressed hash table and deduplicating elements as they come, so it only allocates O(max(distinct, expectedCapacity)) rather than O(calls to add). |
| private static class | |
| private abstract static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final double | |
| pack-priv static final int | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public static <E> ImmutableSet. | |
| public static <E> ImmutableSet. | builderWithExpectedSize(int expectedSize)
Returns a new builder, expecting the specified number of distinct elements to be added. |
| pack-priv static int | chooseTableSize(int setSize)
Returns an array size suitable for the backing array of a hash table that uses open addressing with linear probing in its implementation. |
| private static <E> ImmutableSet | |
| private static <E> ImmutableSet | constructUnknownDuplication(int n, Object... elements)
Constructs an |
| public static <E> ImmutableSet | copyOf(Collection<? extends E>
a elements)Collection from which elements are drawn, must be non-nullHides java. elements, minus duplicates, in the order
each appears first in the source collection.
|
| public static <E> ImmutableSet | |
| public static <E> ImmutableSet | |
| public static <E> ImmutableSet | copyOf(E[] elements)
Returns an immutable set containing each of |
| private static ImmutableSet | |
| public boolean | equals(Object
object to be compared for equality with this set object)Overrides java. Implements java. |
| public int | hashCode()
Overrides java. Implements java. |
| pack-priv boolean | |
| public abstract UnmodifiableIterator | iterator()
Redeclares java. Implements abstract com. |
| public static <E> ImmutableSet | |
| public static <E> ImmutableSet | |
| public static <E> ImmutableSet | of(E
the first element e1, E the second element e2)Hides java. |
| public static <E> ImmutableSet | of(E
the first element e1, E the second element e2, E the third element e3)Hides java. |
| public static <E> ImmutableSet | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4)Hides java. |
| public static <E> ImmutableSet | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5)Hides java. |
| public static <E> ImmutableSet | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5, E the sixth element e6, E... the seventh element others)Hides java. |
| private void | |
| public static <E> Collector | |
| pack-priv Object |