public interface ISortedSet<V> extends ISet<V>
Modifier and Type | Interface and Description |
---|---|
static class |
ISortedSet.Bound |
static class |
ISortedSet.Mixin<V> |
ISet.Durable<V>
Modifier and Type | Method and Description |
---|---|
default ISortedSet<V> |
add(V value) |
default V |
ceil(V val) |
default OptionalLong |
ceilIndex(V val) |
default OptionalLong |
ceilIndex(V val,
ISortedSet.Bound bound) |
Comparator<V> |
comparator() |
default ISortedSet<V> |
difference(ISet<V> s) |
default IDiffSortedSet<V> |
diffSorted() |
default V |
first() |
default V |
floor(V val) |
default OptionalLong |
floorIndex(V val) |
default OptionalLong |
floorIndex(V val,
ISortedSet.Bound bound) |
default ISortedSet<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 |
inclusiveFloorIndex(V val) |
default OptionalLong |
indexOf(V element) |
default ISortedSet<V> |
intersection(ISet<V> s) |
default V |
last() |
default ISortedSet<V> |
linear()
This returns a data structure which is linear, or temporarily mutable.
|
default ISortedSet<V> |
remove(V value) |
default IDiffSortedSet<V> |
slice(V min,
ISortedSet.Bound minBound,
V max,
ISortedSet.Bound maxBound) |
default IDiffSortedSet<V> |
slice(V min,
V max) |
default ISortedSet<V> |
sliceIndices(long startIndex,
long endIndex) |
default ISortedSet<V> |
union(ISet<V> s) |
default BiPredicate<V,V> |
valueEquality() |
default ToLongFunction<V> |
valueHash() |
default <U> ISortedMap<V,U> |
zip(Function<V,U> f) |
contains, containsAll, containsAll, containsAny, containsAny, diff, elements, isLinear, iterator, split, spliterator, stream, test, toArray, toArray, toSet
Comparator<V> comparator()
OptionalLong inclusiveFloorIndex(V val)
key
, or just below it. If key
is less than the
minimum value in the map, returns null
.default ToLongFunction<V> valueHash()
default BiPredicate<V,V> valueEquality()
valueEquality
in interface ISet<V>
default OptionalLong floorIndex(V val, ISortedSet.Bound bound)
default OptionalLong ceilIndex(V val, ISortedSet.Bound bound)
default OptionalLong ceilIndex(V val)
key
, or just above it. If key
is greater than the
maximum value in the map, returns null
.default OptionalLong floorIndex(V val)
default OptionalLong indexOf(V element)
default V floor(V val)
key
, or just below it. If key
is less than the
minimum value in the map, returns null
.default V ceil(V val)
key
, or just above it. If key
is greater than the
maximum value in the map, returns null
.default IDiffSortedSet<V> slice(V min, V max)
min
- the inclusive minimum key valuemax
- the inclusive maximum key value[min, max]
default IDiffSortedSet<V> slice(V min, ISortedSet.Bound minBound, V max, ISortedSet.Bound maxBound)
default <U> ISortedMap<V,U> zip(Function<V,U> f)
default ISortedSet<V> sliceIndices(long startIndex, long endIndex)
sliceIndices
in interface ISet<V>
default ISortedSet<V> add(V value)
default ISortedSet<V> remove(V value)
default ISortedSet<V> union(ISet<V> s)
default ISortedSet<V> difference(ISet<V> s)
difference
in interface ISet<V>
set
default ISortedSet<V> intersection(ISet<V> s)
intersection
in interface ISet<V>
set
default ISortedSet<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.
default ISortedSet<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.
default IDiffSortedSet<V> diffSorted()
default V first()
default V last()