| Constructor and Description |
|---|
Set() |
Set(ToLongFunction<V> hashFn,
BiPredicate<V,V> equalsFn) |
| Modifier and Type | Method and Description |
|---|---|
Set<V> |
add(V value) |
Set<V> |
add(V value,
Object editor) |
Set<V> |
clone() |
boolean |
contains(V value) |
Set<V> |
difference(ISet<V> s) |
boolean |
equals(Object obj) |
Set<V> |
forked()
This returns a data structure which is forked, which is equivalent to Clojure's persistent
data structures, also sometimes called functional or immutable.
|
static <V> Set<V> |
from(ISet<V> s) |
static <V> Set<V> |
from(Iterable<V> iterable) |
static <V> Set<V> |
from(Iterator<V> iterator) |
int |
hashCode() |
OptionalLong |
indexOf(V element) |
Set<V> |
intersection(ISet<V> s) |
boolean |
isLinear() |
Iterator<V> |
iterator() |
Set<V> |
linear()
This returns a data structure which is linear, or temporarily mutable.
|
V |
nth(long idx) |
static <V> Set<V> |
of(V... elements) |
Set<V> |
remove(V value) |
Set<V> |
remove(V value,
Object editor) |
long |
size() |
List<Set<V>> |
split(int parts)
Splits the collection into roughly even pieces, for parallel processing.
|
String |
toString() |
Set<V> |
union(ISet<V> s) |
BiPredicate<V,V> |
valueEquality() |
ToLongFunction<V> |
valueHash() |
<U> Map<V,U> |
zip(Function<V,U> f) |
finalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, containsAll, containsAny, containsAny, elements, spliterator, stream, test, toArray, toArray, toSetnth, savepublic static final Set EMPTY
public Set()
public Set(ToLongFunction<V> hashFn, BiPredicate<V,V> equalsFn)
hashFn - the hash function used by the setequalsFn - the equality semantics used by the setpublic static <V> Set<V> from(ISet<V> s)
s - a setpublic static <V> Set<V> from(Iterator<V> iterator)
iterator - an iteratorpublic static <V> Set<V> from(Iterable<V> iterable)
iterable - an Iterable objectpublic static <V> Set<V> of(V... elements)
public boolean isLinear()
public ToLongFunction<V> valueHash()
public BiPredicate<V,V> valueEquality()
valueEquality in interface ISet<V>public boolean contains(V value)
public long size()
size in interface ICollection<ISet<V>,V>public OptionalLong indexOf(V element)
public V nth(long idx)
nth in interface ICollection<ISet<V>,V>idxpublic List<Set<V>> split(int parts)
ICollectionparts subsets.public Set<V> difference(ISet<V> s)
difference in interface ISet<V>setpublic Set<V> intersection(ISet<V> s)
intersection in interface ISet<V>setpublic Set<V> forked()
ICollectionIf only a single function or scope uses the data structure, it can be left as a linear data structure, which can have significant performance benefits.
If the data structure is already forked, it will simply return itself.
public Set<V> linear()
ICollection
If ICollection.forked() is called on a linear collection, all references to that linear collection should be discarded.
If the data structure is already linear, it will simply return itself.