public class IntSet extends Object implements ISortedSet<Long>
| Constructor and Description |
|---|
IntSet() |
| Modifier and Type | Method and Description |
|---|---|
IntSet |
add(Long value) |
Long |
ceil(Long val) |
ISet<Long> |
clone() |
Comparator<Long> |
comparator() |
boolean |
contains(Long value) |
IntSet |
difference(ISet<Long> s) |
IList<Long> |
elements() |
Long |
floor(Long val) |
IntSet |
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(Long element) |
IntSet |
intersection(ISet<Long> s) |
IntSet |
linear()
This returns a data structure which is linear, or temporarily mutable.
|
Long |
nth(long idx) |
IntSet |
remove(Long value) |
long |
size() |
IntSet |
slice(Long min,
Long max) |
IntSet |
union(ISet<Long> s) |
BiPredicate<Long,Long> |
valueEquality() |
ToLongFunction<Long> |
valueHash() |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfirst, lastcontainsAll, containsAll, containsAny, containsAny, isLinear, iterator, split, spliterator, stream, test, toArray, toArray, toSet, zipnth, savepublic Long floor(Long val)
floor in interface ISortedSet<Long>key, or just below it. If key is less than the
minimum value in the map, returns null.public Long ceil(Long val)
ceil in interface ISortedSet<Long>key, or just above it. If key is greater than the
maximum value in the map, returns null.public IntSet slice(Long min, Long max)
slice in interface ISortedSet<Long>min - the inclusive minimum key valuemax - the inclusive maximum key value[min, max]public IntSet difference(ISet<Long> s)
difference in interface ISet<Long>difference in interface ISortedSet<Long>setpublic IntSet intersection(ISet<Long> s)
intersection in interface ISet<Long>intersection in interface ISortedSet<Long>setpublic Comparator<Long> comparator()
comparator in interface ISortedSet<Long>public ToLongFunction<Long> valueHash()
public BiPredicate<Long,Long> valueEquality()
valueEquality in interface ISet<Long>public boolean contains(Long value)
public OptionalLong indexOf(Long element)
public long size()
size in interface ICollection<ISet<Long>,Long>public Long nth(long idx)
nth in interface ICollection<ISet<Long>,Long>idxpublic IntSet 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 IntSet 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.