| Constructor and Description |
|---|
LinearSet() |
LinearSet(int initialCapacity) |
LinearSet(int initialCapacity,
ToLongFunction<V> hashFn,
BiPredicate<V,V> equalsFn) |
LinearSet(ToLongFunction<V> hashFn,
BiPredicate<V,V> equalsFn) |
| Modifier and Type | Method and Description |
|---|---|
LinearSet<V> |
add(V value) |
LinearSet<V> |
clear() |
LinearSet<V> |
clone() |
boolean |
contains(V value) |
LinearSet<V> |
difference(ISet<V> s) |
boolean |
equals(Object obj) |
ISet<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> LinearSet<V> |
from(Collection<V> collection) |
static <V> LinearSet<V> |
from(IList<V> list) |
static <V> LinearSet<V> |
from(ISet<V> set) |
static <V> LinearSet<V> |
from(Iterable<V> iterable) |
static <V> LinearSet<V> |
from(Iterator<V> iterator) |
int |
hashCode() |
OptionalLong |
indexOf(V element) |
LinearSet<V> |
intersection(ISet<V> s) |
boolean |
isLinear() |
Iterator<V> |
iterator() |
LinearSet<V> |
linear()
This returns a data structure which is linear, or temporarily mutable.
|
V |
nth(long idx) |
static <V> LinearSet<V> |
of(V... elements) |
LinearSet<V> |
remove(V value) |
long |
size() |
List<LinearSet<V>> |
split(int parts)
Splits the collection into roughly even pieces, for parallel processing.
|
String |
toString() |
LinearSet<V> |
union(ISet<V> s) |
BiPredicate<V,V> |
valueEquality() |
ToLongFunction<V> |
valueHash() |
<U> LinearMap<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 LinearSet()
public LinearSet(int initialCapacity)
initialCapacity - the initial capacity of the setpublic LinearSet(int initialCapacity,
ToLongFunction<V> hashFn,
BiPredicate<V,V> equalsFn)
initialCapacity - the initial capacity of the sethashFn - the hash function used by the setequalsFn - the equality semantics used by the setpublic LinearSet(ToLongFunction<V> hashFn, BiPredicate<V,V> equalsFn)
hashFn - the hash function used by the setequalsFn - the equality semantics used by the setpublic static <V> LinearSet<V> from(IList<V> list)
listpublic static <V> LinearSet<V> from(Collection<V> collection)
collectionpublic static <V> LinearSet<V> from(Iterator<V> iterator)
iteratorpublic static <V> LinearSet<V> from(Iterable<V> iterable)
iterablepublic static <V> LinearSet<V> from(ISet<V> set)
set, with the same equality semanticspublic static <V> LinearSet<V> of(V... elements)
elementspublic 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 LinearSet<V> difference(ISet<V> s)
difference in interface ISet<V>setpublic LinearSet<V> intersection(ISet<V> s)
intersection in interface ISet<V>setpublic ISet<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 LinearSet<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.
public List<LinearSet<V>> split(int parts)
ICollectionparts subsets.