uint32set

package
v2.9.60+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2016 License: MIT Imports: 0 Imported by: 0

README

qlang.io/app/eql/example/uint32set.v1

uint32set.Type is a set of uint32, implemented via map[uint32]struct{} for minimal memory consumption.

Here is an example:

import (
	"qlang.io/app/eql/example/uint32set.v1"
)

set := uint32set.New(1, 2)
set.Add(3)

if set.Has(4) {
	println("set has item `4`")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Type

type Type map[uint32]empty

Type is a set of uint32, implemented via map[uint32]struct{} for minimal memory consumption.

func New

func New(items ...uint32) Type

New creates a Type from a list of values.

func (Type) Add

func (s Type) Add(item uint32)

Add adds one item to the set.

func (Type) Delete

func (s Type) Delete(items ...uint32)

Delete removes all items from the set.

func (Type) Has

func (s Type) Has(item uint32) bool

Has returns true iff item is contained in the set.

func (Type) HasAll

func (s Type) HasAll(items ...uint32) bool

HasAll returns true iff all items are contained in the set.

func (Type) Insert

func (s Type) Insert(items ...uint32)

Insert adds items to the set.

func (Type) IsSuperset

func (s Type) IsSuperset(s2 Type) bool

IsSuperset returns true iff s1 is a superset of s2.

func (Type) Len

func (s Type) Len() int

Len returns the size of the set.

Jump to

Keyboard shortcuts

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