generators

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorNegativeRange = "range must be increasing"
	ErrorUncleanStep   = "step would overshoot stop"
	ErrorTooManyArgs   = "the number of args must be in the range of [0,3]"
)

Variables

This section is empty.

Functions

func NewRange

func NewRange[TValue constraints.Float | constraints.Integer](args ...TValue) compounditerators.ReadForIndexIterator[int, TValue]

func NewRepeat

func NewRepeat[TValue any](generator func() (TValue, bool), limit int) compounditerators.ReadForIndexIterator[int, TValue]

Types

type Range

type Range[TValue constraints.Float | constraints.Integer] struct {
	// contains filtered or unexported fields
}

func (*Range[TValue]) Get

func (it *Range[TValue]) Get() (value TValue, found bool)

func (*Range[TValue]) GetKey

func (it *Range[TValue]) GetKey() (value int, found bool)

func (*Range[TValue]) Index

func (it *Range[TValue]) Index() (int, bool)

func (*Range[TValue]) IsBegin

func (it *Range[TValue]) IsBegin() bool

func (*Range[TValue]) IsEnd

func (it *Range[TValue]) IsEnd() bool

func (*Range[TValue]) IsFirst

func (it *Range[TValue]) IsFirst() bool

func (*Range[TValue]) IsLast

func (it *Range[TValue]) IsLast() bool

func (*Range[TValue]) IsValid

func (it *Range[TValue]) IsValid() bool

func (*Range[TValue]) Next

func (it *Range[TValue]) Next() bool

func (*Range[TValue]) NextN

func (it *Range[TValue]) NextN(n int) bool

func (*Range[TValue]) Size

func (it *Range[TValue]) Size() int

type Repeat

type Repeat[TValue any] struct {
	// contains filtered or unexported fields
}

func (*Repeat[TValue]) Get

func (it *Repeat[TValue]) Get() (value TValue, found bool)

func (*Repeat[TValue]) GetKey

func (it *Repeat[TValue]) GetKey() (int, bool)

func (*Repeat[TValue]) Index

func (it *Repeat[TValue]) Index() (int, bool)

func (*Repeat[TValue]) IsBegin

func (it *Repeat[TValue]) IsBegin() bool

func (*Repeat[TValue]) IsEnd

func (it *Repeat[TValue]) IsEnd() bool

func (*Repeat[TValue]) IsFirst

func (it *Repeat[TValue]) IsFirst() bool

func (*Repeat[TValue]) IsLast

func (it *Repeat[TValue]) IsLast() bool

func (*Repeat[TValue]) IsValid

func (it *Repeat[TValue]) IsValid() bool

func (*Repeat[TValue]) Next

func (it *Repeat[TValue]) Next() bool

func (*Repeat[TValue]) NextN

func (it *Repeat[TValue]) NextN(n int) bool

func (*Repeat[TValue]) Size

func (it *Repeat[TValue]) Size() int

Jump to

Keyboard shortcuts

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