fastinteger

package
v0.0.0-...-41349f7 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2015 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FastIntegerHashMap

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

FastIntegerHashMap is a simple hashmap to be used with integer only keys. It supports few operations, and is designed primarily for cases where the consumer needs a very simple datastructure to set and check for existence of integer keys over a sparse range.

func New

func New(hint uint64) *FastIntegerHashMap

New returns a new FastIntegerHashMap with a bucket size specified by hint.

func (*FastIntegerHashMap) Cap

func (fi *FastIntegerHashMap) Cap() uint64

Cap returns the capacity of the hashmap.

func (*FastIntegerHashMap) Delete

func (fi *FastIntegerHashMap) Delete(key uint64)

Delete will remove the provided key from the hashmap. If the key cannot be found, this is a no-op.

func (*FastIntegerHashMap) Exists

func (fi *FastIntegerHashMap) Exists(key uint64) bool

Exists will return a bool indicating if the provided key exists in the map.

func (*FastIntegerHashMap) Get

func (fi *FastIntegerHashMap) Get(key uint64) (uint64, bool)

Get returns an item from the map if it exists. Otherwise, returns false for the second argument.

func (*FastIntegerHashMap) Len

func (fi *FastIntegerHashMap) Len() uint64

Len returns the number of items in the hashmap.

func (*FastIntegerHashMap) Set

func (fi *FastIntegerHashMap) Set(key, value uint64)

Set will set the provided key with the provided value.

Jump to

Keyboard shortcuts

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