Documentation ¶
Index ¶
- 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 SafeMap
- func (m *SafeMap[K, V]) AppendElem(elem Tuple[K, V])
- func (m *SafeMap[K, V]) AsCollection() generics.Collection[K, V, Tuple[K, V]]
- func (m *SafeMap[K, V]) AsIterable() generics.Iterable[Tuple[K, V]]
- func (m *SafeMap[K, V]) Cap() int
- func (m *SafeMap[K, V]) Clear()
- func (m *SafeMap[K, V]) Clone() generics.Collection[K, V, Tuple[K, V]]
- func (m *SafeMap[K, V]) Delete(key K)
- func (m *SafeMap[K, V]) Factory() generics.Collection[K, V, Tuple[K, V]]
- func (m *SafeMap[K, V]) FactoryFrom(values []V) generics.Collection[K, V, Tuple[K, V]]
- func (m *SafeMap[K, V]) Get(key K) V
- func (m *SafeMap[K, V]) GetE(key K) (V, bool)
- func (m *SafeMap[K, V]) HasKey(key K) bool
- func (m *SafeMap[K, V]) IsEmpty() bool
- func (m *SafeMap[K, V]) Iter() *generics.Iterator[Tuple[K, V]]
- func (m *SafeMap[K, V]) IterHandler(iter *generics.Iterator[Tuple[K, V]])
- func (m *SafeMap[K, V]) Keys() []K
- func (m *SafeMap[K, V]) Len() int
- func (m *SafeMap[K, V]) Set(key K, val V)
- func (m *SafeMap[K, V]) SetElem(elem Tuple[K, V])
- func (m *SafeMap[K, V]) Values() []V
- type SafeSlice
- func (s *SafeSlice[V]) Append(item V)
- func (s *SafeSlice[V]) AppendElem(elem Tuple[int, V])
- func (s *SafeSlice[V]) AppendSafeSlice(other *SafeSlice[V])
- func (s *SafeSlice[V]) AppendSlice(slice []V)
- func (s *SafeSlice[V]) AsCollection() generics.Collection[int, V, Tuple[int, V]]
- func (s *SafeSlice[V]) AsIterable() generics.Iterable[Tuple[int, V]]
- func (s *SafeSlice[V]) Cap() int
- func (s *SafeSlice[V]) Clear()
- func (s *SafeSlice[V]) Clone() generics.Collection[int, V, Tuple[int, V]]
- func (s *SafeSlice[V]) Compare(i, j Tuple[int, V], comp func(V, V) generics.CompareResult) generics.CompareResult
- func (s *SafeSlice[V]) Delete(i int)
- func (s *SafeSlice[V]) Factory() generics.Collection[int, V, Tuple[int, V]]
- func (s *SafeSlice[V]) FactoryFrom(values []V) generics.Collection[int, V, Tuple[int, V]]
- func (s *SafeSlice[V]) Get(i int) V
- func (s *SafeSlice[V]) IsEmpty() bool
- func (s *SafeSlice[V]) Iter() *generics.Iterator[Tuple[int, V]]
- func (s *SafeSlice[V]) IterHandler(iter *generics.Iterator[Tuple[int, V]])
- func (s *SafeSlice[V]) Len() int
- func (s *SafeSlice[V]) Set(i int, item V)
- func (s *SafeSlice[V]) SetElem(item Tuple[int, V])
- func (s *SafeSlice[V]) Slice(start, end int) *SafeSlice[V]
- func (s *SafeSlice[V]) Values() []V
- type Tuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
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 SafeMap ¶
type SafeMap[K comparable, V any] struct { // contains filtered or unexported fields }
SafeMap is a thread-safe map.
func CollectionAsSafeMap ¶ added in v0.0.12
func CollectionAsSafeMap[K comparable, V any](c generics.Collection[K, V, Tuple[K, V]]) *SafeMap[K, V]
func NewSafeMap ¶
func NewSafeMap[K comparable, V any](items ...Tuple[K, V]) *SafeMap[K, V]
NewSafeMap creates a new SafeMap.
func (*SafeMap[K, V]) AppendElem ¶
AppendElem appends an element to the map.
func (*SafeMap[K, V]) AsCollection ¶
func (m *SafeMap[K, V]) AsCollection() generics.Collection[K, V, Tuple[K, V]]
func (*SafeMap[K, V]) AsIterable ¶
func (*SafeMap[K, V]) Clone ¶
func (m *SafeMap[K, V]) Clone() generics.Collection[K, V, Tuple[K, V]]
Clone returns a copy of the map.
func (*SafeMap[K, V]) Delete ¶
func (m *SafeMap[K, V]) Delete(key K)
Delete deletes a value from the map.
func (*SafeMap[K, V]) Factory ¶
func (m *SafeMap[K, V]) Factory() generics.Collection[K, V, Tuple[K, V]]
Factory returns a new instance of the map.
func (*SafeMap[K, V]) FactoryFrom ¶ added in v0.0.12
func (m *SafeMap[K, V]) FactoryFrom(values []V) generics.Collection[K, V, Tuple[K, V]]
func (*SafeMap[K, V]) Get ¶
func (m *SafeMap[K, V]) Get(key K) V
Get gets a value from the map. Panics if the key does not exist.
func (*SafeMap[K, V]) IterHandler ¶
type SafeSlice ¶
type SafeSlice[V any] struct { // contains filtered or unexported fields }
SafeSlice is a thread-safe slice.
It doesn't check out of bounds access.
func CollectionAsSafeSlice ¶ added in v0.0.12
func NewSafeSlice ¶
NewSafeSlice creates a new SafeSlice.
func NewSafeSliceN ¶
NewSafeSliceN creates a new SafeSlice with size and capacity of n.
func (*SafeSlice[V]) Append ¶
func (s *SafeSlice[V]) Append(item V)
Append appends a value to the slice.
func (*SafeSlice[V]) AppendElem ¶
AppendElem appends a value to the slice.
func (*SafeSlice[V]) AppendSafeSlice ¶
AppendSafeSlice appends a SafeSlice to the slice.
func (*SafeSlice[V]) AppendSlice ¶
func (s *SafeSlice[V]) AppendSlice(slice []V)
AppendSlice appends a slice to the slice.
func (*SafeSlice[V]) AsCollection ¶
func (*SafeSlice[V]) AsIterable ¶
func (*SafeSlice[V]) Compare ¶
func (s *SafeSlice[V]) Compare(i, j Tuple[int, V], comp func(V, V) generics.CompareResult) generics.CompareResult
Compare compares two slice items.