collections

package
v0.0.1-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BidirectionalIterable

type BidirectionalIterable[T any] interface {
	BidIter() iterator.Bidirectional[T]
}

type DeQueue

type DeQueue[T any] interface {
	Queue[T]
	PopBack() T
	PopBackVerify() (T, bool)
	PushFront(T) bool
}

type EnhanceIter

type EnhanceIter[T any] interface {
	EnhanceIter() iterator.Enhance[T]
}

type Iterable

type Iterable[T any] interface {
	Iter() iterator.Forward[T]
	End() iterator.Forward[T]
}

type List

type List[T any] interface {
	Iterable[T]
	EnhanceIter[T]

	PushBack(T) bool
	PushFront(T) bool

	PushBackIter(iterator.Base[T]) bool
	PushFrontIter(iterator.Base[T]) bool

	PushBackAllList(List[T]) int
	PushFrontAllList(List[T]) int
	PushBackAll(...T) int
	PushFrontAll(...T) int

	PopBack() T
	PopFront() T
	PopBackVerify() (T, bool)
	PopFrontVerify() (T, bool)

	Insert(int, T) bool
	InsertIter(int, iterator.Base[T]) bool

	Set(int, T)
	Get(int) T
	GetVerify(int) (T, bool)

	RemoveAtIndex(int) bool
	RemoveEquals(T) bool
	RemoveAllEquals(T) int

	Find(T) int

	Limit(int)

	Size() int
	Clear()
	IsEmpty() bool

	ToSlice() []T
	String() string
	Sort(comparison.OneSided[T])
	ParallelSort(comparison.OneSided[T])
}

type Map

type Map[K, V any] interface {
	Iterable[kv.Entry[K, V]]

	Put(key K, val V) bool
	PutEntry(entry kv.Entry[K, V]) bool
	PutAllPairs(pairs ...kv.Pair[K, V]) int
	PutIter(iter iterator.Base[kv.Entry[K, V]]) bool
	PutAllIter(start, stop iterator.Forward[kv.Entry[K, V]]) int

	ContainsKey(key K) bool
	Get(key K) V
	GetEntry(key K) kv.Entry[K, V]
	GetVerify(key K) (V, bool)
	GetIter(key K) iterator.Forward[kv.Entry[K, V]]

	Delete(key K) bool
	DeleteByWholeMapping(key K, val V, valComp comparison.OneSided[V]) bool
	DeleteByKeys(keys ...K) int
	DeleteEntryByKey(entry kv.Entry[K, V]) bool
	DeleteIterByKey(iter iterator.Base[kv.Entry[K, V]]) bool
	DeleteAllIterByKey(start, stop iterator.Forward[kv.Entry[K, V]]) int

	Size() int
	Clear()
	IsEmpty() bool
	String() string
	KeySlice() []K
	ValueSlice() []V
	EntrySlice() []kv.Entry[K, V]
}

type Queue

type Queue[T any] interface {
	Push(T) bool
	Pop() T
	PopVerify() (T, bool)
	Size() int
	Top() T
	TopVerify() (T, bool)
	IsEmpty() bool
}

type ReverseIterable

type ReverseIterable[T any] interface {
	RIter() iterator.Forward[T]
}

type Set

type Set[T any] interface {
	Iterable[T]
	ReverseIterable[T]
	BidirectionalIterable[T]
	Size() int
	IsEmpty() bool
	Contains(T) bool
	ToSlice() []T
	Add(T) bool
	AddIter(base iterator.Base[T]) bool
	AddAll(...T) int
	AddAllIter(first, end iterator.Forward[T]) int

	Delete(T) bool
	DeleteAll(...T) int
	DeleteAllIter(first, end iterator.Forward[T]) int
	DeleteIter(base iterator.Base[T]) bool
	Clear()
	String() string
}

type Stack

type Stack[T any] interface {
	Push(val T) bool
	Pop() (val T)
	Top() (val T)
	PopVerify() (val T, ok bool)
	TopVerify() (val T, ok bool)
	IsEmpty() bool
}

Directories

Path Synopsis
associative
bplustree
Package bplustree adapt from: https://github.com/orange1438/BTree-and-BPlusTree-Realize
Package bplustree adapt from: https://github.com/orange1438/BTree-and-BPlusTree-Realize
kv
skiplist
Package skiplist : adapt from redis
Package skiplist : adapt from redis
sequence

Jump to

Keyboard shortcuts

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