Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iterator ¶
type Iterator[T any] interface { // contains filtered or unexported methods }
Iterator is the interface that wraps the basic methods for an iterator.
type SliceIterator ¶
type SliceIterator[T any] struct { // contains filtered or unexported fields }
SliceIterator is the implementation of Iterator for a slice.
func NewIterator ¶
func NewIterator[T any](items []T) *SliceIterator[T]
NewIterator returns a new instance of SliceIterator.
func (*SliceIterator[T]) GetNext ¶
func (u *SliceIterator[T]) GetNext() (T, bool)
GetNext returns the next item in the slice.
func (*SliceIterator[T]) GetNextOrDefault ¶
func (u *SliceIterator[T]) GetNextOrDefault(d T) T
GetNextOrDefault returns the next item in the slice or the default value if there is no next item.
func (*SliceIterator[T]) HasNext ¶
func (u *SliceIterator[T]) HasNext() bool
HasNext returns true if there is a next item to retrieve.
Click to show internal directories.
Click to hide internal directories.