intervalst

package
v0.20.0-beta3 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry added in v0.16.0

type Entry struct {
	Interval Interval
	Value    interface{}
}

type Interval

type Interval struct {
	Min, Max Position
}

func NewInterval

func NewInterval(min, max Position) Interval

func (Interval) Compare

func (i Interval) Compare(other Interval) int

func (Interval) Contains

func (i Interval) Contains(x Position) bool

func (Interval) Intersects

func (i Interval) Intersects(other Interval) bool

func (Interval) String

func (i Interval) String() string

type IntervalST

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

func (*IntervalST) Contains

func (t *IntervalST) Contains(interval Interval) bool

func (*IntervalST) Get

func (t *IntervalST) Get(interval Interval) interface{}

func (*IntervalST) Put

func (t *IntervalST) Put(interval Interval, value interface{})

Put associates an interval with a value.

NOTE: does *not* check if the interval already exists

func (*IntervalST) Search

func (t *IntervalST) Search(p Position) (*Interval, interface{})

func (*IntervalST) SearchAll added in v0.16.0

func (t *IntervalST) SearchAll(p Position) []Entry

func (*IntervalST) SearchInterval

func (t *IntervalST) SearchInterval(interval Interval) (*Interval, interface{})

func (*IntervalST) Values

func (t *IntervalST) Values() []interface{}

type MinPosition

type MinPosition struct{}

func (MinPosition) Compare

func (MinPosition) Compare(other Position) int

type Position

type Position interface {
	Compare(other Position) int
}

Jump to

Keyboard shortcuts

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