Documentation
¶
Index ¶
- type ChainMap
- func (cm *ChainMap[K, V]) Get(key K) (value V, ok bool)
- func (cm *ChainMap[K, V]) Items() *dict.Dict[K, V]
- func (cm *ChainMap[K, V]) Maps() []*dict.Dict[K, V]
- func (cm *ChainMap[K, V]) NewChild() *ChainMap[K, V]
- func (cm *ChainMap[K, V]) Parent() *ChainMap[K, V]
- func (cm *ChainMap[K, V]) Parents() []*ChainMap[K, V]
- func (cm *ChainMap[K, V]) Set(key K, value V) *ChainMap[K, V]
- type Counter
- func (c *Counter[T]) Clear() *Counter[T]
- func (c Counter[T]) Copy() Counter[T]
- func (c *Counter[T]) Elements() arraylist.ArrayList[T]
- func (c Counter[T]) Equal(another Counter[T]) bool
- func (c *Counter[T]) Get(item T) int
- func (c *Counter[T]) Increment(item T, counts ...int) *Counter[T]
- func (c *Counter[T]) LeastCommon() arraylist.ArrayList[T]
- func (c *Counter[T]) MostCommon() arraylist.ArrayList[T]
- func (c *Counter[T]) Remove(item T) (exist bool)
- func (c *Counter[T]) Reset() *Counter[T]
- func (c *Counter[T]) Set(item T, count int) *Counter[T]
- func (c *Counter[T]) SetDefault(count int) *Counter[T]
- func (c *Counter[T]) Subtract(item T, counts ...int) *Counter[T]
- func (c *Counter[T]) Total() (total int)
- type DefaultDict
- func (d *DefaultDict[K, V]) Clear() *DefaultDict[K, V]
- func (d DefaultDict[K, V]) Copy() DefaultDict[K, V]
- func (d DefaultDict[K, V]) Equal(another DefaultDict[K, V]) bool
- func (d *DefaultDict[K, V]) Get(key K) (value V)
- func (d DefaultDict[K, V]) MarshalJSON() ([]byte, error)
- func (d *DefaultDict[K, V]) Pop(key K) (value V)
- func (d *DefaultDict[K, V]) Set(key K, value V) *DefaultDict[K, V]
- func (d *DefaultDict[K, V]) SetDefault(value V) *DefaultDict[K, V]
- func (d DefaultDict[K, V]) String() string
- func (d *DefaultDict[K, V]) UnmarshalJSON(data []byte) error
- func (d *DefaultDict[K, V]) Update(another DefaultDict[K, V]) *DefaultDict[K, V]
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainMap ¶
type ChainMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewChainMap ¶
func NewChainMap[K comparable, V any](maps ...*dict.Dict[K, V]) *ChainMap[K, V]
type Counter ¶
type Counter[T comparable] struct { // contains filtered or unexported fields }
func MergeCounts ¶
func MergeCounts[T comparable](counters ...*Counter[T]) *Counter[T]
func NewCounter ¶
func NewCounter[T comparable](items arraylist.ArrayList[T], defaultCounts ...int) *Counter[T]
func (*Counter[T]) LeastCommon ¶
func (*Counter[T]) MostCommon ¶
func (*Counter[T]) SetDefault ¶
type DefaultDict ¶
type DefaultDict[K comparable, V any] struct { dict.Dict[K, V] // contains filtered or unexported fields }
func NewDefaultDict ¶
func NewDefaultDict[K comparable, V any](items dict.Dict[K, V], defaultVal V) *DefaultDict[K, V]
func (*DefaultDict[K, V]) Clear ¶
func (d *DefaultDict[K, V]) Clear() *DefaultDict[K, V]
func (DefaultDict[K, V]) Copy ¶
func (d DefaultDict[K, V]) Copy() DefaultDict[K, V]
func (DefaultDict[K, V]) Equal ¶
func (d DefaultDict[K, V]) Equal(another DefaultDict[K, V]) bool
func (*DefaultDict[K, V]) Get ¶
func (d *DefaultDict[K, V]) Get(key K) (value V)
func (DefaultDict[K, V]) MarshalJSON ¶
func (d DefaultDict[K, V]) MarshalJSON() ([]byte, error)
func (*DefaultDict[K, V]) Pop ¶
func (d *DefaultDict[K, V]) Pop(key K) (value V)
func (*DefaultDict[K, V]) Set ¶
func (d *DefaultDict[K, V]) Set(key K, value V) *DefaultDict[K, V]
func (*DefaultDict[K, V]) SetDefault ¶
func (d *DefaultDict[K, V]) SetDefault(value V) *DefaultDict[K, V]
func (DefaultDict[K, V]) String ¶
func (d DefaultDict[K, V]) String() string
func (*DefaultDict[K, V]) UnmarshalJSON ¶
func (d *DefaultDict[K, V]) UnmarshalJSON(data []byte) error
func (*DefaultDict[K, V]) Update ¶
func (d *DefaultDict[K, V]) Update(another DefaultDict[K, V]) *DefaultDict[K, V]
Click to show internal directories.
Click to hide internal directories.