arraymap

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 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 ArrayMap

type ArrayMap struct {
	// contains filtered or unexported fields
}

func New

func New() *ArrayMap

func NewWithSize

func NewWithSize(size, cap int) *ArrayMap

func (*ArrayMap) Add

func (m *ArrayMap) Add(value T) (key int)

Add adds a new element and returns the allocated key

func (*ArrayMap) Cap

func (m *ArrayMap) Cap() int

func (*ArrayMap) For

func (m *ArrayMap) For(visitor func(key int, value T) (broken bool))

For traversal the map

func (*ArrayMap) Get

func (m *ArrayMap) Get(key int) (value T, ok bool)

Get gets the value by key

func (*ArrayMap) Len

func (m *ArrayMap) Len() int

func (*ArrayMap) Remove

func (m *ArrayMap) Remove(key int) (value T, ok bool)

Remove removes the value by key

func (*ArrayMap) Update

func (m *ArrayMap) Update(key int, value T) bool

Update updates <key,value> Returns true if key is valid

type T

type T interface{}

Jump to

Keyboard shortcuts

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