ranges

package
v0.0.0-...-4995b8b Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

type Iterator[T any] struct {
	// contains filtered or unexported fields
}

func (*Iterator[T]) Item

func (i *Iterator[T]) Item() Range[T]

func (*Iterator[T]) Next

func (i *Iterator[T]) Next()

func (*Iterator[T]) Valid

func (i *Iterator[T]) Valid() bool

type Range

type Range[T any] struct {
	Start T
	End   T
}

type Ranges

type Ranges[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T constraints.Integer]() *Ranges[T]

func NewWithCompare

func NewWithCompare[T any](cmp func(a, b T) bool, closest func(a T, before bool) T) *Ranges[T]

func (*Ranges[T]) Add

func (r *Ranges[T]) Add(a Range[T])

func (Ranges[T]) Iterator

func (r Ranges[T]) Iterator() Iterator[T]

func (*Ranges[T]) Len

func (r *Ranges[T]) Len() int

func (*Ranges[T]) Subtract

func (r *Ranges[T]) Subtract(a Range[T])

Jump to

Keyboard shortcuts

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