public class PersistentHashSet<E> extends AbstractUnmodSet<E> implements ImSet<E>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
PersistentHashSet.MutHashSet<E> |
UnmodIterable.UnIterable
Modifier and Type | Field and Description |
---|---|
static PersistentHashSet<Object> |
EMPTY |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Object key)
Returns true if the set contains the given item.
|
static <E> PersistentHashSet<E> |
empty() |
static <E> PersistentHashSet<E> |
empty(Equator<E> eq) |
static <E> PersistentHashSet.MutHashSet<E> |
emptyMutable()
Works around some type inference limitations of Java 8.
|
static <E> PersistentHashSet.MutHashSet<E> |
emptyMutable(Equator<E> eq)
Works around some type inference limitations of Java 8.
|
Equator<E> |
equator()
Returns the Equator used by this set for equals comparisons and hashCodes
|
UnmodIterator<E> |
iterator()
Iterates over contents with no guarantees about their ordering.
|
PersistentHashSet.MutHashSet<E> |
mutable()
Returns a mutable version of this immutable set.
|
static <E> PersistentHashSet<E> |
of(Iterable<E> elements)
Returns a new PersistentHashSet of the values.
|
static <E> PersistentHashSet<E> |
ofEq(Equator<E> eq,
Iterable<E> init) |
static <E> PersistentHashSet<E> |
ofMap(ImMap<E,?> map) |
PersistentHashSet<E> |
put(E o)
Adds an element, returning a modified version of the set (leaving the original set unchanged).
|
int |
size()
Returns the number of items in this collection or iterable.
|
PersistentHashSet<E> |
without(E key)
Removes this key from the set
|
equals
hashCode, toString
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, addAll, clear, containsAll, isEmpty, remove, removeAll, removeIf, retainAll, toArray, toArray
concat, drop, dropWhile, emptyUnmodIterable, filter, flatMap, fold, foldUntil, hash, head, map, precat, take, takeWhile, toString
toImList, toImMap, toImSet, toImSortedMap, toImSortedSet, toMutList, toMutMap, toMutSet, toMutSortedMap, toMutSortedSet
equals, hashCode, spliterator
parallelStream, stream
public static final PersistentHashSet<Object> EMPTY
public static <E> PersistentHashSet<E> empty()
public static <E> PersistentHashSet.MutHashSet<E> emptyMutable()
public static <E> PersistentHashSet<E> empty(Equator<E> eq)
public static <E> PersistentHashSet.MutHashSet<E> emptyMutable(Equator<E> eq)
public static <E> PersistentHashSet<E> of(Iterable<E> elements)
StaticImports.set(Object...)
If the input contains duplicate
elements, later values overwrite earlier ones.elements
- The items to put into a vector.public static <E> PersistentHashSet<E> ofEq(Equator<E> eq, Iterable<E> init)
public static <E> PersistentHashSet<E> ofMap(ImMap<E,?> map)
public boolean contains(Object key)
UnmodSet
public Equator<E> equator()
public PersistentHashSet<E> without(E key)
ImSet
public PersistentHashSet<E> put(E o)
ImSet
public UnmodIterator<E> iterator()
UnmodSet
public int size()
Sized
Copyright © 2017. All rights reserved.