lists

package
v0.0.0-...-f59b33f Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinkedList

type LinkedList[E any] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

LinkedList linked list

func NewLinkedList

func NewLinkedList[E any](values ...E) *LinkedList[E]

NewLinkedList new linked list

func (*LinkedList[E]) Chunk

func (list *LinkedList[E]) Chunk(size int) *LinkedList[*LinkedList[any]]

func (*LinkedList[E]) Clear

func (list *LinkedList[E]) Clear()

func (*LinkedList[E]) Clone

func (list *LinkedList[E]) Clone() *LinkedList[E]

func (*LinkedList[E]) Compact

func (list *LinkedList[E]) Compact(callback func(a, b E) bool)

func (*LinkedList[E]) Contains

func (list *LinkedList[E]) Contains(value E) bool

func (*LinkedList[E]) ContainsWhere

func (list *LinkedList[E]) ContainsWhere(callback func(value E) bool) bool

func (*LinkedList[E]) Count

func (list *LinkedList[E]) Count() int64

func (*LinkedList[E]) Each

func (list *LinkedList[E]) Each(callback func(index int, value E) bool)

func (*LinkedList[E]) First

func (list *LinkedList[E]) First() (E, bool)

func (*LinkedList[E]) FirstOr

func (list *LinkedList[E]) FirstOr(value E) E

func (*LinkedList[E]) FirstWhere

func (list *LinkedList[E]) FirstWhere(callback func(item E) bool) (E, bool)

func (*LinkedList[E]) FirstWhereOr

func (list *LinkedList[E]) FirstWhereOr(callback func(item E) bool, value E) E

func (*LinkedList[E]) Get

func (list *LinkedList[E]) Get(index int) E

func (*LinkedList[E]) IndexOf

func (list *LinkedList[E]) IndexOf(value E) int

func (*LinkedList[E]) IndexOfWhere

func (list *LinkedList[E]) IndexOfWhere(callback func(item E) bool) int

func (*LinkedList[E]) IsEmpty

func (list *LinkedList[E]) IsEmpty() bool

func (*LinkedList[E]) IsNotEmpty

func (list *LinkedList[E]) IsNotEmpty() bool

func (*LinkedList[E]) Last

func (list *LinkedList[E]) Last() (E, bool)

func (*LinkedList[E]) LastOr

func (list *LinkedList[E]) LastOr(value E) E

func (*LinkedList[E]) LastWhere

func (list *LinkedList[E]) LastWhere(callback func(item E) bool) (E, bool)

func (*LinkedList[E]) LastWhereOr

func (list *LinkedList[E]) LastWhereOr(callback func(item E) bool, value E) E

func (*LinkedList[E]) MarshalJSON

func (list *LinkedList[E]) MarshalJSON() ([]byte, error)

func (*LinkedList[E]) Max

func (list *LinkedList[E]) Max(callback func(a, b E) int) E

func (*LinkedList[E]) Min

func (list *LinkedList[E]) Min(callback func(a, b E) int) E

func (*LinkedList[E]) Pop

func (list *LinkedList[E]) Pop() (E, bool)

func (*LinkedList[E]) Push

func (list *LinkedList[E]) Push(values ...E)

func (*LinkedList[E]) Remove

func (list *LinkedList[E]) Remove(value E)

func (*LinkedList[E]) RemoveAt

func (list *LinkedList[E]) RemoveAt(index int)

func (*LinkedList[E]) RemoveWhere

func (list *LinkedList[E]) RemoveWhere(callback func(item E) bool)

func (*LinkedList[E]) Reverse

func (list *LinkedList[E]) Reverse()

func (*LinkedList[E]) Set

func (list *LinkedList[E]) Set(index int, value E)

func (*LinkedList[E]) Shift

func (list *LinkedList[E]) Shift() (E, bool)

func (*LinkedList[E]) Sort

func (list *LinkedList[E]) Sort(callback func(a, b E) int)

func (*LinkedList[E]) String

func (list *LinkedList[E]) String() string

func (*LinkedList[E]) Sub

func (list *LinkedList[E]) Sub(from, to int) *LinkedList[E]

func (*LinkedList[E]) ToArray

func (list *LinkedList[E]) ToArray() []E

func (*LinkedList[E]) ToJSON

func (list *LinkedList[E]) ToJSON() ([]byte, error)

func (*LinkedList[E]) UnmarshalJSON

func (list *LinkedList[E]) UnmarshalJSON(data []byte) error

func (*LinkedList[E]) Unshift

func (list *LinkedList[E]) Unshift(values ...E)

func (*LinkedList[E]) Where

func (list *LinkedList[E]) Where(callback func(item E) bool) *LinkedList[E]

type List

type List[E any] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

List list

func NewList

func NewList[E any](values ...E) *List[E]

NewList new list

func (*List[E]) Chunk

func (list *List[E]) Chunk(size int) *List[*List[any]]

func (*List[E]) Clear

func (list *List[E]) Clear()

func (*List[E]) Clone

func (list *List[E]) Clone() *List[E]

func (*List[E]) Compact

func (list *List[E]) Compact(callback func(a, b E) bool)

func (*List[E]) Contains

func (list *List[E]) Contains(value E) bool

func (*List[E]) ContainsWhere

func (list *List[E]) ContainsWhere(callback func(value E) bool) bool

func (*List[E]) Count

func (list *List[E]) Count() int64

func (*List[E]) Each

func (list *List[E]) Each(callback func(index int, value E) bool)

func (*List[E]) First

func (list *List[E]) First() (E, bool)

func (*List[E]) FirstOr

func (list *List[E]) FirstOr(value E) E

func (*List[E]) FirstWhere

func (list *List[E]) FirstWhere(callback func(item E) bool) (E, bool)

func (*List[E]) FirstWhereOr

func (list *List[E]) FirstWhereOr(callback func(item E) bool, value E) E

func (*List[E]) Get

func (list *List[E]) Get(index int) E

func (*List[E]) IndexOf

func (list *List[E]) IndexOf(value E) int

func (*List[E]) IndexOfWhere

func (list *List[E]) IndexOfWhere(callback func(item E) bool) int

func (*List[E]) IsEmpty

func (list *List[E]) IsEmpty() bool

func (*List[E]) IsNotEmpty

func (list *List[E]) IsNotEmpty() bool

func (*List[E]) Last

func (list *List[E]) Last() (E, bool)

func (*List[E]) LastOr

func (list *List[E]) LastOr(value E) E

func (*List[E]) LastWhere

func (list *List[E]) LastWhere(callback func(item E) bool) (E, bool)

func (*List[E]) LastWhereOr

func (list *List[E]) LastWhereOr(callback func(item E) bool, value E) E

func (*List[E]) MarshalJSON

func (list *List[E]) MarshalJSON() ([]byte, error)

func (*List[E]) Max

func (list *List[E]) Max(callback func(a, b E) int) E

func (*List[E]) Min

func (list *List[E]) Min(callback func(a, b E) int) E

func (*List[E]) Pop

func (list *List[E]) Pop() (E, bool)

func (*List[E]) Push

func (list *List[E]) Push(values ...E)

func (*List[E]) Remove

func (list *List[E]) Remove(value E)

func (*List[E]) RemoveAt

func (list *List[E]) RemoveAt(index int)

func (*List[E]) RemoveWhere

func (list *List[E]) RemoveWhere(callback func(item E) bool)

func (*List[E]) Reverse

func (list *List[E]) Reverse()

func (*List[E]) Set

func (list *List[E]) Set(index int, value E)

func (*List[E]) Shift

func (list *List[E]) Shift() (E, bool)

func (*List[E]) Sort

func (list *List[E]) Sort(callback func(a, b E) int)

func (*List[E]) String

func (list *List[E]) String() string

func (*List[E]) Sub

func (list *List[E]) Sub(from, to int) *List[E]

func (*List[E]) ToArray

func (list *List[E]) ToArray() []E

func (*List[E]) ToJSON

func (list *List[E]) ToJSON() ([]byte, error)

func (*List[E]) UnmarshalJSON

func (list *List[E]) UnmarshalJSON(data []byte) error

func (*List[E]) Unshift

func (list *List[E]) Unshift(values ...E)

func (*List[E]) Where

func (list *List[E]) Where(callback func(item E) bool) *List[E]

Jump to

Keyboard shortcuts

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