java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
org.pcollections.AbstractUnmodifiableSet<E>
org.pcollections.MapPSet<E>
- Type Parameters:
E-
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>,Set<E>,PCollection<E>,PSet<E>
A map-backed persistent set.
If the backing map is thread-safe, then this implementation is thread-safe (assuming Java's AbstractSet is thread-safe), although its iterators may not be.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic <E> MapPSet<E>static <E> MapPSet<E>static <E> MapPSet<E>from(PMap<E, ?> map, Collection<? extends E> list) intersect(Collection<? extends E> list) iterator()minusAll(Collection<?> list) plusAll(Collection<? extends E> list) intsize()Methods inherited from class org.pcollections.AbstractUnmodifiableSet
add, addAll, clear, remove, removeAll, removeIf, retainAllMethods inherited from class java.util.AbstractSet
equals, hashCodeMethods inherited from class java.util.AbstractCollection
containsAll, isEmpty, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
from
- Type Parameters:
E-- Parameters:
map-- Returns:
- a PSet with the elements of map.keySet(), backed by map
-
from
- Type Parameters:
E-- Parameters:
map-e-- Returns:
- from(map).plus(e)
-
from
- Type Parameters:
E-- Parameters:
map-list-- Returns:
- from(map).plusAll(list)
-
iterator
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceSet<E>- Specified by:
sizein classAbstractCollection<E>
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceSet<E>- Overrides:
containsin classAbstractCollection<E>
-
plus
-
minus
-
plusAll
-
minusAll
-
intersect
-