org.dthume.data.interval-treeset
Finger tree based interval treeset implementation.
Based largely on the original paper
Provides an efficient, persistent representation of a set of items sorted by the interval which they occupy.
covered-range
(covered-range t)Return the covered range, i.e. minimum start value and maximum end value, of the intervals of all the items in interval treeset t.
difference
first-overlapping
(first-overlapping this ival)(first-overlapping this ival n-f)Search this for the first value which overlaps ival, returning nil if none is found in the two arg case, or n-f in the three arg case.
intersection
interval
(interval s e)Create an interval with range s to e
interval-treeset
(interval-treeset & {:as conf})Create an empty interval tree set. Available options:
- :as-interval
- Extract an interval value for an item
- :compare-point
- Comparator for two points. Defaults to
clojure.core/compare. - :zero-interval
- Zero value for the intervals used in this set. Defaults to
(interval nil Integer/MIN_VALUE).
it-difference
(it-difference lhs rhs)it-intersection
(it-intersection lhs rhs)it-union
(it-union lhs rhs)select
(select this k)Return a selection whose selected part contains a single item - k.
select-overlapping
(select-overlapping this ival)Select the subregion of this set which overlaps ival, returning a tuple of the form [prefix selected suffix] where prefix, selected and suffix are all interval treesets. The methods in org.dthume.data.finger-tree.selection may prove useful in working with the resulting selection.