Documentation ¶
Index ¶
- func CopyMap(m *map[any]bool) *map[any]bool
- func GroupBy[T any, R comparable, M ~map[R]List[T]](col Iterable[T], groupFunc func(item1 T) R) M
- type Cloneable
- type Hashset
- func (this *Hashset[K]) Add(item K)
- func (this *Hashset[K]) Clear()
- func (this *Hashset[K]) Clone() *Hashset[K]
- func (this *Hashset[K]) Contains(key K) bool
- func (this *Hashset[K]) ExceptWith(other *[]K)
- func (this *Hashset[K]) ExceptWithHS(other *Hashset[K])
- func (this *Hashset[K]) GetSeq() iter.Seq[K]
- func (this *Hashset[K]) IntersectWith(other *[]K)
- func (this *Hashset[K]) IntersectWithHS(other *Hashset[K])
- func (this *Hashset[K]) Remove(item K)
- func (this *Hashset[K]) Size() int
- func (this *Hashset[K]) ToList() List[K]
- func (this *Hashset[K]) UnionWith(other *[]K)
- func (this *Hashset[K]) UnionWithHS(other *Hashset[K])
- type InternalList
- type Iterable
- type LinkedList
- func (this *LinkedList[T]) AddAfter(item T, after *LinkedListNode[T]) *LinkedListNode[T]
- func (this *LinkedList[T]) AddBefore(item T, before *LinkedListNode[T]) *LinkedListNode[T]
- func (this *LinkedList[T]) AddFirst(item T) *LinkedListNode[T]
- func (this *LinkedList[T]) AddLast(item T) *LinkedListNode[T]
- func (this *LinkedList[T]) Clone() *LinkedList[T]
- func (this *LinkedList[T]) Find(chk func(a T) bool) *LinkedListNode[T]
- func (this *LinkedList[T]) First() *LinkedListNode[T]
- func (this *LinkedList[K]) GetSeq() iter.Seq[K]
- func (this *LinkedList[T]) Last() *LinkedListNode[T]
- func (this *LinkedList[T]) Remove(eq func(a T, b T) bool, value T)
- func (this *LinkedList[T]) RemoveFirst()
- func (this *LinkedList[T]) RemoveLast()
- func (this *LinkedList[T]) RemoveNode(node *LinkedListNode[T])
- func (this *LinkedList[T]) Size() int
- type LinkedListNode
- type List
- func (list List[T]) Add(item T)
- func (list List[T]) AddRange(items []T)
- func (list List[T]) AddSeq(seq iter.Seq[T])
- func (list List[T]) All(f func(item1 T) bool) bool
- func (list List[T]) Any(cmpfunc func(item1 T) bool) bool
- func (list List[T]) Clear()
- func (list *List[T]) Clone() *List[T]
- func (list List[T]) First() T
- func (list List[T]) ForEach(f func(item T))
- func (list List[T]) ForEachIndexed(f func(item T, index int))
- func (list List[T]) Get(index int) T
- func (list List[T]) GetRange(index int, count int) List[T]
- func (list *List[T]) GetSeq() iter.Seq[T]
- func (list *List[T]) GetSeq2() iter.Seq2[T, int]
- func (list List[T]) IndexOf(f func(item T) bool) int
- func (list List[T]) IndexOfInRange(f func(item T) bool, startIndex int, endIndex int) int
- func (list List[T]) Insert(item T, index int)
- func (list List[T]) Last() T
- func (list *List[T]) Max(cmpfunc func(item1 T, item2 T) int) *T
- func (list *List[T]) Min(cmpfunc func(item1 T, item2 T) int) *T
- func (list List[T]) RemoveAt(index int)
- func (list List[T]) RemoveRange(index int, count int)
- func (list List[T]) Set(index int, value T)
- func (list List[T]) Size() int
- func (list List[T]) Sort(cmpfunc func(item1 T, item2 T) int)
- func (list List[T]) ToSlice() []T
- type Queue
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hashset ¶
type Hashset[K any] struct { // contains filtered or unexported fields }
func NewHashset ¶
func NewHashsetFromIterable ¶
func NewHashsetFromSlice ¶
func (*Hashset[K]) ExceptWith ¶
func (this *Hashset[K]) ExceptWith(other *[]K)
func (*Hashset[K]) ExceptWithHS ¶
func (*Hashset[K]) IntersectWith ¶
func (this *Hashset[K]) IntersectWith(other *[]K)
func (*Hashset[K]) IntersectWithHS ¶
func (*Hashset[K]) UnionWithHS ¶
type InternalList ¶
type InternalList[T any] struct { // contains filtered or unexported fields }
InternalList Internal structure. Do not use in your code directly.
type LinkedList ¶
type LinkedList[T any] struct { // contains filtered or unexported fields }
func NewLinkedList ¶
func NewLinkedList[T any]() *LinkedList[T]
func NewLinkedListFromIterable ¶
func NewLinkedListFromIterable[T any](items Iterable[T]) *LinkedList[T]
func NewLinkedListFromSlice ¶
func NewLinkedListFromSlice[T any](items *[]T) *LinkedList[T]
func (*LinkedList[T]) AddAfter ¶
func (this *LinkedList[T]) AddAfter(item T, after *LinkedListNode[T]) *LinkedListNode[T]
func (*LinkedList[T]) AddBefore ¶
func (this *LinkedList[T]) AddBefore(item T, before *LinkedListNode[T]) *LinkedListNode[T]
func (*LinkedList[T]) AddFirst ¶
func (this *LinkedList[T]) AddFirst(item T) *LinkedListNode[T]
func (*LinkedList[T]) AddLast ¶
func (this *LinkedList[T]) AddLast(item T) *LinkedListNode[T]
func (*LinkedList[T]) Clone ¶
func (this *LinkedList[T]) Clone() *LinkedList[T]
func (*LinkedList[T]) Find ¶
func (this *LinkedList[T]) Find(chk func(a T) bool) *LinkedListNode[T]
func (*LinkedList[T]) First ¶
func (this *LinkedList[T]) First() *LinkedListNode[T]
func (*LinkedList[K]) GetSeq ¶
func (this *LinkedList[K]) GetSeq() iter.Seq[K]
func (*LinkedList[T]) Last ¶
func (this *LinkedList[T]) Last() *LinkedListNode[T]
func (*LinkedList[T]) Remove ¶
func (this *LinkedList[T]) Remove(eq func(a T, b T) bool, value T)
func (*LinkedList[T]) RemoveFirst ¶
func (this *LinkedList[T]) RemoveFirst()
func (*LinkedList[T]) RemoveLast ¶
func (this *LinkedList[T]) RemoveLast()
func (*LinkedList[T]) RemoveNode ¶
func (this *LinkedList[T]) RemoveNode(node *LinkedListNode[T])
func (*LinkedList[T]) Size ¶
func (this *LinkedList[T]) Size() int
type LinkedListNode ¶
type LinkedListNode[T any] struct { // contains filtered or unexported fields }
func (*LinkedListNode[T]) GetBefore ¶
func (this *LinkedListNode[T]) GetBefore() *LinkedListNode[T]
func (*LinkedListNode[T]) GetNext ¶
func (this *LinkedListNode[T]) GetNext() *LinkedListNode[T]
func (*LinkedListNode[T]) GetValue ¶
func (this *LinkedListNode[T]) GetValue() T
type List ¶
type List[T any] struct { // contains filtered or unexported fields }
List is a wrapper, that provides number of common methods.
func NewListFromIterable ¶
func NewListFromSlice ¶
func (List[T]) AddRange ¶
func (list List[T]) AddRange(items []T)
AddRange adds slice of items to the list
func (List[T]) All ¶
All iterates all elements of the list and checks if it satisfies condition specified in the function f
func (List[T]) Any ¶
Any iterates all elements of the list and invokes a function until that function returns True for any element, then Any returns true, otherwise it returns False
func (List[T]) ForEach ¶
func (list List[T]) ForEach(f func(item T))
ForEach iterates all elements of the list and invokes specified function f for each element in the list.
func (List[T]) ForEachIndexed ¶
ForEachIndexed iterates all elements of the list and invokes specified function f for each element in the list.
func (List[T]) IndexOfInRange ¶
IndexOfInRange finds first occurrence of an element in the list in specified index range
func (List[T]) RemoveRange ¶
RemoveRange removes specified number of elements in the list starting from index.
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
func NewQueueFromIterable ¶
func NewQueueFromSlice ¶
type Stack ¶
type Stack[T any] struct { // contains filtered or unexported fields }