col

package module
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action[E any] func(e E)

type ArrayList

type ArrayList[E any] struct {
	// contains filtered or unexported fields
}

func (*ArrayList[E]) Add

func (a *ArrayList[E]) Add(e ...E) List[E]

func (*ArrayList[E]) AddAll

func (a *ArrayList[E]) AddAll(col List[E]) List[E]

func (*ArrayList[E]) Clear

func (a *ArrayList[E]) Clear()

func (*ArrayList[E]) Collect

func (a *ArrayList[E]) Collect() []E

func (*ArrayList[E]) Contains

func (a *ArrayList[E]) Contains(e ...E) bool

func (*ArrayList[E]) DeepEquals

func (a *ArrayList[E]) DeepEquals(col List[E]) bool

func (*ArrayList[E]) Equals

func (a *ArrayList[E]) Equals(e List[E]) (result bool)

func (*ArrayList[E]) Filter

func (a *ArrayList[E]) Filter(pred Predicate[E]) List[E]

func (*ArrayList[E]) ForEach

func (a *ArrayList[E]) ForEach(action Action[E])

func (*ArrayList[E]) GetHash

func (a *ArrayList[E]) GetHash() string

func (*ArrayList[E]) IsEmpty

func (a *ArrayList[E]) IsEmpty() bool

func (*ArrayList[E]) Iterator

func (a *ArrayList[E]) Iterator() Iterator[E]

func (*ArrayList[E]) Remove

func (a *ArrayList[E]) Remove(e ...E)

func (*ArrayList[E]) RemoveIf

func (a *ArrayList[E]) RemoveIf(pred Predicate[E])

type Collector

type Collector[E any] func(x E, z E) []E

type Iterator

type Iterator[E any] interface {
	First()
	Next()
	IsDone() bool
	CurrentItem() E
	ForEach(action Action[E])
}

type List

type List[E any] interface {
	Add(e ...E) List[E]
	AddAll(col List[E]) List[E]
	Clear()
	Contains(e ...E) bool
	DeepEquals(col List[E]) bool
	Equals(col List[E]) bool
	Filter(pred Predicate[E]) List[E]
	ForEach(action Action[E])
	GetHash() string
	IsEmpty() bool
	Iterator() Iterator[E]
	Collect() []E
	Remove(e ...E)
	RemoveIf(pred Predicate[E])
}

func NewArrayList

func NewArrayList[E any](e ...E) List[E]

type ListIterator

type ListIterator[E any] struct {
	// contains filtered or unexported fields
}

func (*ListIterator[E]) CurrentItem

func (i *ListIterator[E]) CurrentItem() E

func (*ListIterator[E]) First

func (i *ListIterator[E]) First()

func (*ListIterator[E]) ForEach

func (i *ListIterator[E]) ForEach(action Action[E])

func (*ListIterator[E]) IsDone

func (i *ListIterator[E]) IsDone() bool

func (*ListIterator[E]) Next

func (i *ListIterator[E]) Next()

type MapperFunc

type MapperFunc[S, T any] func(h S) T

type MultiAction

type MultiAction[E any] func(x E, z E)

type MultiArrayList

type MultiArrayList[S, T any] struct {
	// contains filtered or unexported fields
}

func (*MultiArrayList[S, T]) Add

func (a *MultiArrayList[S, T]) Add(e ...S) MultiList[S, T]

func (*MultiArrayList[S, T]) AddAll

func (a *MultiArrayList[S, T]) AddAll(col List[S]) MultiList[S, T]

func (*MultiArrayList[S, T]) Clear

func (a *MultiArrayList[S, T]) Clear()

func (*MultiArrayList[S, T]) Collect

func (a *MultiArrayList[S, T]) Collect() []S

func (*MultiArrayList[S, T]) Map

func (a *MultiArrayList[S, T]) Map(mapperFunc MapperFunc[S, T]) List[T]

type MultiList

type MultiList[S, T any] interface {
	Add(e ...S) MultiList[S, T]
	AddAll(lst List[S]) MultiList[S, T]
	Clear()
	Collect() []S
	Map(mapperFunc MapperFunc[S, T]) List[T]
}

func NewMultiArrayList

func NewMultiArrayList[S, T any](src ...S) MultiList[S, T]

type Predicate

type Predicate[E any] func(e E) bool

func Equals

func Equals[E any](g E) Predicate[E]

func NotEquals

func NotEquals[E any](g E) Predicate[E]

type Producer

type Producer[E any] func(e E) E

Jump to

Keyboard shortcuts

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