sliceiterator

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package sliceiterator - builds an iterator from a slice to allow peaking for the next value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

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

Iterator - iterator data

func New

func New(s *[]string) *Iterator

New - builds a string Iterator

func (*Iterator) ExistsNext

func (a *Iterator) ExistsNext() bool

ExistsNext - tells if there is more data to be read.

func (*Iterator) Index

func (a *Iterator) Index() int

Index - return current index.

func (*Iterator) IsLast

func (a *Iterator) IsLast() bool

IsLast - Tells if the current element is the last.

func (*Iterator) Next

func (a *Iterator) Next() bool

Next - moves the index forward and returns a bool to indicate if there is another value.

func (*Iterator) PeekNextValue

func (a *Iterator) PeekNextValue() (string, bool)

PeekNextValue - Returns the next value and indicates whether or not it is valid.

func (*Iterator) Remaining

func (a *Iterator) Remaining() []string

Remaining - Get all remaining values index inclusive.

func (*Iterator) Reset

func (a *Iterator) Reset()

Reset - resets the index of the Iterator.

func (*Iterator) Size

func (a *Iterator) Size() int

Size - returns Iterator size

func (*Iterator) Value

func (a *Iterator) Value() string

Value - returns value at current index or an empty string if you are trying to read the value after having fully read the list.

Jump to

Keyboard shortcuts

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