Documentation ¶
Index ¶
- type Map
- func (s Map[K, V]) Begin() c.KVIterator[K, V]
- func (s Map[K, V]) Collect() map[K]V
- func (s Map[K, V]) Contains(key K) bool
- func (s Map[K, V]) Filter(filter c.BiPredicate[K, V]) c.MapPipe[K, V, map[K]V]
- func (s Map[K, V]) FilterKey(fit c.Predicate[K]) c.MapPipe[K, V, map[K]V]
- func (s Map[K, V]) FilterValue(fit c.Predicate[V]) c.MapPipe[K, V, map[K]V]
- func (s Map[K, V]) First() (it.OrderedKV[K, V], K, V, bool)
- func (s Map[K, V]) For(walker func(c.KV[K, V]) error) error
- func (s Map[K, V]) ForEach(walker func(c.KV[K, V]))
- func (s Map[K, V]) Get(key K) (V, bool)
- func (s Map[K, V]) Head() it.OrderedKV[K, V]
- func (s Map[K, V]) IsEmpty() bool
- func (s Map[K, V]) K() MapKeys[K]
- func (s Map[K, V]) Keys() c.Collection[K, []K, c.Iterator[K]]
- func (s Map[K, V]) Len() int
- func (s Map[K, V]) Map(by c.BiConverter[K, V, K, V]) c.MapPipe[K, V, map[K]V]
- func (s Map[K, V]) MapKey(by c.Converter[K, K]) c.MapPipe[K, V, map[K]V]
- func (s Map[K, V]) MapValue(by c.Converter[V, V]) c.MapPipe[K, V, map[K]V]
- func (s Map[K, V]) Reduce(by c.Quaternary[K, V]) (K, V)
- func (s Map[K, V]) Sort(less func(k1, k2 K) bool) Map[K, V]
- func (s Map[K, V]) String() string
- func (s Map[K, V]) Tail() it.OrderedKV[K, V]
- func (s Map[K, V]) Track(tracker func(K, V) error) error
- func (s Map[K, V]) TrackEach(tracker func(K, V))
- func (s Map[K, V]) V() MapValues[K, V]
- func (s Map[K, V]) Values() c.Collection[V, []V, c.Iterator[V]]
- type MapKeys
- func (s MapKeys[T]) Begin() c.Iterator[T]
- func (s MapKeys[T]) Collect() []T
- func (s MapKeys[T]) Filter(filter c.Predicate[T]) c.Pipe[T, []T]
- func (s MapKeys[T]) First() (it.Iter[T], T, bool)
- func (s MapKeys[T]) For(walker func(T) error) error
- func (s MapKeys[T]) ForEach(walker func(T))
- func (s MapKeys[T]) Get(index int) (T, bool)
- func (s MapKeys[T]) Head() it.Iter[T]
- func (s MapKeys[T]) IsEmpty() bool
- func (s MapKeys[T]) Len() int
- func (s MapKeys[T]) Map(by c.Converter[T, T]) c.Pipe[T, []T]
- func (s MapKeys[T]) Reduce(by c.Binary[T]) T
- func (s MapKeys[T]) String() string
- type MapValues
- func (s MapValues[K, V]) Begin() c.Iterator[V]
- func (s MapValues[K, V]) Collect() []V
- func (s MapValues[K, V]) Filter(filter c.Predicate[V]) c.Pipe[V, []V]
- func (s MapValues[K, V]) First() (*ValIter[K, V], V, bool)
- func (s MapValues[K, V]) For(walker func(V) error) error
- func (s MapValues[K, V]) ForEach(walker func(V))
- func (s MapValues[K, V]) Get(index int) (V, bool)
- func (s MapValues[K, V]) Head() *ValIter[K, V]
- func (s MapValues[K, V]) IsEmpty() bool
- func (s MapValues[K, V]) Len() int
- func (s MapValues[K, V]) Map(by c.Converter[V, V]) c.Pipe[V, []V]
- func (s MapValues[K, V]) Reduce(by c.Binary[V]) V
- func (s MapValues[K, V]) String() string
- type Set
- func (s Set[T]) Begin() c.Iterator[T]
- func (s Set[T]) Collect() []T
- func (s Set[T]) Contains(v T) bool
- func (s Set[T]) Filter(filter c.Predicate[T]) c.Pipe[T, []T]
- func (s Set[T]) First() (it.Iter[T], T, bool)
- func (s Set[T]) For(walker func(T) error) error
- func (s Set[T]) ForEach(walker func(T))
- func (s Set[T]) Head() it.Iter[T]
- func (s Set[T]) IsEmpty() bool
- func (s Set[T]) Last() (it.Iter[T], T, bool)
- func (s Set[T]) Len() int
- func (s Set[T]) Map(by c.Converter[T, T]) c.Pipe[T, []T]
- func (s Set[T]) Reduce(by c.Binary[T]) T
- func (s Set[T]) Revert() it.Iter[T]
- func (s Set[T]) Sort(less func(e1, e2 T) bool) Set[T]
- func (s Set[T]) String() string
- type ValIter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
Map is the Collection implementation that provides element access by an unique key.
func ConvertKVsToMap ¶
func ConvertKVsToMap[K comparable, V any](elements []c.KV[K, V]) Map[K, V]
ConvertKVsToMap converts a slice of key/value pairs to the Map.
func NewMap ¶
func NewMap[K comparable, V any](elements map[K]V) Map[K, V]
NewMap instantiates Map and copies elements to it.
func WrapMap ¶
func WrapMap[K comparable, V any](order []K, elements map[K]V) Map[K, V]
WrapMap instantiates ordered Map using a map and an order slice as internal storage.
func (Map[K, V]) Begin ¶
func (s Map[K, V]) Begin() c.KVIterator[K, V]
func (Map[K, V]) Filter ¶
func (s Map[K, V]) Filter(filter c.BiPredicate[K, V]) c.MapPipe[K, V, map[K]V]
func (Map[K, V]) FilterValue ¶
func (Map[K, V]) Map ¶
func (s Map[K, V]) Map(by c.BiConverter[K, V, K, V]) c.MapPipe[K, V, map[K]V]
func (Map[K, V]) Reduce ¶
func (s Map[K, V]) Reduce(by c.Quaternary[K, V]) (K, V)
type MapKeys ¶
type MapKeys[T comparable] struct { // contains filtered or unexported fields }
MapKeys is the wrapper for Map's keys
func WrapKeys ¶
func WrapKeys[T comparable](elements []T) MapKeys[T]
WrapKeys instantiates MapKeys using elements as internal storage
type MapValues ¶
type MapValues[K comparable, V any] struct { // contains filtered or unexported fields }
MapValues is the wrapper for Map's values.
func WrapVal ¶
func WrapVal[K comparable, V any](order []K, elements map[K]V) MapValues[K, V]
WrapVal instantiates MapValues using elements as internal storage.
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
Set is the Collection implementation that provides element uniqueness and access order. The elements must be comparable.
func NewSet ¶
func NewSet[T comparable](elements []T) Set[T]
NewSet instantiates Set and copies elements to it.
func WrapSet ¶
func WrapSet[T comparable](order []T, elements map[T]struct{}) Set[T]
WrapSet creates a set using a map and an order slice as the internal storage.
type ValIter ¶
type ValIter[K comparable, V any] struct { // contains filtered or unexported fields }
ValIter is the Iteratoc over Map values
func NewValIter ¶
func NewValIter[K comparable, V any](elements []K, uniques map[K]V) *ValIter[K, V]
NewValIter is default ValIter constructor