@Immutable public class ImmutableSet<T> extends Object implements Set<T>
Collections.unmodifiableSet(Set)
.Constructor and Description |
---|
ImmutableSet() |
ImmutableSet(Collection<? extends T> c) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T t) |
boolean |
addAll(Collection<? extends T> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> collection) |
boolean |
equals(Object o) |
void |
forEach(Consumer<? super T> action) |
int |
hashCode() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
Stream<T> |
parallelStream() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
removeIf(Predicate<? super T> filter) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Spliterator<T> |
spliterator() |
Stream<T> |
stream() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] t1s) |
String |
toString() |
public ImmutableSet()
public ImmutableSet(Collection<? extends T> c)
public int size()
public boolean isEmpty()
public boolean contains(Object o)
public Object[] toArray()
public <T> T[] toArray(@Nonnull T[] t1s)
public boolean add(T t)
public boolean addAll(Collection<? extends T> c)
public boolean remove(Object o)
public boolean containsAll(Collection<?> collection)
containsAll
in interface Collection<T>
containsAll
in interface Set<T>
public boolean removeAll(Collection<?> c)
public boolean removeIf(Predicate<? super T> filter)
removeIf
in interface Collection<T>
public boolean retainAll(Collection<?> c)
public void clear()
public boolean equals(Object o)
public int hashCode()
public Spliterator<T> spliterator()
spliterator
in interface Iterable<T>
spliterator
in interface Collection<T>
spliterator
in interface Set<T>
public Stream<T> stream()
stream
in interface Collection<T>
public Stream<T> parallelStream()
parallelStream
in interface Collection<T>