Documentation ¶
Overview ¶
Package treemap implements a map backed by red-black Tree.
Elements are ordered by key in the map.
Structure is not thread safe.
Reference: http://en.wikipedia.org/wiki/Associative_array
Package treemap implements a map backed by red-black Tree.
Elements are ordered by key in the map.
Structure is not thread safe.
Reference: http://en.wikipedia.org/wiki/Associative_array
Package treemap implements a map backed by red-black Tree.
Elements are ordered by key in the map.
Structure is not thread safe.
Reference: http://en.wikipedia.org/wiki/Associative_array
Package treemap implements a map backed by red-black Tree.
Elements are ordered by key in the map.
Structure is not thread safe.
Reference: http://en.wikipedia.org/wiki/Associative_array
Package treemap implements a map backed by red-black Tree.
Elements are ordered by key in the map.
Structure is not thread safe.
Reference: http://en.wikipedia.org/wiki/Associative_array
Package treemap implements a map backed by red-black Tree.
Elements are ordered by key in the map.
Structure is not thread safe.
Index ¶
- Variables
- type IntStringMap
- func (m *IntStringMap) Begin() IteratorIntStringMap
- func (m *IntStringMap) Each(f func(key int, value string))
- func (m *IntStringMap) End() IteratorIntStringMap
- func (m *IntStringMap) Find(f func(key int, value string) bool) (k int, v string)
- func (m *IntStringMap) Get(key int) IteratorIntStringMap
- func (m *IntStringMap) Insert(key int, value string) IteratorIntStringMap
- func (m *IntStringMap) Iterator() IteratorIntStringMap
- func (m *IntStringMap) Keys() []int
- func (m *IntStringMap) LowerBound(key int) IteratorIntStringMap
- func (m IntStringMap) MarshalJSON() ([]byte, error)
- func (m IntStringMap) Pack() (re []byte, err error)
- func (m *IntStringMap) Put(key int, value string)
- func (m *IntStringMap) Remove(key int)
- func (m IntStringMap) String() string
- func (m *IntStringMap) UnmarshalJSON(data []byte) error
- func (m *IntStringMap) Unpack(in []byte) (int, error)
- func (m *IntStringMap) UpperBound(key int) IteratorIntStringMap
- func (m *IntStringMap) Values() []string
- type IntStringPtrMap
- func (m *IntStringPtrMap) Begin() IteratorIntStringPtrMap
- func (m *IntStringPtrMap) Each(f func(key int, value *string))
- func (m *IntStringPtrMap) End() IteratorIntStringPtrMap
- func (m *IntStringPtrMap) Find(f func(key int, value *string) bool) (k int, v *string)
- func (m *IntStringPtrMap) Get(key int) IteratorIntStringPtrMap
- func (m *IntStringPtrMap) Insert(key int, value *string) IteratorIntStringPtrMap
- func (m *IntStringPtrMap) Iterator() IteratorIntStringPtrMap
- func (m *IntStringPtrMap) Keys() []int
- func (m *IntStringPtrMap) LowerBound(key int) IteratorIntStringPtrMap
- func (m IntStringPtrMap) MarshalJSON() ([]byte, error)
- func (m IntStringPtrMap) Pack() (re []byte, err error)
- func (m *IntStringPtrMap) Put(key int, value *string)
- func (m *IntStringPtrMap) Remove(key int)
- func (m IntStringPtrMap) String() string
- func (m *IntStringPtrMap) UnmarshalJSON(data []byte) error
- func (m *IntStringPtrMap) Unpack(in []byte) (int, error)
- func (m *IntStringPtrMap) UpperBound(key int) IteratorIntStringPtrMap
- func (m *IntStringPtrMap) Values() []*string
- type IteratorIntStringMap
- type IteratorIntStringPtrMap
- type IteratorMultiIntStringMap
- type IteratorMultiIntStringPtrMap
- type IteratorMultiStringIntMap
- type IteratorStringIntMap
- type MultiIntStringMap
- func (m *MultiIntStringMap) Begin() IteratorMultiIntStringMap
- func (m *MultiIntStringMap) Each(f func(key int, value string))
- func (m *MultiIntStringMap) End() IteratorMultiIntStringMap
- func (m *MultiIntStringMap) Find(f func(key int, value string) bool) (k int, v string)
- func (m *MultiIntStringMap) Get(key int) IteratorMultiIntStringMap
- func (m *MultiIntStringMap) Insert(key int, value string) IteratorMultiIntStringMap
- func (m *MultiIntStringMap) Iterator() IteratorMultiIntStringMap
- func (m *MultiIntStringMap) Keys() []int
- func (m *MultiIntStringMap) LowerBound(key int) IteratorMultiIntStringMap
- func (m MultiIntStringMap) MarshalJSON() ([]byte, error)
- func (m MultiIntStringMap) Pack() (re []byte, err error)
- func (m *MultiIntStringMap) Put(key int, value string)
- func (m *MultiIntStringMap) Remove(key int)
- func (m MultiIntStringMap) String() string
- func (m *MultiIntStringMap) UnmarshalJSON(data []byte) error
- func (m *MultiIntStringMap) Unpack(in []byte) (int, error)
- func (m *MultiIntStringMap) UpperBound(key int) IteratorMultiIntStringMap
- func (m *MultiIntStringMap) Values() []string
- type MultiIntStringPtrMap
- func (m *MultiIntStringPtrMap) Begin() IteratorMultiIntStringPtrMap
- func (m *MultiIntStringPtrMap) Each(f func(key int, value *string))
- func (m *MultiIntStringPtrMap) End() IteratorMultiIntStringPtrMap
- func (m *MultiIntStringPtrMap) Find(f func(key int, value *string) bool) (k int, v *string)
- func (m *MultiIntStringPtrMap) Get(key int) IteratorMultiIntStringPtrMap
- func (m *MultiIntStringPtrMap) Insert(key int, value *string) IteratorMultiIntStringPtrMap
- func (m *MultiIntStringPtrMap) Iterator() IteratorMultiIntStringPtrMap
- func (m *MultiIntStringPtrMap) Keys() []int
- func (m *MultiIntStringPtrMap) LowerBound(key int) IteratorMultiIntStringPtrMap
- func (m MultiIntStringPtrMap) MarshalJSON() ([]byte, error)
- func (m MultiIntStringPtrMap) Pack() (re []byte, err error)
- func (m *MultiIntStringPtrMap) Put(key int, value *string)
- func (m *MultiIntStringPtrMap) Remove(key int)
- func (m MultiIntStringPtrMap) String() string
- func (m *MultiIntStringPtrMap) UnmarshalJSON(data []byte) error
- func (m *MultiIntStringPtrMap) Unpack(in []byte) (int, error)
- func (m *MultiIntStringPtrMap) UpperBound(key int) IteratorMultiIntStringPtrMap
- func (m *MultiIntStringPtrMap) Values() []*string
- type MultiStringIntMap
- func (m *MultiStringIntMap) Begin() IteratorMultiStringIntMap
- func (m *MultiStringIntMap) Each(f func(key string, value int))
- func (m *MultiStringIntMap) End() IteratorMultiStringIntMap
- func (m *MultiStringIntMap) Find(f func(key string, value int) bool) (k string, v int)
- func (m *MultiStringIntMap) Get(key string) IteratorMultiStringIntMap
- func (m *MultiStringIntMap) Insert(key string, value int) IteratorMultiStringIntMap
- func (m *MultiStringIntMap) Iterator() IteratorMultiStringIntMap
- func (m *MultiStringIntMap) Keys() []string
- func (m *MultiStringIntMap) LowerBound(key string) IteratorMultiStringIntMap
- func (m MultiStringIntMap) MarshalJSON() ([]byte, error)
- func (m MultiStringIntMap) Pack() (re []byte, err error)
- func (m *MultiStringIntMap) Put(key string, value int)
- func (m *MultiStringIntMap) Remove(key string)
- func (m MultiStringIntMap) String() string
- func (m *MultiStringIntMap) UnmarshalJSON(data []byte) error
- func (m *MultiStringIntMap) Unpack(in []byte) (int, error)
- func (m *MultiStringIntMap) UpperBound(key string) IteratorMultiStringIntMap
- func (m *MultiStringIntMap) Values() []int
- type StringIntMap
- func (m *StringIntMap) Begin() IteratorStringIntMap
- func (m *StringIntMap) Each(f func(key string, value int))
- func (m *StringIntMap) End() IteratorStringIntMap
- func (m *StringIntMap) Find(f func(key string, value int) bool) (k string, v int)
- func (m *StringIntMap) Get(key string) IteratorStringIntMap
- func (m *StringIntMap) Insert(key string, value int) IteratorStringIntMap
- func (m *StringIntMap) Iterator() IteratorStringIntMap
- func (m *StringIntMap) Keys() []string
- func (m *StringIntMap) LowerBound(key string) IteratorStringIntMap
- func (m StringIntMap) MarshalJSON() ([]byte, error)
- func (m StringIntMap) Pack() (re []byte, err error)
- func (m *StringIntMap) Put(key string, value int)
- func (m *StringIntMap) Remove(key string)
- func (m StringIntMap) String() string
- func (m *StringIntMap) UnmarshalJSON(data []byte) error
- func (m *StringIntMap) Unpack(in []byte) (int, error)
- func (m *StringIntMap) UpperBound(key string) IteratorStringIntMap
- func (m *StringIntMap) Values() []int
Constants ¶
This section is empty.
Variables ¶
var IntComparator = func(a, b interface{}) int { return container.IntComparator(a.(int), b.(int)) }
var StringComparator = func(a, b interface{}) int { return container.StringComparator(a.(string), b.(string)) }
Functions ¶
This section is empty.
Types ¶
type IntStringMap ¶
Map holds the elements in a red-black Tree
func CopyFromIntStringMap ¶
func CopyFromIntStringMap(tm *IntStringMap) *IntStringMap
func NewIntStringMap ¶
func NewIntStringMap() *IntStringMap
NewWith instantiates a Tree map with the custom comparator.
func (*IntStringMap) Begin ¶
func (m *IntStringMap) Begin() IteratorIntStringMap
Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty
func (*IntStringMap) Each ¶
func (m *IntStringMap) Each(f func(key int, value string))
Each calls the given function once for each element, passing that element's key and value.
func (*IntStringMap) End ¶
func (m *IntStringMap) End() IteratorIntStringMap
End returns End Iterator
func (*IntStringMap) Find ¶
Find passes each element of the container to the given function and returns the first (key,value) for which the function is true or nil,nil otherwise if no element matches the criteria.
func (*IntStringMap) Get ¶
func (m *IntStringMap) Get(key int) IteratorIntStringMap
Get searches the element in the map by key and returns its value or nil if key is not found in Tree. Second return parameter is true if key was found, otherwise false. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*IntStringMap) Insert ¶
func (m *IntStringMap) Insert(key int, value string) IteratorIntStringMap
func (*IntStringMap) Iterator ¶
func (m *IntStringMap) Iterator() IteratorIntStringMap
Iterator returns a stateful Iterator whose elements are key/value pairs.
func (*IntStringMap) LowerBound ¶
func (m *IntStringMap) LowerBound(key int) IteratorIntStringMap
func (IntStringMap) MarshalJSON ¶
func (m IntStringMap) MarshalJSON() ([]byte, error)
func (IntStringMap) Pack ¶
func (m IntStringMap) Pack() (re []byte, err error)
func (*IntStringMap) Put ¶
func (m *IntStringMap) Put(key int, value string)
Put inserts key-value pair into the map. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*IntStringMap) Remove ¶
func (m *IntStringMap) Remove(key int)
Remove removes the element from the map by key. Key should adhere to the comparator's type assertion, otherwise method panics.
func (IntStringMap) String ¶
func (m IntStringMap) String() string
String returns a string representation of container
func (*IntStringMap) UnmarshalJSON ¶
func (m *IntStringMap) UnmarshalJSON(data []byte) error
FromJSON populates the map from the input JSON representation.
func (*IntStringMap) UpperBound ¶
func (m *IntStringMap) UpperBound(key int) IteratorIntStringMap
func (*IntStringMap) Values ¶
func (m *IntStringMap) Values() []string
Values returns all values in-order based on the key.
type IntStringPtrMap ¶
Map holds the elements in a red-black Tree
func CopyFromIntStringPtrMap ¶
func CopyFromIntStringPtrMap(tm *IntStringPtrMap) *IntStringPtrMap
func NewIntStringPtrMap ¶
func NewIntStringPtrMap() *IntStringPtrMap
NewWith instantiates a Tree map with the custom comparator.
func (*IntStringPtrMap) Begin ¶
func (m *IntStringPtrMap) Begin() IteratorIntStringPtrMap
Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty
func (*IntStringPtrMap) Each ¶
func (m *IntStringPtrMap) Each(f func(key int, value *string))
Each calls the given function once for each element, passing that element's key and value.
func (*IntStringPtrMap) End ¶
func (m *IntStringPtrMap) End() IteratorIntStringPtrMap
End returns End Iterator
func (*IntStringPtrMap) Find ¶
Find passes each element of the container to the given function and returns the first (key,value) for which the function is true or nil,nil otherwise if no element matches the criteria.
func (*IntStringPtrMap) Get ¶
func (m *IntStringPtrMap) Get(key int) IteratorIntStringPtrMap
Get searches the element in the map by key and returns its value or nil if key is not found in Tree. Second return parameter is true if key was found, otherwise false. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*IntStringPtrMap) Insert ¶
func (m *IntStringPtrMap) Insert(key int, value *string) IteratorIntStringPtrMap
func (*IntStringPtrMap) Iterator ¶
func (m *IntStringPtrMap) Iterator() IteratorIntStringPtrMap
Iterator returns a stateful Iterator whose elements are key/value pairs.
func (*IntStringPtrMap) Keys ¶
func (m *IntStringPtrMap) Keys() []int
Keys returns all keys in-order
func (*IntStringPtrMap) LowerBound ¶
func (m *IntStringPtrMap) LowerBound(key int) IteratorIntStringPtrMap
func (IntStringPtrMap) MarshalJSON ¶
func (m IntStringPtrMap) MarshalJSON() ([]byte, error)
func (IntStringPtrMap) Pack ¶
func (m IntStringPtrMap) Pack() (re []byte, err error)
func (*IntStringPtrMap) Put ¶
func (m *IntStringPtrMap) Put(key int, value *string)
Put inserts key-value pair into the map. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*IntStringPtrMap) Remove ¶
func (m *IntStringPtrMap) Remove(key int)
Remove removes the element from the map by key. Key should adhere to the comparator's type assertion, otherwise method panics.
func (IntStringPtrMap) String ¶
func (m IntStringPtrMap) String() string
String returns a string representation of container
func (*IntStringPtrMap) UnmarshalJSON ¶
func (m *IntStringPtrMap) UnmarshalJSON(data []byte) error
FromJSON populates the map from the input JSON representation.
func (*IntStringPtrMap) UpperBound ¶
func (m *IntStringPtrMap) UpperBound(key int) IteratorIntStringPtrMap
func (*IntStringPtrMap) Values ¶
func (m *IntStringPtrMap) Values() []*string
Values returns all values in-order based on the key.
type IteratorIntStringMap ¶
Iterator holding the Iterator's state
func (IteratorIntStringMap) Key ¶
func (iterator IteratorIntStringMap) Key() int
Key returns the current element's key. Does not modify the state of the Iterator.
func (IteratorIntStringMap) Value ¶
func (iterator IteratorIntStringMap) Value() string
Value returns the current element's value. Does not modify the state of the Iterator.
type IteratorIntStringPtrMap ¶
Iterator holding the Iterator's state
func (IteratorIntStringPtrMap) Key ¶
func (iterator IteratorIntStringPtrMap) Key() int
Key returns the current element's key. Does not modify the state of the Iterator.
func (IteratorIntStringPtrMap) Value ¶
func (iterator IteratorIntStringPtrMap) Value() *string
Value returns the current element's value. Does not modify the state of the Iterator.
type IteratorMultiIntStringMap ¶
Iterator holding the Iterator's state
func (IteratorMultiIntStringMap) Key ¶
func (iterator IteratorMultiIntStringMap) Key() int
Key returns the current element's key. Does not modify the state of the Iterator.
func (IteratorMultiIntStringMap) Value ¶
func (iterator IteratorMultiIntStringMap) Value() string
Value returns the current element's value. Does not modify the state of the Iterator.
type IteratorMultiIntStringPtrMap ¶
Iterator holding the Iterator's state
func (IteratorMultiIntStringPtrMap) Key ¶
func (iterator IteratorMultiIntStringPtrMap) Key() int
Key returns the current element's key. Does not modify the state of the Iterator.
func (IteratorMultiIntStringPtrMap) Value ¶
func (iterator IteratorMultiIntStringPtrMap) Value() *string
Value returns the current element's value. Does not modify the state of the Iterator.
type IteratorMultiStringIntMap ¶
Iterator holding the Iterator's state
func (IteratorMultiStringIntMap) Key ¶
func (iterator IteratorMultiStringIntMap) Key() string
Key returns the current element's key. Does not modify the state of the Iterator.
func (IteratorMultiStringIntMap) Value ¶
func (iterator IteratorMultiStringIntMap) Value() int
Value returns the current element's value. Does not modify the state of the Iterator.
type IteratorStringIntMap ¶
Iterator holding the Iterator's state
func (IteratorStringIntMap) Key ¶
func (iterator IteratorStringIntMap) Key() string
Key returns the current element's key. Does not modify the state of the Iterator.
func (IteratorStringIntMap) Value ¶
func (iterator IteratorStringIntMap) Value() int
Value returns the current element's value. Does not modify the state of the Iterator.
type MultiIntStringMap ¶
Map holds the elements in a red-black Tree
func CopyFromMultiIntStringMap ¶
func CopyFromMultiIntStringMap(tm *MultiIntStringMap) *MultiIntStringMap
func NewMultiIntStringMap ¶
func NewMultiIntStringMap() *MultiIntStringMap
NewWith instantiates a Tree map with the custom comparator.
func (*MultiIntStringMap) Begin ¶
func (m *MultiIntStringMap) Begin() IteratorMultiIntStringMap
Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty
func (*MultiIntStringMap) Each ¶
func (m *MultiIntStringMap) Each(f func(key int, value string))
Each calls the given function once for each element, passing that element's key and value.
func (*MultiIntStringMap) End ¶
func (m *MultiIntStringMap) End() IteratorMultiIntStringMap
End returns End Iterator
func (*MultiIntStringMap) Find ¶
Find passes each element of the container to the given function and returns the first (key,value) for which the function is true or nil,nil otherwise if no element matches the criteria.
func (*MultiIntStringMap) Get ¶
func (m *MultiIntStringMap) Get(key int) IteratorMultiIntStringMap
Get searches the element in the map by key and returns its value or nil if key is not found in Tree. Second return parameter is true if key was found, otherwise false. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*MultiIntStringMap) Insert ¶
func (m *MultiIntStringMap) Insert(key int, value string) IteratorMultiIntStringMap
func (*MultiIntStringMap) Iterator ¶
func (m *MultiIntStringMap) Iterator() IteratorMultiIntStringMap
Iterator returns a stateful Iterator whose elements are key/value pairs.
func (*MultiIntStringMap) Keys ¶
func (m *MultiIntStringMap) Keys() []int
Keys returns all keys in-order
func (*MultiIntStringMap) LowerBound ¶
func (m *MultiIntStringMap) LowerBound(key int) IteratorMultiIntStringMap
func (MultiIntStringMap) MarshalJSON ¶
func (m MultiIntStringMap) MarshalJSON() ([]byte, error)
func (MultiIntStringMap) Pack ¶
func (m MultiIntStringMap) Pack() (re []byte, err error)
func (*MultiIntStringMap) Put ¶
func (m *MultiIntStringMap) Put(key int, value string)
Put inserts key-value pair into the map. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*MultiIntStringMap) Remove ¶
func (m *MultiIntStringMap) Remove(key int)
Remove removes the element from the map by key. Key should adhere to the comparator's type assertion, otherwise method panics.
func (MultiIntStringMap) String ¶
func (m MultiIntStringMap) String() string
String returns a string representation of container
func (*MultiIntStringMap) UnmarshalJSON ¶
func (m *MultiIntStringMap) UnmarshalJSON(data []byte) error
FromJSON populates the map from the input JSON representation.
func (*MultiIntStringMap) UpperBound ¶
func (m *MultiIntStringMap) UpperBound(key int) IteratorMultiIntStringMap
func (*MultiIntStringMap) Values ¶
func (m *MultiIntStringMap) Values() []string
Values returns all values in-order based on the key.
type MultiIntStringPtrMap ¶
Map holds the elements in a red-black Tree
func CopyFromMultiIntStringPtrMap ¶
func CopyFromMultiIntStringPtrMap(tm *MultiIntStringPtrMap) *MultiIntStringPtrMap
func NewMultiIntStringPtrMap ¶
func NewMultiIntStringPtrMap() *MultiIntStringPtrMap
NewWith instantiates a Tree map with the custom comparator.
func (*MultiIntStringPtrMap) Begin ¶
func (m *MultiIntStringPtrMap) Begin() IteratorMultiIntStringPtrMap
Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty
func (*MultiIntStringPtrMap) Each ¶
func (m *MultiIntStringPtrMap) Each(f func(key int, value *string))
Each calls the given function once for each element, passing that element's key and value.
func (*MultiIntStringPtrMap) End ¶
func (m *MultiIntStringPtrMap) End() IteratorMultiIntStringPtrMap
End returns End Iterator
func (*MultiIntStringPtrMap) Find ¶
Find passes each element of the container to the given function and returns the first (key,value) for which the function is true or nil,nil otherwise if no element matches the criteria.
func (*MultiIntStringPtrMap) Get ¶
func (m *MultiIntStringPtrMap) Get(key int) IteratorMultiIntStringPtrMap
Get searches the element in the map by key and returns its value or nil if key is not found in Tree. Second return parameter is true if key was found, otherwise false. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*MultiIntStringPtrMap) Insert ¶
func (m *MultiIntStringPtrMap) Insert(key int, value *string) IteratorMultiIntStringPtrMap
func (*MultiIntStringPtrMap) Iterator ¶
func (m *MultiIntStringPtrMap) Iterator() IteratorMultiIntStringPtrMap
Iterator returns a stateful Iterator whose elements are key/value pairs.
func (*MultiIntStringPtrMap) Keys ¶
func (m *MultiIntStringPtrMap) Keys() []int
Keys returns all keys in-order
func (*MultiIntStringPtrMap) LowerBound ¶
func (m *MultiIntStringPtrMap) LowerBound(key int) IteratorMultiIntStringPtrMap
func (MultiIntStringPtrMap) MarshalJSON ¶
func (m MultiIntStringPtrMap) MarshalJSON() ([]byte, error)
func (MultiIntStringPtrMap) Pack ¶
func (m MultiIntStringPtrMap) Pack() (re []byte, err error)
func (*MultiIntStringPtrMap) Put ¶
func (m *MultiIntStringPtrMap) Put(key int, value *string)
Put inserts key-value pair into the map. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*MultiIntStringPtrMap) Remove ¶
func (m *MultiIntStringPtrMap) Remove(key int)
Remove removes the element from the map by key. Key should adhere to the comparator's type assertion, otherwise method panics.
func (MultiIntStringPtrMap) String ¶
func (m MultiIntStringPtrMap) String() string
String returns a string representation of container
func (*MultiIntStringPtrMap) UnmarshalJSON ¶
func (m *MultiIntStringPtrMap) UnmarshalJSON(data []byte) error
FromJSON populates the map from the input JSON representation.
func (*MultiIntStringPtrMap) UpperBound ¶
func (m *MultiIntStringPtrMap) UpperBound(key int) IteratorMultiIntStringPtrMap
func (*MultiIntStringPtrMap) Values ¶
func (m *MultiIntStringPtrMap) Values() []*string
Values returns all values in-order based on the key.
type MultiStringIntMap ¶
Map holds the elements in a red-black Tree
func CopyFromMultiStringIntMap ¶
func CopyFromMultiStringIntMap(tm *MultiStringIntMap) *MultiStringIntMap
func NewMultiStringIntMap ¶
func NewMultiStringIntMap() *MultiStringIntMap
NewWith instantiates a Tree map with the custom comparator.
func (*MultiStringIntMap) Begin ¶
func (m *MultiStringIntMap) Begin() IteratorMultiStringIntMap
Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty
func (*MultiStringIntMap) Each ¶
func (m *MultiStringIntMap) Each(f func(key string, value int))
Each calls the given function once for each element, passing that element's key and value.
func (*MultiStringIntMap) End ¶
func (m *MultiStringIntMap) End() IteratorMultiStringIntMap
End returns End Iterator
func (*MultiStringIntMap) Find ¶
Find passes each element of the container to the given function and returns the first (key,value) for which the function is true or nil,nil otherwise if no element matches the criteria.
func (*MultiStringIntMap) Get ¶
func (m *MultiStringIntMap) Get(key string) IteratorMultiStringIntMap
Get searches the element in the map by key and returns its value or nil if key is not found in Tree. Second return parameter is true if key was found, otherwise false. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*MultiStringIntMap) Insert ¶
func (m *MultiStringIntMap) Insert(key string, value int) IteratorMultiStringIntMap
func (*MultiStringIntMap) Iterator ¶
func (m *MultiStringIntMap) Iterator() IteratorMultiStringIntMap
Iterator returns a stateful Iterator whose elements are key/value pairs.
func (*MultiStringIntMap) Keys ¶
func (m *MultiStringIntMap) Keys() []string
Keys returns all keys in-order
func (*MultiStringIntMap) LowerBound ¶
func (m *MultiStringIntMap) LowerBound(key string) IteratorMultiStringIntMap
func (MultiStringIntMap) MarshalJSON ¶
func (m MultiStringIntMap) MarshalJSON() ([]byte, error)
func (MultiStringIntMap) Pack ¶
func (m MultiStringIntMap) Pack() (re []byte, err error)
func (*MultiStringIntMap) Put ¶
func (m *MultiStringIntMap) Put(key string, value int)
Put inserts key-value pair into the map. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*MultiStringIntMap) Remove ¶
func (m *MultiStringIntMap) Remove(key string)
Remove removes the element from the map by key. Key should adhere to the comparator's type assertion, otherwise method panics.
func (MultiStringIntMap) String ¶
func (m MultiStringIntMap) String() string
String returns a string representation of container
func (*MultiStringIntMap) UnmarshalJSON ¶
func (m *MultiStringIntMap) UnmarshalJSON(data []byte) error
FromJSON populates the map from the input JSON representation.
func (*MultiStringIntMap) UpperBound ¶
func (m *MultiStringIntMap) UpperBound(key string) IteratorMultiStringIntMap
func (*MultiStringIntMap) Values ¶
func (m *MultiStringIntMap) Values() []int
Values returns all values in-order based on the key.
type StringIntMap ¶
Map holds the elements in a red-black Tree
func CopyFromStringIntMap ¶
func CopyFromStringIntMap(tm *StringIntMap) *StringIntMap
func NewStringIntMap ¶
func NewStringIntMap() *StringIntMap
NewWith instantiates a Tree map with the custom comparator.
func (*StringIntMap) Begin ¶
func (m *StringIntMap) Begin() IteratorStringIntMap
Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty
func (*StringIntMap) Each ¶
func (m *StringIntMap) Each(f func(key string, value int))
Each calls the given function once for each element, passing that element's key and value.
func (*StringIntMap) End ¶
func (m *StringIntMap) End() IteratorStringIntMap
End returns End Iterator
func (*StringIntMap) Find ¶
Find passes each element of the container to the given function and returns the first (key,value) for which the function is true or nil,nil otherwise if no element matches the criteria.
func (*StringIntMap) Get ¶
func (m *StringIntMap) Get(key string) IteratorStringIntMap
Get searches the element in the map by key and returns its value or nil if key is not found in Tree. Second return parameter is true if key was found, otherwise false. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*StringIntMap) Insert ¶
func (m *StringIntMap) Insert(key string, value int) IteratorStringIntMap
func (*StringIntMap) Iterator ¶
func (m *StringIntMap) Iterator() IteratorStringIntMap
Iterator returns a stateful Iterator whose elements are key/value pairs.
func (*StringIntMap) LowerBound ¶
func (m *StringIntMap) LowerBound(key string) IteratorStringIntMap
func (StringIntMap) MarshalJSON ¶
func (m StringIntMap) MarshalJSON() ([]byte, error)
func (StringIntMap) Pack ¶
func (m StringIntMap) Pack() (re []byte, err error)
func (*StringIntMap) Put ¶
func (m *StringIntMap) Put(key string, value int)
Put inserts key-value pair into the map. Key should adhere to the comparator's type assertion, otherwise method panics.
func (*StringIntMap) Remove ¶
func (m *StringIntMap) Remove(key string)
Remove removes the element from the map by key. Key should adhere to the comparator's type assertion, otherwise method panics.
func (StringIntMap) String ¶
func (m StringIntMap) String() string
String returns a string representation of container
func (*StringIntMap) UnmarshalJSON ¶
func (m *StringIntMap) UnmarshalJSON(data []byte) error
FromJSON populates the map from the input JSON representation.
func (*StringIntMap) UpperBound ¶
func (m *StringIntMap) UpperBound(key string) IteratorStringIntMap
func (*StringIntMap) Values ¶
func (m *StringIntMap) Values() []int
Values returns all values in-order based on the key.