list

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: BSD-3-Clause Imports: 9 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equals

func Equals(a, b types.IterableContainer) bool

func Hash

func Hash(a types.ListIterable) int

func Less

func Less(a, b types.IterableContainer) bool

func NewSortable

func NewSortable(list *List) sort.Interface

Types

type List

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

func Fixed

func Fixed(size int) *List

Creates a Fixed Size list.

func FromSlice

func FromSlice(list []types.Hashable) *List

func New

func New(initialSize int) *List

Creates a list.

func (*List) Append

func (l *List) Append(item types.Hashable) error

func (*List) Clear

func (l *List) Clear()

func (*List) Copy

func (l *List) Copy() *List

func (*List) Empty

func (l *List) Empty() bool

func (*List) Equals

func (l *List) Equals(b types.Equatable) bool

func (*List) Extend

func (l *List) Extend(it types.KIterator) (err error)

func (*List) Full

func (l *List) Full() bool

func (*List) Get

func (l *List) Get(i int) (item types.Hashable, err error)

func (*List) Has

func (l *List) Has(item types.Hashable) (has bool)

func (*List) Hash

func (l *List) Hash() int

func (*List) Insert

func (l *List) Insert(i int, item types.Hashable) error

func (*List) Items

func (l *List) Items() (it types.KIterator)

func (*List) ItemsInReverse

func (l *List) ItemsInReverse() (it types.KIterator)

func (*List) Less

func (l *List) Less(b types.Sortable) bool

func (*List) Pop

func (l *List) Pop() (item types.Hashable, err error)

func (*List) Push

func (l *List) Push(item types.Hashable) error

func (*List) Remove

func (l *List) Remove(i int) error

func (*List) Set

func (l *List) Set(i int, item types.Hashable) (err error)

func (*List) Size

func (l *List) Size() int

func (*List) String

func (l *List) String() string

type MList

type MList struct {
	List
	MarshalItem   types.ItemMarshal
	UnmarshalItem types.ItemUnmarshal
}

func NewMList

func NewMList(list *List, marshal types.ItemMarshal, unmarshal types.ItemUnmarshal) *MList

func (*MList) MarshalBinary

func (m *MList) MarshalBinary() ([]byte, error)

func (*MList) UnmarshalBinary

func (m *MList) UnmarshalBinary(bytes []byte) error

type MSorted

type MSorted struct {
	MList
	AllowDups bool
}

func NewMSorted

func NewMSorted(s *Sorted, marshal types.ItemMarshal, unmarshal types.ItemUnmarshal) *MSorted

func (*MSorted) MarshalBinary

func (m *MSorted) MarshalBinary() ([]byte, error)

func (*MSorted) Sorted

func (m *MSorted) Sorted() *Sorted

func (*MSorted) UnmarshalBinary

func (m *MSorted) UnmarshalBinary(bytes []byte) error

type Sortable

type Sortable struct {
	List
}

func (*Sortable) Len

func (s *Sortable) Len() int

func (*Sortable) Less

func (s *Sortable) Less(i, j int) bool

func (*Sortable) Swap

func (s *Sortable) Swap(i, j int)

type Sorted

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

func NewFixedSorted

func NewFixedSorted(size int, allowDups bool) *Sorted

Creates a fixed size sorted list.

func NewSorted

func NewSorted(initialSize int, allowDups bool) *Sorted

Creates a sorted list.

func SortedFromSlice

func SortedFromSlice(items []types.Hashable, allowDups bool) *Sorted

func (*Sorted) Add

func (s *Sorted) Add(item types.Hashable) (err error)

func (*Sorted) Clear

func (s *Sorted) Clear()

func (*Sorted) Copy

func (s *Sorted) Copy() *Sorted

func (*Sorted) Delete

func (s *Sorted) Delete(item types.Hashable) (err error)

func (*Sorted) Empty

func (s *Sorted) Empty() bool

func (*Sorted) Equals

func (s *Sorted) Equals(b types.Equatable) bool

func (*Sorted) Extend

func (s *Sorted) Extend(other types.KIterator) (err error)

func (*Sorted) Find

func (s *Sorted) Find(item types.Hashable) (int, bool, error)

func (*Sorted) Full

func (s *Sorted) Full() bool

func (*Sorted) Get

func (s *Sorted) Get(i int) (item types.Hashable, err error)

func (*Sorted) Has

func (s *Sorted) Has(item types.Hashable) (has bool)

func (*Sorted) Hash

func (s *Sorted) Hash() int

func (*Sorted) Item

func (s *Sorted) Item(item types.Hashable) (types.Hashable, error)

func (*Sorted) Items

func (s *Sorted) Items() (it types.KIterator)

func (*Sorted) ItemsInReverse

func (s *Sorted) ItemsInReverse() (it types.KIterator)

func (*Sorted) Less

func (s *Sorted) Less(b types.Sortable) bool

func (*Sorted) Remove

func (s *Sorted) Remove(i int) (err error)

func (*Sorted) Size

func (s *Sorted) Size() int

func (*Sorted) String

func (s *Sorted) String() string

Jump to

Keyboard shortcuts

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