public class DiffSortedSet<V> extends ISortedSet.Mixin<V> implements IDiffSortedSet<V>
IDiffSortedSet.Durable<V>
ISortedSet.Bound, ISortedSet.Mixin<V>
hash
Constructor and Description |
---|
DiffSortedSet(ISortedMap<V,Void> diffMap) |
DiffSortedSet(ISortedSet<V> underlying) |
Modifier and Type | Method and Description |
---|---|
DiffSortedSet<V> |
add(V value) |
DiffSortedSet<V> |
clone() |
IDiffSortedMap<V,Void> |
diffMap() |
DiffSortedSet<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.
|
boolean |
isLinear() |
DiffSortedSet<V> |
linear()
This returns a data structure which is linear, or temporarily mutable.
|
IDiffSortedSet<V> |
rebase(ISortedSet<V> newUnderlying)
Returns a new diff, which is rebased atop the new underlying collection.
|
DiffSortedSet<V> |
remove(V value) |
ISortedSet<V> |
underlying()
The underlying collection
|
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
comparator, inclusiveFloorIndex, iterator, nth, size
ceil, ceilIndex, ceilIndex, difference, diffSorted, first, floor, floorIndex, floorIndex, indexOf, intersection, last, slice, slice, sliceIndices, union, valueEquality, valueHash, zip
contains, containsAll, containsAll, containsAny, containsAny, diff, elements, iterator, split, spliterator, stream, test, toArray, toArray, toSet
nth, save
public DiffSortedSet(ISortedMap<V,Void> diffMap)
public DiffSortedSet(ISortedSet<V> underlying)
public ISortedSet<V> underlying()
IDiff
underlying
in interface IDiff<ISortedSet<V>>
underlying
in interface IDiffSortedSet<V>
public IDiffSortedMap<V,Void> diffMap()
diffMap
in interface IDiffSortedSet<V>
public IDiffSortedSet<V> rebase(ISortedSet<V> newUnderlying)
IDiff
a.rebase(b).rebase(c)
is not necessarily equivalent to a.rebase(c)
.rebase
in interface IDiff<ISortedSet<V>>
rebase
in interface IDiffSortedSet<V>
public DiffSortedSet<V> add(V value)
public DiffSortedSet<V> remove(V value)
public DiffSortedSet<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 DiffSortedSet<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.
public boolean isLinear()
public DiffSortedSet<V> clone()
clone
in interface ICollection<ISet<V>,V>
clone
in class ISortedSet.Mixin<V>