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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PSortedMap<Long, E> private static final OrderedPSet<Object> private static final long -
Constructor Summary
Constructors -
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 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
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
EMPTY
-
ids
-
elements
-
-
Constructor Details
-
OrderedPSet
-
-
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>
-