public class IntSet extends ISet.Mixin<Long> implements ISortedSet<Long>
ISortedSet.Bound, ISortedSet.Mixin<V>
ISet.Durable<V>
Constructor and Description |
---|
IntSet() |
Modifier and Type | Method and Description |
---|---|
IntSet |
add(Long value) |
OptionalLong |
ceilIndex(Long val) |
Comparator<Long> |
comparator() |
boolean |
contains(Long value) |
IntSet |
difference(ISet<Long> s) |
IList<Long> |
elements() |
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 |
inclusiveFloorIndex(Long val) |
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 |
sliceReal(Long min,
Long max) |
IntSet |
union(ISet<Long> s) |
BiPredicate<Long,Long> |
valueEquality() |
ToLongFunction<Long> |
valueHash() |
clone, equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
ceil, ceilIndex, diffSorted, first, floor, floorIndex, floorIndex, last, slice, slice, sliceIndices, zip
containsAll, containsAll, containsAny, containsAny, diff, isLinear, iterator, split, spliterator, stream, test, toArray, toArray, toSet
clone, iterator, nth, save
public OptionalLong inclusiveFloorIndex(Long val)
inclusiveFloorIndex
in interface ISortedSet<Long>
key
, or just below it. If key
is less than the
minimum value in the map, returns null
.public OptionalLong ceilIndex(Long val)
ceilIndex
in interface ISortedSet<Long>
key
, or just above it. If key
is greater than the
maximum value in the map, returns null
.public IntSet difference(ISet<Long> s)
difference
in interface ISet<Long>
difference
in interface ISortedSet<Long>
set
public IntSet intersection(ISet<Long> s)
intersection
in interface ISet<Long>
intersection
in interface ISortedSet<Long>
set
public Comparator<Long> comparator()
comparator
in interface ISortedSet<Long>
public ToLongFunction<Long> valueHash()
public BiPredicate<Long,Long> valueEquality()
valueEquality
in interface ISet<Long>
valueEquality
in interface ISortedSet<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>
idx
public IntSet 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.
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.