Documentation ¶
Index ¶
- type DoubleLinkedList
- func (s *DoubleLinkedList[V]) Append(v V)
- func (s *DoubleLinkedList[V]) AppendElem(elem Tuple[int, V])
- func (s *DoubleLinkedList[V]) AsCollection() generics.Collection[int, V, Tuple[int, V]]
- func (s *DoubleLinkedList[V]) AsIterable() generics.Iterable[Tuple[int, V]]
- func (s *DoubleLinkedList[V]) Cap() int
- func (s *DoubleLinkedList[V]) Clear()
- func (s *DoubleLinkedList[V]) Clone() generics.Collection[int, V, Tuple[int, V]]
- func (s *DoubleLinkedList[V]) Delete(index int)
- func (s *DoubleLinkedList[V]) DeleteFirst()
- func (s *DoubleLinkedList[V]) DeleteLast()
- func (s *DoubleLinkedList[V]) Factory() generics.Collection[int, V, Tuple[int, V]]
- func (s *DoubleLinkedList[V]) FactoryFrom(values []V) generics.Collection[int, V, Tuple[int, V]]
- func (s *DoubleLinkedList[V]) First() *DoubleLinkedListNode[V]
- func (s *DoubleLinkedList[V]) Get(index int) V
- func (s *DoubleLinkedList[V]) GetNode(index int) *DoubleLinkedListNode[V]
- func (s *DoubleLinkedList[V]) IsEmpty() bool
- func (s *DoubleLinkedList[V]) Iter() *generics.Iterator[Tuple[int, V]]
- func (s *DoubleLinkedList[V]) IterHandler(iter *generics.Iterator[Tuple[int, V]])
- func (s *DoubleLinkedList[V]) Last() *DoubleLinkedListNode[V]
- func (s *DoubleLinkedList[V]) Len() int
- func (s *DoubleLinkedList[V]) Prepend(v V)
- func (s *DoubleLinkedList[V]) Set(index int, v V)
- func (s *DoubleLinkedList[V]) SetElem(elem Tuple[int, V])
- func (s *DoubleLinkedList[V]) Values() []V
- type DoubleLinkedListNode
- func (n *DoubleLinkedListNode[V]) InsertAfter(list *DoubleLinkedList[V], value V) *DoubleLinkedListNode[V]
- func (n *DoubleLinkedListNode[V]) InsertBefore(list *DoubleLinkedList[V], value V) *DoubleLinkedListNode[V]
- func (n *DoubleLinkedListNode[V]) Next() *DoubleLinkedListNode[V]
- func (n *DoubleLinkedListNode[V]) Prev() *DoubleLinkedListNode[V]
- func (n *DoubleLinkedListNode[V]) Set(value V)
- func (n *DoubleLinkedListNode[V]) Value() V
- type ForwardLinkedList
- func (s *ForwardLinkedList[V]) Append(v V)
- func (s *ForwardLinkedList[V]) AppendElem(elem Tuple[int, V])
- func (s *ForwardLinkedList[V]) AsCollection() generics.Collection[int, V, Tuple[int, V]]
- func (s *ForwardLinkedList[V]) AsIterable() generics.Iterable[Tuple[int, V]]
- func (s *ForwardLinkedList[V]) Cap() int
- func (s *ForwardLinkedList[V]) Clear()
- func (s *ForwardLinkedList[V]) Clone() generics.Collection[int, V, Tuple[int, V]]
- func (s *ForwardLinkedList[V]) Delete(index int)
- func (s *ForwardLinkedList[V]) Factory() generics.Collection[int, V, Tuple[int, V]]
- func (s *ForwardLinkedList[V]) FactoryFrom(values []V) generics.Collection[int, V, Tuple[int, V]]
- func (s *ForwardLinkedList[V]) First() *ForwardLinkedListNode[V]
- func (s *ForwardLinkedList[V]) Get(index int) V
- func (s *ForwardLinkedList[V]) GetNode(index int) *ForwardLinkedListNode[V]
- func (s *ForwardLinkedList[V]) IsEmpty() bool
- func (s *ForwardLinkedList[V]) Iter() *generics.Iterator[Tuple[int, V]]
- func (s *ForwardLinkedList[V]) IterHandler(iter *generics.Iterator[Tuple[int, V]])
- func (s *ForwardLinkedList[V]) Last() *ForwardLinkedListNode[V]
- func (s *ForwardLinkedList[V]) Len() int
- func (s *ForwardLinkedList[V]) Set(index int, v V)
- func (s *ForwardLinkedList[V]) SetElem(elem Tuple[int, V])
- func (s *ForwardLinkedList[V]) Values() []V
- type ForwardLinkedListNode
- type Map
- func (m *Map[K, V]) AppendElem(elem Tuple[K, V])
- func (m *Map[K, V]) AsCollection() generics.Collection[K, V, Tuple[K, V]]
- func (m *Map[K, V]) AsIterable() generics.Iterable[Tuple[K, V]]
- func (m *Map[K, V]) Cap() int
- func (m *Map[K, V]) Clear()
- func (m *Map[K, V]) Clone() generics.Collection[K, V, Tuple[K, V]]
- func (m *Map[K, V]) Delete(key K)
- func (m *Map[K, V]) Factory() generics.Collection[K, V, Tuple[K, V]]
- func (m *Map[K, V]) FactoryFrom(values []V) generics.Collection[K, V, Tuple[K, V]]
- func (m *Map[K, V]) Get(key K) V
- func (m *Map[K, V]) GetE(key K) (V, bool)
- func (m *Map[K, V]) HasKey(key K) bool
- func (m *Map[K, V]) IsEmpty() bool
- func (m *Map[K, V]) Iter() *generics.Iterator[Tuple[K, V]]
- func (m *Map[K, V]) IterHandler(iter *generics.Iterator[Tuple[K, V]])
- func (m *Map[K, V]) Keys() []K
- func (m *Map[K, V]) Len() int
- func (m *Map[K, V]) Set(key K, val V)
- func (m *Map[K, V]) SetElem(elem Tuple[K, V])
- func (m *Map[K, V]) Values() []V
- type Slice
- func (s *Slice[V]) Append(item V)
- func (s *Slice[V]) AppendElem(elem Tuple[int, V])
- func (s *Slice[V]) AppendSafeSlice(other *Slice[V])
- func (s *Slice[V]) AppendSlice(slice []V)
- func (s *Slice[V]) AsCollection() generics.Collection[int, V, Tuple[int, V]]
- func (s *Slice[V]) AsIterable() generics.Iterable[Tuple[int, V]]
- func (s *Slice[V]) Cap() int
- func (s *Slice[V]) Clear()
- func (s *Slice[V]) Clone() generics.Collection[int, V, Tuple[int, V]]
- func (s *Slice[V]) Compare(i, j Tuple[int, V], comp func(V, V) generics.CompareResult) generics.CompareResult
- func (s *Slice[V]) Delete(i int)
- func (s *Slice[V]) Factory() generics.Collection[int, V, Tuple[int, V]]
- func (s *Slice[V]) FactoryFrom(values []V) generics.Collection[int, V, Tuple[int, V]]
- func (s *Slice[V]) Get(i int) V
- func (s *Slice[V]) IsEmpty() bool
- func (s *Slice[V]) Iter() *generics.Iterator[Tuple[int, V]]
- func (s *Slice[V]) IterHandler(iter *generics.Iterator[Tuple[int, V]])
- func (s *Slice[V]) Len() int
- func (s *Slice[V]) Set(i int, item V)
- func (s *Slice[V]) SetElem(item Tuple[int, V])
- func (s *Slice[V]) Slice(start, end int) *Slice[V]
- func (s *Slice[V]) Values() []V
- type Tuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DoubleLinkedList ¶ added in v0.0.15
type DoubleLinkedList[V any] struct { // contains filtered or unexported fields }
func CollectionAsDoubleLinkedList ¶ added in v0.0.15
func CollectionAsDoubleLinkedList[V any](c generics.Collection[int, V, Tuple[int, V]]) *DoubleLinkedList[V]
func NewDoubleLinkedList ¶ added in v0.0.15
func NewDoubleLinkedList[V any](values ...V) *DoubleLinkedList[V]
func (*DoubleLinkedList[V]) Append ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Append(v V)
Append adds a new node to the end of the list.
func (*DoubleLinkedList[V]) AppendElem ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) AppendElem(elem Tuple[int, V])
func (*DoubleLinkedList[V]) AsCollection ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) AsCollection() generics.Collection[int, V, Tuple[int, V]]
func (*DoubleLinkedList[V]) AsIterable ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) AsIterable() generics.Iterable[Tuple[int, V]]
func (*DoubleLinkedList[V]) Cap ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Cap() int
func (*DoubleLinkedList[V]) Clear ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Clear()
func (*DoubleLinkedList[V]) Clone ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Clone() generics.Collection[int, V, Tuple[int, V]]
func (*DoubleLinkedList[V]) Delete ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Delete(index int)
Delete removes the node at the given index.
func (*DoubleLinkedList[V]) DeleteFirst ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) DeleteFirst()
DeleteFirst removes the first node.
func (*DoubleLinkedList[V]) DeleteLast ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) DeleteLast()
DeleteLast removes the last node.
func (*DoubleLinkedList[V]) Factory ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Factory() generics.Collection[int, V, Tuple[int, V]]
func (*DoubleLinkedList[V]) FactoryFrom ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) FactoryFrom(values []V) generics.Collection[int, V, Tuple[int, V]]
func (*DoubleLinkedList[V]) First ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) First() *DoubleLinkedListNode[V]
func (*DoubleLinkedList[V]) Get ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Get(index int) V
Get returns the value at the given index.
func (*DoubleLinkedList[V]) GetNode ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) GetNode(index int) *DoubleLinkedListNode[V]
GetNode returns the node at the given index.
func (*DoubleLinkedList[V]) IsEmpty ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) IsEmpty() bool
func (*DoubleLinkedList[V]) Iter ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Iter() *generics.Iterator[Tuple[int, V]]
func (*DoubleLinkedList[V]) IterHandler ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) IterHandler(iter *generics.Iterator[Tuple[int, V]])
func (*DoubleLinkedList[V]) Last ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Last() *DoubleLinkedListNode[V]
func (*DoubleLinkedList[V]) Len ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Len() int
func (*DoubleLinkedList[V]) Prepend ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Prepend(v V)
Prepend adds a new node to the beginning of the list.
func (*DoubleLinkedList[V]) Set ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Set(index int, v V)
func (*DoubleLinkedList[V]) SetElem ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) SetElem(elem Tuple[int, V])
func (*DoubleLinkedList[V]) Values ¶ added in v0.0.15
func (s *DoubleLinkedList[V]) Values() []V
type DoubleLinkedListNode ¶ added in v0.0.15
type DoubleLinkedListNode[V any] struct { // contains filtered or unexported fields }
func (*DoubleLinkedListNode[V]) InsertAfter ¶ added in v0.0.15
func (n *DoubleLinkedListNode[V]) InsertAfter(list *DoubleLinkedList[V], value V) *DoubleLinkedListNode[V]
InsertAfter inserts a new node after the current node.
func (*DoubleLinkedListNode[V]) InsertBefore ¶ added in v0.0.15
func (n *DoubleLinkedListNode[V]) InsertBefore(list *DoubleLinkedList[V], value V) *DoubleLinkedListNode[V]
InsertBefore inserts a new node before the current node.
func (*DoubleLinkedListNode[V]) Next ¶ added in v0.0.15
func (n *DoubleLinkedListNode[V]) Next() *DoubleLinkedListNode[V]
Next returns the next node.
func (*DoubleLinkedListNode[V]) Prev ¶ added in v0.0.15
func (n *DoubleLinkedListNode[V]) Prev() *DoubleLinkedListNode[V]
Prev returns the previous node.
func (*DoubleLinkedListNode[V]) Set ¶ added in v0.0.15
func (n *DoubleLinkedListNode[V]) Set(value V)
Set sets the value of the node.
func (*DoubleLinkedListNode[V]) Value ¶ added in v0.0.15
func (n *DoubleLinkedListNode[V]) Value() V
Value returns the value of the node.
type ForwardLinkedList ¶ added in v0.0.12
type ForwardLinkedList[V any] struct { // contains filtered or unexported fields }
func CollectionAsForwardLinkedList ¶ added in v0.0.12
func CollectionAsForwardLinkedList[V any](c generics.Collection[int, V, Tuple[int, V]]) *ForwardLinkedList[V]
func NewForwardLinkedList ¶ added in v0.0.12
func NewForwardLinkedList[V any](values ...V) *ForwardLinkedList[V]
func (*ForwardLinkedList[V]) Append ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Append(v V)
Append adds a new node to the end of the list.
func (*ForwardLinkedList[V]) AppendElem ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) AppendElem(elem Tuple[int, V])
func (*ForwardLinkedList[V]) AsCollection ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) AsCollection() generics.Collection[int, V, Tuple[int, V]]
func (*ForwardLinkedList[V]) AsIterable ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) AsIterable() generics.Iterable[Tuple[int, V]]
func (*ForwardLinkedList[V]) Cap ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Cap() int
func (*ForwardLinkedList[V]) Clear ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Clear()
func (*ForwardLinkedList[V]) Clone ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Clone() generics.Collection[int, V, Tuple[int, V]]
func (*ForwardLinkedList[V]) Delete ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Delete(index int)
func (*ForwardLinkedList[V]) Factory ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Factory() generics.Collection[int, V, Tuple[int, V]]
func (*ForwardLinkedList[V]) FactoryFrom ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) FactoryFrom(values []V) generics.Collection[int, V, Tuple[int, V]]
func (*ForwardLinkedList[V]) First ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) First() *ForwardLinkedListNode[V]
func (*ForwardLinkedList[V]) Get ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Get(index int) V
Get returns the value at the given index.
func (*ForwardLinkedList[V]) GetNode ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) GetNode(index int) *ForwardLinkedListNode[V]
GetNode returns the node at the given index.
func (*ForwardLinkedList[V]) IsEmpty ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) IsEmpty() bool
func (*ForwardLinkedList[V]) Iter ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Iter() *generics.Iterator[Tuple[int, V]]
func (*ForwardLinkedList[V]) IterHandler ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) IterHandler(iter *generics.Iterator[Tuple[int, V]])
func (*ForwardLinkedList[V]) Last ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Last() *ForwardLinkedListNode[V]
func (*ForwardLinkedList[V]) Len ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Len() int
func (*ForwardLinkedList[V]) Set ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Set(index int, v V)
func (*ForwardLinkedList[V]) SetElem ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) SetElem(elem Tuple[int, V])
func (*ForwardLinkedList[V]) Values ¶ added in v0.0.12
func (s *ForwardLinkedList[V]) Values() []V
type ForwardLinkedListNode ¶ added in v0.0.12
type ForwardLinkedListNode[V any] struct { // contains filtered or unexported fields }
func (*ForwardLinkedListNode[V]) InsertAfter ¶ added in v0.0.12
func (n *ForwardLinkedListNode[V]) InsertAfter(list *ForwardLinkedList[V], value V) *ForwardLinkedListNode[V]
InsertAfter inserts a new node after the current node.
func (*ForwardLinkedListNode[V]) Next ¶ added in v0.0.12
func (n *ForwardLinkedListNode[V]) Next() *ForwardLinkedListNode[V]
Next returns the next node.
func (*ForwardLinkedListNode[V]) Set ¶ added in v0.0.12
func (n *ForwardLinkedListNode[V]) Set(value V)
Set sets the value of the node.
func (*ForwardLinkedListNode[V]) Value ¶ added in v0.0.12
func (n *ForwardLinkedListNode[V]) Value() V
Value returns the value of the node.
type Map ¶ added in v0.0.13
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
Map is a generic container for map.
func CollectionAsMap ¶ added in v0.0.13
func CollectionAsMap[K comparable, V any](c generics.Collection[K, V, Tuple[K, V]]) *Map[K, V]
func NewMap ¶ added in v0.0.13
func NewMap[K comparable, V any](items ...Tuple[K, V]) *Map[K, V]
NewMap creates a new Map.
func (*Map[K, V]) AppendElem ¶ added in v0.0.13
AppendElem appends an element to the map.
func (*Map[K, V]) AsCollection ¶ added in v0.0.13
func (m *Map[K, V]) AsCollection() generics.Collection[K, V, Tuple[K, V]]
func (*Map[K, V]) AsIterable ¶ added in v0.0.13
func (*Map[K, V]) Cap ¶ added in v0.0.13
Cap returns the capacity of the map, which is equal to the length.
func (*Map[K, V]) Clone ¶ added in v0.0.13
func (m *Map[K, V]) Clone() generics.Collection[K, V, Tuple[K, V]]
Clone returns a copy of the map.
func (*Map[K, V]) Delete ¶ added in v0.0.13
func (m *Map[K, V]) Delete(key K)
Delete deletes a value from the map.
func (*Map[K, V]) Factory ¶ added in v0.0.13
func (m *Map[K, V]) Factory() generics.Collection[K, V, Tuple[K, V]]
Factory returns a new instance of the map.
func (*Map[K, V]) FactoryFrom ¶ added in v0.0.13
func (m *Map[K, V]) FactoryFrom(values []V) generics.Collection[K, V, Tuple[K, V]]
func (*Map[K, V]) Get ¶ added in v0.0.13
func (m *Map[K, V]) Get(key K) V
Get gets a value from the map. Panics if the key does not exist.
func (*Map[K, V]) IterHandler ¶ added in v0.0.13
func (*Map[K, V]) Keys ¶ added in v0.0.13
func (m *Map[K, V]) Keys() []K
Keys returns all keys in the map.
func (*Map[K, V]) Set ¶ added in v0.0.13
func (m *Map[K, V]) Set(key K, val V)
Set sets a value in the map.
type Slice ¶ added in v0.0.13
type Slice[V any] struct { // contains filtered or unexported fields }
Slice is a generic slice.
It doesn't check out of bounds access.
func CollectionAsSlice ¶ added in v0.0.13
func (*Slice[V]) Append ¶ added in v0.0.13
func (s *Slice[V]) Append(item V)
Append appends a value to the slice.
func (*Slice[V]) AppendElem ¶ added in v0.0.13
AppendElem appends a value to the slice.
func (*Slice[V]) AppendSafeSlice ¶ added in v0.0.13
AppendSafeSlice appends a Slice to the slice.
func (*Slice[V]) AppendSlice ¶ added in v0.0.13
func (s *Slice[V]) AppendSlice(slice []V)
AppendSlice appends a slice to the slice.
func (*Slice[V]) AsCollection ¶ added in v0.0.13
func (*Slice[V]) AsIterable ¶ added in v0.0.13
func (*Slice[V]) Compare ¶ added in v0.0.13
func (s *Slice[V]) Compare(i, j Tuple[int, V], comp func(V, V) generics.CompareResult) generics.CompareResult
Compare compares two slice items.