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).
|
equalshashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitunionadd, addAll, clear, containsAll, isEmpty, remove, removeAll, removeIf, retainAll, toArray, toArrayconcat, drop, filter, flatMap, foldLeft, foldLeft, hash, hashCode, head, map, precat, take, takeWhile, toStringtoImList, toImMap, toImSet, toImSortedMap, toImSortedSet, toMutableList, toMutableMap, toMutableSet, toMutableSortedMap, toMutableSortedSetequals, hashCode, spliteratorparallelStream, streampublic 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)
UnmodSetpublic Equator<E> equator()
public ImUnsortedSet<E> immutable()
immutable in interface ImUnsortedSet<E>public PersistentHashSet<E> without(E key)
ImUnsortedSetpublic PersistentHashSet<E> put(E o)
ImUnsortedSetpublic UnmodIterator<E> iterator()
UnmodSetpublic int size()
Sizedpublic PersistentHashSet.MutableHashSet<E> mutable()
ImUnsortedSetmutable in interface ImUnsortedSet<E>Copyright © 2017. All rights reserved.