public interface ISet<V> extends ICollection<ISet<V>,V>, Predicate<V>
Modifier and Type | Interface and Description |
---|---|
static interface |
ISet.Durable<V> |
static class |
ISet.Mixin<V> |
Modifier and Type | Method and Description |
---|---|
default ISet<V> |
add(V value) |
default boolean |
contains(V value) |
default boolean |
containsAll(IMap<V,?> map) |
default boolean |
containsAll(ISet<V> set) |
default boolean |
containsAny(IMap<V,?> map) |
default boolean |
containsAny(ISet<V> set) |
default IDiffSet<V> |
diff() |
default ISet<V> |
difference(ISet<V> set) |
default IList<V> |
elements() |
default 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.
|
OptionalLong |
indexOf(V element) |
default ISet<V> |
intersection(ISet<V> set) |
default boolean |
isLinear() |
default Iterator<V> |
iterator(long startIndex) |
default ISet<V> |
linear()
This returns a data structure which is linear, or temporarily mutable.
|
default ISet<V> |
remove(V value) |
default ISet<V> |
sliceIndices(long startIndex,
long endIndex) |
default IList<? extends ISet<V>> |
split(int parts)
Splits the collection into roughly even pieces, for parallel processing.
|
default Spliterator<V> |
spliterator() |
default Stream<V> |
stream() |
default boolean |
test(V v) |
default Object[] |
toArray() |
default V[] |
toArray(IntFunction<V[]> allocator) |
default Set<V> |
toSet() |
default ISet<V> |
union(ISet<V> set) |
BiPredicate<V,V> |
valueEquality() |
ToLongFunction<V> |
valueHash() |
default <U> IMap<V,U> |
zip(Function<V,U> f) |
ToLongFunction<V> valueHash()
BiPredicate<V,V> valueEquality()
default boolean contains(V value)
value
default <U> IMap<V,U> zip(Function<V,U> f)
f
, for each element in the setOptionalLong indexOf(V element)
element
in the collection, if it's presentdefault boolean containsAll(ISet<V> set)
set
default boolean containsAll(IMap<V,?> map)
map
default boolean containsAny(ISet<V> set)
set
default boolean containsAny(IMap<V,?> map)
map
default Iterator<V> iterator(long startIndex)
iterator
in interface ICollection<ISet<V>,V>
default Spliterator<V> spliterator()
spliterator
in interface Iterable<V>
default ISet<V> difference(ISet<V> set)
set
default ISet<V> intersection(ISet<V> set)
set
default Set<V> toSet()
UnsupportedOperationException
on writesdefault Object[] toArray()
default V[] toArray(IntFunction<V[]> allocator)
allocator
- a function which creates an array of the specified sizedefault boolean isLinear()
isLinear
in interface ICollection<ISet<V>,V>
default ISet<V> forked()
ICollection
If 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.
forked
in interface ICollection<ISet<V>,V>
default ISet<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.
linear
in interface ICollection<ISet<V>,V>
default IList<? extends ISet<V>> split(int parts)
ICollection
parts
subsets.split
in interface ICollection<ISet<V>,V>
parts
- the target number of pieces