public class SortedSet<V> extends ISortedSet.Mixin<V>
ISortedSet.Bound, ISortedSet.Mixin<V>
ISet.Durable<V>
hash
Constructor and Description |
---|
SortedSet() |
Modifier and Type | Method and Description |
---|---|
SortedSet<V> |
add(V value) |
OptionalLong |
ceilIndex(V val) |
Comparator<V> |
comparator() |
boolean |
contains(V value) |
IList<V> |
elements() |
SortedSet<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) |
OptionalLong |
indexOf(V element) |
SortedSet<V> |
linear()
This returns a data structure which is linear, or temporarily mutable.
|
V |
nth(long idx) |
SortedSet<V> |
remove(V value) |
long |
size() |
BiPredicate<V,V> |
valueEquality() |
ToLongFunction<V> |
valueHash() |
<U> SortedMap<V,U> |
zip(Function<V,U> f) |
clone
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
ceil, ceilIndex, difference, diffSorted, first, floor, floorIndex, floorIndex, intersection, last, slice, slice, sliceIndices, union
containsAll, containsAll, containsAny, containsAny, diff, isLinear, iterator, split, spliterator, stream, test, toArray, toArray, toSet
iterator, nth, save
public Comparator<V> comparator()
public OptionalLong inclusiveFloorIndex(V val)
key
, or just below it. If key
is less than the
minimum value in the map, returns null
.public OptionalLong ceilIndex(V val)
key
, or just above it. If key
is greater than the
maximum value in the map, returns null
.public <U> SortedMap<V,U> zip(Function<V,U> f)
f
, for each element in the setpublic ToLongFunction<V> valueHash()
public BiPredicate<V,V> valueEquality()
public boolean contains(V value)
value
public OptionalLong indexOf(V element)
element
in the collection, if it's presentpublic long size()
public V nth(long idx)
idx
public SortedSet<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.
public SortedSet<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.