Documentation ¶
Overview ¶
Package immutable provides implementations of constant containers.
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]) 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.KV[K, V]
- func (s Map[K, V]) IsEmpty() bool
- func (s Map[K, V]) K() MapKeys[K, V]
- 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) ordered.Map[K, V]
- func (s Map[K, V]) String() string
- 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[K, V]) Begin() c.Iterator[K]
- func (s MapKeys[K, V]) Collect() []K
- func (s MapKeys[K, V]) Filter(filter c.Predicate[K]) c.Pipe[K, []K]
- func (s MapKeys[K, V]) First() (it.Key[K, V], K, bool)
- func (s MapKeys[K, V]) For(walker func(K) error) error
- func (s MapKeys[K, V]) ForEach(walker func(K))
- func (s MapKeys[K, V]) Head() it.Key[K, V]
- func (s MapKeys[K, V]) IsEmpty() bool
- func (s MapKeys[K, V]) Len() int
- func (s MapKeys[K, V]) Map(by c.Converter[K, K]) c.Pipe[K, []K]
- func (s MapKeys[K, V]) Reduce(by c.Binary[K]) K
- func (s MapKeys[K, V]) 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() (it.Val[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]) Head() it.Val[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]) Sort(less func(e1, e2 V) bool) Vector[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(val T) bool
- func (s Set[T]) Filter(filter c.Predicate[T]) c.Pipe[T, []T]
- func (s Set[T]) First() (it.Key[T, struct{}], 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.Key[T, struct{}]
- func (s Set[T]) IsEmpty() 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]) Sort(less func(e1, e2 T) bool) ordered.Set[T]
- func (s Set[T]) String() string
- type Vector
- func (v Vector[T]) Begin() c.Iterator[T]
- func (v Vector[T]) Collect() []T
- func (v Vector[T]) Filter(filter c.Predicate[T]) c.Pipe[T, []T]
- func (v Vector[T]) First() (it.Iter[T], T, bool)
- func (v Vector[T]) For(walker func(T) error) error
- func (v Vector[T]) ForEach(walker func(T))
- func (v Vector[T]) Get(index int) (T, bool)
- func (v Vector[T]) Head() it.Iter[T]
- func (v Vector[T]) IsEmpty() bool
- func (v Vector[T]) Last() (it.Iter[T], T, bool)
- func (v Vector[T]) Len() int
- func (v Vector[T]) Map(by c.Converter[T, T]) c.Pipe[T, []T]
- func (v Vector[T]) Reduce(by c.Binary[T]) T
- func (v Vector[T]) Sort(less func(e1, e2 T) bool) Vector[T]
- func (v Vector[T]) String() string
- func (v Vector[T]) Tail() it.Iter[T]
- func (v Vector[T]) Track(tracker func(int, T) error) error
- func (v Vector[T]) TrackEach(tracker func(int, T))
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 with values copied from an map.
func WrapMap ¶
func WrapMap[K comparable, V any](elements map[K]V) Map[K, V]
WrapMap instantiates Map using a map as internal storage.
func (Map[K, V]) Begin ¶
func (s Map[K, V]) Begin() c.KVIterator[K, V]
Begin creates a key/value iterator interface.
func (Map[K, V]) Collect ¶
func (s Map[K, V]) Collect() map[K]V
Collect exports the content as a map.
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)
func (Map[K, V]) String ¶
String is part of the Stringer interface for printing the string representation of this Map.
func (Map[K, V]) Track ¶
Track apply a tracker to touch key, value from the inside. To stop traking just return the map_.Break.
type MapKeys ¶
type MapKeys[K comparable, V any] struct { // contains filtered or unexported fields }
MapKeys is the container reveal keys of a map and hides values.
func WrapKeys ¶
func WrapKeys[K comparable, V any](uniques map[K]V) MapKeys[K, V]
WrapKeys is non-copy constructor
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](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 the uniqueness of its elements. 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](elements map[T]struct{}) Set[T]
WrapSet creates a set using a map as the internal storage.
type Vector ¶
type Vector[T any] struct { // contains filtered or unexported fields }
Vector is the Collection implementation that provides elements order and index access.
func WrapVector ¶
WrapVector instantiates Vector using a slise as internal storage.
Directories ¶
Path | Synopsis |
---|---|
Package map_ provides the unordered map container implementation
|
Package map_ provides the unordered map container implementation |
Package omap provides the ordered map container implementation
|
Package omap provides the ordered map container implementation |
Package oset provides the ordered set container implementation
|
Package oset provides the ordered set container implementation |
Package set provides the unordered set container implementation
|
Package set provides the unordered set container implementation |
Package vector provides the Vector (ordered) implementation
|
Package vector provides the Vector (ordered) implementation |