ranges

package
v0.0.0-...-cd5c7ba Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bound

type Bound interface {
	// contains filtered or unexported methods
}

type BoundExcluded

type BoundExcluded[T constraints.Ordered] struct {
	Value T
}

type BoundIncluded

type BoundIncluded[T constraints.Ordered] struct {
	Value T
}

type BoundUnbounded

type BoundUnbounded struct{}

type Inclusive

type Inclusive[T constraints.Ordered] struct {
	Start, End T
}

func NewInclusive

func NewInclusive[T constraints.Ordered](start, end T) Inclusive[T]

func (Inclusive[T]) Contains

func (ir Inclusive[T]) Contains(index T) bool

func (Inclusive[T]) EndBound

func (ir Inclusive[T]) EndBound() BoundIncluded[T]

func (Inclusive[T]) StartBound

func (ir Inclusive[T]) StartBound() BoundIncluded[T]

type Interface

type Interface[T any, S Bound, E Bound] interface {
	StartBound() S
	EndBound() E
	Contains(T) bool
}

type Range

type Range[T constraints.Ordered] struct {
	Start, End T
}

func New

func New[T constraints.Ordered](start, end T) Range[T]

func (Range[T]) Contains

func (r Range[T]) Contains(index T) bool

func (Range[T]) EndBound

func (r Range[T]) EndBound() BoundExcluded[T]

func (Range[T]) StartBound

func (r Range[T]) StartBound() BoundIncluded[T]

Jump to

Keyboard shortcuts

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