Interface PersistentSet<E>
-
- Type Parameters:
E- the type of element in this set
- All Known Implementing Classes:
PSet
public interface PersistentSet<E>A persistent set data structure.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Set<E>asSet()An immutable view of this as ajava.util.Set.booleancontains(E e)static <T> PersistentSet<T>empty()PersistentSet<E>minus(E e)PersistentSet<E>plus(E e)java.util.stream.Stream<E>stream()
-
-
-
Method Detail
-
empty
static <T> PersistentSet<T> empty()
- Returns:
- an empty set
-
plus
PersistentSet<E> plus(E e)
- Parameters:
e- an element- Returns:
- a new set with the elements of this set and
e
-
minus
PersistentSet<E> minus(E e)
- Parameters:
e- an element- Returns:
- a new set with the elements of this set except
e
-
contains
boolean contains(E e)
- Parameters:
e- an element- Returns:
- whether this set contains
e
-
stream
java.util.stream.Stream<E> stream()
- Returns:
- a
Streamof the elements in this set
-
asSet
java.util.Set<E> asSet()
An immutable view of this as ajava.util.Set.
-
-