Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(full *ValueSortedFull)
func ValuedSetEquals ¶
Types ¶
type Span ¶
Span is the type of an adjacent sub key space.
type ValueSortedFull ¶
type ValueSortedFull struct { *ValuedFull // contains filtered or unexported fields }
ValueSortedFull is almost the same as `Valued`, however it added an extra index hence enabled query range by theirs value.
func Sorted ¶
func Sorted(f *ValuedFull) *ValueSortedFull
Sorted takes the ownership of a raw `ValuedFull` and then wrap it with `ValueSorted`.
func (*ValueSortedFull) Merge ¶
func (v *ValueSortedFull) Merge(newItem Valued)
func (*ValueSortedFull) MergeAll ¶
func (v *ValueSortedFull) MergeAll(newItems []Valued)
func (*ValueSortedFull) MinValue ¶
func (v *ValueSortedFull) MinValue() Value
func (*ValueSortedFull) TraverseValuesLessThan ¶
func (v *ValueSortedFull) TraverseValuesLessThan(n Value, action func(Valued) bool)
type ValuedFull ¶
type ValuedFull struct {
// contains filtered or unexported fields
}
ValuedFull represents a set of valued ranges, which doesn't overlap and union of them all is the full key space.
func NewFullWith ¶
func NewFullWith(initSpans []Span, init Value) *ValuedFull
NewFullWith creates a set of a subset of spans.
func (*ValuedFull) Merge ¶
func (f *ValuedFull) Merge(val Valued)
Merge merges a new interval into the span set. The value of overlapped part with other spans would be "merged" by the `join` function. An example:
|___________________________________________________________________________| ^-----------------^-----------------^-----------------^---------------------^ | c = 42 | c = 43 | c = 45 | c = 41 |
^--------------------------^ merge(| c = 44 |)
Would Give: |___________________________________________________________________________| ^-----------------^----^------------^-------------^---^---------------------^ | c = 42 | 43 | c = 44 | c = 45 | c = 41 |
|-------------| Unchanged, because 44 < 45.
func (*ValuedFull) Traverse ¶
func (f *ValuedFull) Traverse(m func(Valued) bool)
Traverse traverses all ranges by order.