public class PersistentHashSet<E> extends UnmodSet.AbstractUnmodSet<E> implements ImUnsortedSet<E>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
PersistentHashSet.MutableHashSet<E> |
UnmodSet.AbstractUnmodSet<T>
UnmodIterable.AbstractUnmodIterable<T>
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.MutableHashSet<E> |
emptyMutable()
Works around some type inference limitations of Java 8.
|
static <E> PersistentHashSet.MutableHashSet<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
|
ImUnsortedSet<E> |
immutable()
Returns a this set.
|
UnmodIterator<E> |
iterator()
Iterates over contents with no guarantees about their ordering.
|
PersistentHashSet.MutableHashSet<E> |
mutable()
Returns a mutable (builder) version of this set that is not thread safe.
|
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(ImUnsortedMap<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 iterable.
|
PersistentHashSet<E> |
without(E key)
Removes the given item, returning a modified version of the set (leaving the original set
unchanged).
|
equals
hashCode, toString
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
union
add, addAll, clear, containsAll, isEmpty, remove, removeAll, removeIf, retainAll, toArray, toArray
concat, drop, filter, flatMap, foldLeft, foldLeft, hash, hashCode, head, map, precat, take, takeWhile, toString
toImList, toImMap, toImSet, toImSortedMap, toImSortedSet, toMutableList, toMutableMap, toMutableSet, toMutableSortedMap, toMutableSortedSet
equals, hashCode, spliterator
parallelStream, stream
public static final PersistentHashSet<Object> EMPTY
public static <E> PersistentHashSet<E> empty()
public static <E> PersistentHashSet.MutableHashSet<E> emptyMutable()
public static <E> PersistentHashSet<E> empty(Equator<E> eq)
public static <E> PersistentHashSet.MutableHashSet<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(ImUnsortedMap<E,?> map)
public boolean contains(Object key)
UnmodSet
public Equator<E> equator()
public ImUnsortedSet<E> immutable()
immutable
in interface ImUnsortedSet<E>
public PersistentHashSet<E> without(E key)
ImUnsortedSet
public PersistentHashSet<E> put(E o)
ImUnsortedSet
public UnmodIterator<E> iterator()
UnmodSet
public int size()
Sized
public PersistentHashSet.MutableHashSet<E> mutable()
ImUnsortedSet
mutable
in interface ImUnsortedSet<E>
Copyright © 2016. All rights reserved.