hashmap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2016 License: BSD-2-Clause Imports: 2 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

Instantiates a hash map.

func (*Map) Clear

func (m *Map) Clear()

Removes all elements from the map.

func (*Map) Empty

func (m *Map) Empty() bool

Returns true if map does not contain any elements

func (*Map) Get

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

Searches the elemnt 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{}

Returns all keys (random order).

func (*Map) Put

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

Inserts element into the map.

func (*Map) Remove

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

Remove the element from the map by key.

func (*Map) Size

func (m *Map) Size() int

Returns number of elements in the map.

func (*Map) String

func (m *Map) String() string

func (*Map) Values

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

Returns all values (random order).

Jump to

Keyboard shortcuts

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