Documentation ¶
Index ¶
- type Map
- func (m *Map) Clear()
- func (m *Map) Empty() bool
- func (m *Map) Get(key interface{}) (value interface{}, found bool)
- func (m *Map) Keys() []interface{}
- func (m *Map) Put(key interface{}, value interface{})
- func (m *Map) Remove(key interface{})
- func (m *Map) Size() int
- func (m *Map) String() string
- func (m *Map) Values() []interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
func NewWith ¶
func NewWith(comparator utils.Comparator) *Map
Instantiates a tree map with the custom comparator.
func NewWithIntComparator ¶
func NewWithIntComparator() *Map
Instantiates a tree map with the IntComparator, i.e. keys are of type int.
func NewWithStringComparator ¶
func NewWithStringComparator() *Map
Instantiates a tree map with the StringComparator, i.e. keys are of type string.
func (*Map) 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 (*Map) Put ¶
func (m *Map) Put(key interface{}, value interface{})
Inserts key-value pair into the map. Key should adhere to the comparator's type assertion, otherwise method panics.
Click to show internal directories.
Click to hide internal directories.