public class SortedSet<V> extends Object implements ISortedSet<V>
| Constructor and Description |
|---|
SortedSet() |
| Modifier and Type | Method and Description |
|---|---|
SortedSet<V> |
add(V value) |
V |
ceil(V val) |
ISet<V> |
clone() |
Comparator<V> |
comparator() |
boolean |
contains(V value) |
IList<V> |
elements() |
boolean |
equals(Object obj) |
V |
floor(V val) |
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.
|
int |
hashCode() |
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() |
SortedSet<V> |
slice(V min,
V max) |
String |
toString() |
BiPredicate<V,V> |
valueEquality() |
ToLongFunction<V> |
valueHash() |
<U> SortedMap<V,U> |
zip(Function<V,U> f) |
finalize, getClass, notify, notifyAll, wait, wait, waitdifference, first, intersection, last, unioncontainsAll, containsAll, containsAny, containsAny, isLinear, iterator, split, spliterator, stream, test, toArray, toArray, toSetnth, savepublic Comparator<V> comparator()
comparator in interface ISortedSet<V>public V floor(V val)
floor in interface ISortedSet<V>key, or just below it. If key is less than the
minimum value in the map, returns null.public V ceil(V val)
ceil in interface ISortedSet<V>key, or just above it. If key is greater than the
maximum value in the map, returns null.public SortedSet<V> slice(V min, V max)
slice in interface ISortedSet<V>min - the inclusive minimum key valuemax - the inclusive maximum key value[min, max]public ToLongFunction<V> valueHash()
public BiPredicate<V,V> valueEquality()
valueEquality in interface ISet<V>public boolean contains(V value)
public OptionalLong indexOf(V element)
public long size()
size in interface ICollection<ISet<V>,V>public V nth(long idx)
nth in interface ICollection<ISet<V>,V>idxpublic SortedSet<V> 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 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.