Class OrderedPSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
org.pcollections.AbstractUnmodifiableSet<E>
org.pcollections.OrderedPSet<E>
- Type Parameters:
E-
- All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, Set<E>, PCollection<E>, PSet<E>
Like
PSet but preserves insertion order. Persistent equivalent of LinkedHashSet.
(Note: this is different from PSortedSet, which keeps elements in the order specified
by Comparable.compareTo(Object) or Comparator.compare(Object, Object).)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic <E> OrderedPSet<E> empty()static <E> OrderedPSet<E> from(Collection<? extends E> list) intersect(Collection<? extends E> list) iterator()minusAll(Collection<?> list) plusAll(Collection<? extends E> list) static <E> OrderedPSet<E> singleton(E e) intsize()Methods inherited from class AbstractUnmodifiableSet
add, addAll, clear, remove, removeAll, removeIf, retainAllMethods inherited from class AbstractSet
equals, hashCodeMethods inherited from class AbstractCollection
containsAll, isEmpty, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
empty
-
from
-
singleton
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceSet<E>- Overrides:
containsin classAbstractCollection<E>
-
plus
-
plusAll
-
minus
-
minusAll
-
intersect
-
iterator
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceSet<E>- Specified by:
sizein classAbstractCollection<E>
-