rangeset

package
v0.15.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilenameRangeSet

type FilenameRangeSet struct {
	// contains filtered or unexported fields
}

func NewFilenameRangeSet

func NewFilenameRangeSet() *FilenameRangeSet

func (*FilenameRangeSet) Add

func (frs *FilenameRangeSet) Add(filename string, start, end int)

func (*FilenameRangeSet) Contains

func (frs *FilenameRangeSet) Contains(filename string, offset int) bool

func (*FilenameRangeSet) String

func (frs *FilenameRangeSet) String() string

type Range

type Range struct {
	Start int
	End   int
}

Range represents a single continuous interval [Start, End). The interval includes Start but excludes End.

func (Range) String

func (r Range) String() string

type RangeSet

type RangeSet struct {
	// contains filtered or unexported fields
}

RangeSet holds a collection of sorted, non-overlapping ranges.

func NewRangeSet

func NewRangeSet() *RangeSet

NewRangeSet creates and returns a new, empty RangeSet.

func (*RangeSet) Add

func (rs *RangeSet) Add(start, end int)

Add incorporates a new range into the set. It finds all existing ranges that overlap or are adjacent to the new range and merges them into a single, larger range.

func (*RangeSet) Contains

func (rs *RangeSet) Contains(offset int) bool

Contains reports if an offset is within any of the ranges in the set.

func (*RangeSet) Ranges

func (rs *RangeSet) Ranges() []Range

Ranges returns the sorted ranges that make up this range set.

func (*RangeSet) String

func (rs *RangeSet) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL