dictionary

package
v0.0.0-...-da378b8 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package dictionary creates a ValueDictionary data structure for the Item type

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key generic.Type

Key the key of the dictionary

type Value

type Value generic.Type

Value the content of the dictionary

type ValueDictionary

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

ValueDictionary the set of Items

func (*ValueDictionary) Clear

func (d *ValueDictionary) Clear()

Clear removes all the items from the dictionary

func (*ValueDictionary) Delete

func (d *ValueDictionary) Delete(k Key) bool

Delete removes a value from the dictionary, given its key

func (*ValueDictionary) Get

func (d *ValueDictionary) Get(k Key) Value

Get returns the value associated with the key

func (*ValueDictionary) Has

func (d *ValueDictionary) Has(k Key) bool

Has returns true if the key exists in the dictionary

func (*ValueDictionary) Keys

func (d *ValueDictionary) Keys() []Key

Keys returns a slice of all the keys present

func (*ValueDictionary) Set

func (d *ValueDictionary) Set(k Key, v Value)

Set adds a new item to the dictionary

func (*ValueDictionary) Size

func (d *ValueDictionary) Size() int

Size returns the amount of elements in the dictionary

func (*ValueDictionary) Values

func (d *ValueDictionary) Values() []Value

Values returns a slice of all the values present

Jump to

Keyboard shortcuts

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