xmap

package
v0.0.0-...-021ab65 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

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 New

func New() *Map

New instantiates a hash map.

func (*Map) Clear

func (m *Map) Clear()

Clear removes all elements from the map.

func (*Map) Empty

func (m *Map) Empty() bool

Empty returns true if map does not contain any elements

func (*Map) Get

func (m *Map) Get(key interface{}) (value interface{}, found bool)

Get searches the element in the map by key and returns its value or nil if key is not found in map. Second return parameter is true if key was found, otherwise false.

func (*Map) Keys

func (m *Map) Keys() []interface{}

Keys returns all keys (random order).

func (*Map) Put

func (m *Map) Put(key interface{}, value interface{})

Put inserts element into the map.

func (*Map) Remove

func (m *Map) Remove(key interface{})

Remove removes the element from the map by key.

func (*Map) Size

func (m *Map) Size() int

Size returns number of elements in the map.

func (*Map) String

func (m *Map) String() string

String returns a string representation of container

func (*Map) Values

func (m *Map) Values() []interface{}

Values returns all values (random order).

type SortMap

type SortMap struct {
	Map
	// contains filtered or unexported fields
}

func NewSortMap

func NewSortMap() *SortMap

func (*SortMap) Clear

func (m *SortMap) Clear()

func (*SortMap) Keys

func (m *SortMap) Keys() []interface{}

func (*SortMap) Put

func (m *SortMap) Put(key interface{}, value interface{})

func (*SortMap) String

func (m *SortMap) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL