iterator

package
v0.0.0-...-7535400 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 0 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[E any] interface {
	HasNext() bool
	Next() E
	Cur() E
}

Iterator is an interface that provides the methods to iterate over a collection.

Use the HasNext method to verify there are still elements left, and the Next method to retrieve the next element.

type SliceIterator

type SliceIterator[T ~[]E, E any] struct {
	// contains filtered or unexported fields
}

func NewSliceIterator

func NewSliceIterator[T ~[]E, E any](elems T) *SliceIterator[T, E]

func (*SliceIterator[T, E]) Cur

func (i *SliceIterator[T, E]) Cur() (elem E)

func (*SliceIterator[T, E]) HasNext

func (i *SliceIterator[T, E]) HasNext() bool

func (*SliceIterator[T, E]) Next

func (i *SliceIterator[T, E]) Next() (elem E)

Jump to

Keyboard shortcuts

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