public class NullAllowingImmutableSet<E> extends AbstractSet<E> implements Serializable
This implementation is intended for low cardinalities, query operations have linear performance. Insertion order is preserved.
| Modifier and Type | Class and Description |
|---|---|
static class |
NullAllowingImmutableSet.Builder<E>
A builder to create an immutable list; this class is not thread-safe.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> NullAllowingImmutableSet.Builder<E> |
builder()
Returns a builder to create a new instance, with the default expected size (16).
|
static <E> NullAllowingImmutableSet.Builder<E> |
builder(int expectedSize)
Returns a builder to create a new instance.
|
static <E> NullAllowingImmutableSet<E> |
copyOf(Iterable<E> iterable) |
Iterator<E> |
iterator() |
static <E> NullAllowingImmutableSet<E> |
of() |
static <E> NullAllowingImmutableSet<E> |
of(E... elements) |
static <E> NullAllowingImmutableSet<E> |
of(E element) |
static <E> NullAllowingImmutableSet<E> |
of(E element1,
E element2) |
static <E> NullAllowingImmutableSet<E> |
of(E element1,
E element2,
E element3) |
int |
size() |
equals, hashCode, removeAlladd, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArrayparallelStream, removeIf, stream@SafeVarargs public static <E> NullAllowingImmutableSet<E> of(E... elements)
public static <E> NullAllowingImmutableSet<E> of()
public static <E> NullAllowingImmutableSet<E> of(E element)
public static <E> NullAllowingImmutableSet<E> of(E element1, E element2)
public static <E> NullAllowingImmutableSet<E> of(E element1, E element2, E element3)
public static <E> NullAllowingImmutableSet<E> copyOf(Iterable<E> iterable)
public static <E> NullAllowingImmutableSet.Builder<E> builder()
builder(int)public static <E> NullAllowingImmutableSet.Builder<E> builder(int expectedSize)
expectedSize - the number of expected elements in the set. This is used to pre-size
internal data structures (if the builder ends up having more elements, it resizes
automatically).public int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>Copyright © 2017–2019. All rights reserved.