intset

package
v0.0.0-...-748bbab Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Example (One)
//!+main
var x, y IntSet
x.Add(1)
x.Add(144)
x.Add(9)
fmt.Println(x.String()) // "{1 9 144}"

y.Add(9)
y.Add(42)
fmt.Println(y.String()) // "{9 42}"

x.UnionWith(&y)
fmt.Println(x.String()) // "{1 9 42 144}"

fmt.Println(x.Has(9), x.Has(123)) // "true false"
//!-main
Output:

{1 9 144}
{9 42}
{1 9 42 144}
true false
Example (Two)
var x IntSet
x.Add(1)
x.Add(144)
x.Add(9)
x.Add(42)

//!+note
fmt.Println(&x)         // "{1 9 42 144}"
fmt.Println(x.String()) // "{1 9 42 144}"
fmt.Println(x)          // "{[4398046511618 0 65536]}"
//!-note
Output:

{1 9 42 144}
{1 9 42 144}
{[4398046511618 0 65536]}

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntSet

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

func (*IntSet) Add

func (s *IntSet) Add(x int)

func (*IntSet) AddAll

func (s *IntSet) AddAll(xs ...int)

func (*IntSet) Clear

func (s *IntSet) Clear()

func (*IntSet) Copy

func (s *IntSet) Copy() *IntSet

func (*IntSet) Has

func (s *IntSet) Has(x int) bool

func (*IntSet) Len

func (s *IntSet) Len() int

func (*IntSet) Remove

func (s *IntSet) Remove(x int)

func (*IntSet) String

func (s *IntSet) String() string

func (*IntSet) UnionWith

func (s *IntSet) UnionWith(t *IntSet)

Jump to

Keyboard shortcuts

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