public interface ImmutableSet<T>
extends java.lang.Iterable<T>, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
default ImmutableSet<T> |
add(java.lang.Iterable<T> seq) |
ImmutableSet<T> |
add(T element)
Adds an element
|
ImmutableSet<T> |
addUnique(T element)
adds an element, barfs if the element is already present
|
static <T> java.util.stream.Collector<T,java.util.Set<T>,ImmutableSet<T>> |
collector()
Returns a Collector that accumulates the input elements into a new ImmutableSet.
|
boolean |
contains(T obj) |
static <T> ImmutableSet<T> |
empty() |
boolean |
equals(java.lang.Object o) |
boolean |
exists(java.util.function.Predicate<T> predicate)
return true if predicate is fullfilled for at least one element
|
static <T> ImmutableSet<T> |
fromCollection(java.util.Collection<? extends T> seq) |
static <T> ImmutableSet<T> |
fromSet(java.util.Set<T> set)
Creates an ImmutableSet from a Set.
|
int |
hashCode() |
ImmutableSet<T> |
intersect(ImmutableSet<? extends T> set) |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
ImmutableSet<T> |
remove(T element) |
static <T> ImmutableSet<T> |
singleton(T obj)
Builds a single set with the given obj.
|
int |
size() |
java.util.stream.Stream<T> |
stream() |
boolean |
subset(ImmutableSet<T> s) |
<S> S[] |
toArray(S[] array)
Convert the set to a Java array
|
java.util.Set<T> |
toSet() |
ImmutableSet<T> |
union(ImmutableSet<? extends T> set) |
static <T> java.util.stream.Collector<T,java.util.Set<T>,ImmutableSet<T>> collector()
static <T> ImmutableSet<T> fromSet(java.util.Set<T> set)
set
- a Set.static <T> ImmutableSet<T> singleton(T obj)
static <T> ImmutableSet<T> empty()
static <T> ImmutableSet<T> fromCollection(@Nonnull java.util.Collection<? extends T> seq)
java.util.Set<T> toSet()
Set
containing the same elements as this ImmutableSet
ImmutableSet<T> add(T element)
ImmutableSet<T> union(ImmutableSet<? extends T> set)
ImmutableSet<T> intersect(ImmutableSet<? extends T> set)
java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
java.util.stream.Stream<T> stream()
boolean exists(java.util.function.Predicate<T> predicate)
predicate
- the predicateboolean contains(T obj)
boolean subset(ImmutableSet<T> s)
int size()
boolean isEmpty()
ImmutableSet<T> remove(T element)
boolean equals(java.lang.Object o)
equals
in class java.lang.Object
int hashCode()
hashCode
in class java.lang.Object
ImmutableSet<T> addUnique(T element) throws NotUniqueException
element
- of type NotUniqueException
- if the element is already present<S> S[] toArray(S[] array)
default ImmutableSet<T> add(java.lang.Iterable<T> seq)
Copyright © 2003-2019 The KeY-Project.