set

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 4 Imported by: 0

README

English | 简体中文

Set GoDoc Go Report Card

Set is an abstract data type that can store unique values, without any particular order implementation in Go.

Except for reference document Set (abstract data type) to define functions , It also implements some useful functions. for example: Each, EachE, List, SortedList and so on.

Install

Using go get command to get the latest version

go get github.com/SeananXu/go-set

Import it with:

import "github.com/SeananXu/go-set"

and use set as the package name inside the code.

Example

Initialization
// interface set
interfaceSet := set.NewInterface()

// int set
intSet := set.NewInt()

// int8 set
int8Set := set.NewInt8()

// int16 set
int16Set := set.NewInt16()

// int32 set
int32Set := set.NewInt32()

// int64 set
int64Set := set.NewInt64()

// float32 set
float32Set := set.NewFloat32()

// float64 set
float64Set := set.NewFloat64()

// uint set
uintSet := set.NewUint()

// uint8 set
uint8Set := set.NewUint8()

// uint16 set
uint16Set := set.NewUint16()

// uint32 set
uint32Set := set.NewUint32()

// uint64 set
uint64Set := set.NewUint64()

// uintptr set
uintptrSet := set.NewUintptr()

// string set
stringSet := set.NewString()
Basic Operations
// add element
s.Add("element")

// remove element
s.Remove("element")

// pop element
k, ok := s.Pop()

// clear set
s.Clear()

// the number of elements
size := s.Size()

// clone new set
t := s.Copy()

// returns the all elements as a slice
t := s.List()

// returns the all elements as a slice sorted by less func
s.SortedList(func(i, j interface{}) bool {
    return false
})

// returns string
str := s.String()
Iterator Operations
s.Each(func(i interface{}) {
    log.Println(i)
})

s.EachE(func(i interface{}) error {
    log.Println(i)
    return set.ErrBreakEach
})
Check Operations
// whether the set is Empty
b := s.IsEmpty()

// whether element exists in set
b := s.Has("element")

// whether all elements exist in set
b := s.HasAll("element1", "element2")

// whether at least one of the element exists in the set
b := s.HasAny("element1", "element2")

// predicates that tests whether the set s is a subset of set t
b := s.IsSuperset(t)

// predicates that tests whether the set s is a super of set t
b := s.IsSubset(t)

// predicates that tests whether the set s equals of set t
b := s.Equal(t)
Set Operations
// returns the union of sets s and t
s.Union(t)

// returns the intersection of sets s and t
s.Intersection(t)

// returns the difference of sets s and t
s.Difference(t)

// returns the symmetric difference of sets s and t
s.SymmetricDifference(t)

more case click here

Setgen

The Setgen command is used to generate source code for a set class given a type. It supports the following flags.

  • -s: Set name, default: element type add 's'.
  • -i: Import element package, default: don't import package.
  • -p: Generated go file package, default: directory name.
  • -t: Set storage element type, this options must be set.
  • -o: Output file name, default: set name add '.go'.
  • -l: Whether go file imports 'ErrBreakEach' of 'github.com/SeananXu/go-set', default: import.
  • -h: Help document.

Install

go get github.com/SeananXu/go-set/setgen

For example:

setgen -t Example

License

The MIT License (MIT) - see LICENSE for more details

Documentation

Overview

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package set implements a set backed by a hash map.

Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Index

Constants

This section is empty.

Variables

View Source
var ErrBreakEach = errors.New("break each func")

ErrBreakEach breaks that the EachE traverses the elements in the set.

Functions

This section is empty.

Types

type Float32

type Float32 map[float32]struct{}

Float32 is a float32 collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewFloat32

func NewFloat32(elements ...float32) Float32

NewFloat32 initializes a new Float32.

func NewFloat32WithSize

func NewFloat32WithSize(size int) Float32

NewFloat32WithSize initializes a new Float32 with the specified size.

func (Float32) Add

func (s Float32) Add(elements ...float32)

Add adds the elements to Float32, if it is not present already.

func (*Float32) Clear

func (s *Float32) Clear()

Clear removes all items from the Float32.

func (Float32) Copy

func (s Float32) Copy() Float32

Copy returns new Float32 that clones from Float32.

func (Float32) Difference

func (s Float32) Difference(t Float32) Float32

Difference returns the difference of Float32 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Float32) Each

func (s Float32) Each(do func(i float32))

Each traverses the elements in the Float32, calling do func for each Float32 member.

func (Float32) EachE

func (s Float32) EachE(do func(i float32) error) error

EachE traverses the elements in the Float32, calling do func for each Float32 member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Float32) Equal

func (s Float32) Equal(t Float32) bool

Equal predicates that tests whether the Float32 s equals of Float32 t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Float32) Has

func (s Float32) Has(element float32) bool

Has judges the specified element whether exists in the Float32. it returns true if existed, and false if not.

func (Float32) HasAll

func (s Float32) HasAll(elements ...float32) bool

HasAll looks for the specified elements to judge whether all exist in the Float32. it returns true if existed, and false if not.

func (Float32) HasAny

func (s Float32) HasAny(elements ...float32) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Float32. it returns true if existed, and false if not.

func (Float32) Intersection

func (s Float32) Intersection(t Float32) Float32

Intersection returns the intersection of Float32 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Float32) IsEmpty

func (s Float32) IsEmpty() bool

IsEmpty returns whether the Float32 is Empty.

func (Float32) IsSubset

func (s Float32) IsSubset(t Float32) bool

IsSubset predicates that tests whether the Float32 s is a subset of Float32 t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Float32) IsSuperset

func (s Float32) IsSuperset(t Float32) bool

IsSuperset predicates that tests whether the Float32 s is a super of Float32 t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Float32) List

func (s Float32) List() []float32

List returns the all elements as a slice.

func (Float32) Pop

func (s Float32) Pop() (float32, bool)

Pop returns an arbitrary element of Float32, deleting it from Float32. The second value is a bool that is true if the elements existed in the Float32, and false if not.

func (Float32) Remove

func (s Float32) Remove(elements ...float32)

Remove removes the element from Float32, if it is present.

func (Float32) Size

func (s Float32) Size() int

Size returns the number of elements in Float32.

func (Float32) SortedList

func (s Float32) SortedList(less func(i, j float32) bool) []float32

SortedList returns the all elements as a slice sorted by less func.

func (Float32) String

func (s Float32) String() string

String returns a string representation of Float32

func (Float32) SymmetricDifference

func (s Float32) SymmetricDifference(t Float32) Float32

SymmetricDifference returns a new Float32 with the elements that are either in this Float32 or in the given Float32, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Float32) Union

func (s Float32) Union(t Float32) Float32

Union returns the union of Float32 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Float64

type Float64 map[float64]struct{}

Float64 is a float64 collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewFloat64

func NewFloat64(elements ...float64) Float64

NewFloat64 initializes a new Float64.

func NewFloat64WithSize

func NewFloat64WithSize(size int) Float64

NewFloat64WithSize initializes a new Float64 with the specified size.

func (Float64) Add

func (s Float64) Add(elements ...float64)

Add adds the elements to Float64, if it is not present already.

func (*Float64) Clear

func (s *Float64) Clear()

Clear removes all items from the Float64.

func (Float64) Copy

func (s Float64) Copy() Float64

Copy returns new Float64 that clones from Float64.

func (Float64) Difference

func (s Float64) Difference(t Float64) Float64

Difference returns the difference of Float64 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Float64) Each

func (s Float64) Each(do func(i float64))

Each traverses the elements in the Float64, calling do func for each Float64 member.

func (Float64) EachE

func (s Float64) EachE(do func(i float64) error) error

EachE traverses the elements in the Float64, calling do func for each Float64 member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Float64) Equal

func (s Float64) Equal(t Float64) bool

Equal predicates that tests whether the Float64 s equals of Float64 t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Float64) Has

func (s Float64) Has(element float64) bool

Has judges the specified element whether exists in the Float64. it returns true if existed, and false if not.

func (Float64) HasAll

func (s Float64) HasAll(elements ...float64) bool

HasAll looks for the specified elements to judge whether all exist in the Float64. it returns true if existed, and false if not.

func (Float64) HasAny

func (s Float64) HasAny(elements ...float64) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Float64. it returns true if existed, and false if not.

func (Float64) Intersection

func (s Float64) Intersection(t Float64) Float64

Intersection returns the intersection of Float64 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Float64) IsEmpty

func (s Float64) IsEmpty() bool

IsEmpty returns whether the Float64 is Empty.

func (Float64) IsSubset

func (s Float64) IsSubset(t Float64) bool

IsSubset predicates that tests whether the Float64 s is a subset of Float64 t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Float64) IsSuperset

func (s Float64) IsSuperset(t Float64) bool

IsSuperset predicates that tests whether the Float64 s is a super of Float64 t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Float64) List

func (s Float64) List() []float64

List returns the all elements as a slice.

func (Float64) Pop

func (s Float64) Pop() (float64, bool)

Pop returns an arbitrary element of Float64, deleting it from Float64. The second value is a bool that is true if the elements existed in the Float64, and false if not.

func (Float64) Remove

func (s Float64) Remove(elements ...float64)

Remove removes the element from Float64, if it is present.

func (Float64) Size

func (s Float64) Size() int

Size returns the number of elements in Float64.

func (Float64) SortedList

func (s Float64) SortedList(less func(i, j float64) bool) []float64

SortedList returns the all elements as a slice sorted by less func.

func (Float64) String

func (s Float64) String() string

String returns a string representation of Float64

func (Float64) SymmetricDifference

func (s Float64) SymmetricDifference(t Float64) Float64

SymmetricDifference returns a new Float64 with the elements that are either in this Float64 or in the given Float64, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Float64) Union

func (s Float64) Union(t Float64) Float64

Union returns the union of Float64 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Int

type Int map[int]struct{}

Int is a int collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewInt

func NewInt(elements ...int) Int

NewInt initializes a new Int.

func NewIntWithSize

func NewIntWithSize(size int) Int

NewIntWithSize initializes a new Int with the specified size.

func (Int) Add

func (s Int) Add(elements ...int)

Add adds the elements to Int, if it is not present already.

func (*Int) Clear

func (s *Int) Clear()

Clear removes all items from the Int.

func (Int) Copy

func (s Int) Copy() Int

Copy returns new Int that clones from Int.

func (Int) Difference

func (s Int) Difference(t Int) Int

Difference returns the difference of Int s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Int) Each

func (s Int) Each(do func(i int))

Each traverses the elements in the Int, calling do func for each Int member.

func (Int) EachE

func (s Int) EachE(do func(i int) error) error

EachE traverses the elements in the Int, calling do func for each Int member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Int) Equal

func (s Int) Equal(t Int) bool

Equal predicates that tests whether the Int s equals of Int t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Int) Has

func (s Int) Has(element int) bool

Has judges the specified element whether exists in the Int. it returns true if existed, and false if not.

func (Int) HasAll

func (s Int) HasAll(elements ...int) bool

HasAll looks for the specified elements to judge whether all exist in the Int. it returns true if existed, and false if not.

func (Int) HasAny

func (s Int) HasAny(elements ...int) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Int. it returns true if existed, and false if not.

func (Int) Intersection

func (s Int) Intersection(t Int) Int

Intersection returns the intersection of Int s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Int) IsEmpty

func (s Int) IsEmpty() bool

IsEmpty returns whether the Int is Empty.

func (Int) IsSubset

func (s Int) IsSubset(t Int) bool

IsSubset predicates that tests whether the Int s is a subset of Int t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Int) IsSuperset

func (s Int) IsSuperset(t Int) bool

IsSuperset predicates that tests whether the Int s is a super of Int t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Int) List

func (s Int) List() []int

List returns the all elements as a slice.

func (Int) Pop

func (s Int) Pop() (int, bool)

Pop returns an arbitrary element of Int, deleting it from Int. The second value is a bool that is true if the elements existed in the Int, and false if not.

func (Int) Remove

func (s Int) Remove(elements ...int)

Remove removes the element from Int, if it is present.

func (Int) Size

func (s Int) Size() int

Size returns the number of elements in Int.

func (Int) SortedList

func (s Int) SortedList(less func(i, j int) bool) []int

SortedList returns the all elements as a slice sorted by less func.

func (Int) String

func (s Int) String() string

String returns a string representation of Int

func (Int) SymmetricDifference

func (s Int) SymmetricDifference(t Int) Int

SymmetricDifference returns a new Int with the elements that are either in this Int or in the given Int, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Int) Union

func (s Int) Union(t Int) Int

Union returns the union of Int s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Int16 added in v0.0.2

type Int16 map[int16]struct{}

Int16 is a int16 collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewInt16 added in v0.0.2

func NewInt16(elements ...int16) Int16

NewInt16 initializes a new Int16.

func NewInt16WithSize added in v0.0.2

func NewInt16WithSize(size int) Int16

NewInt16WithSize initializes a new Int16 with the specified size.

func (Int16) Add added in v0.0.2

func (s Int16) Add(elements ...int16)

Add adds the elements to Int16, if it is not present already.

func (*Int16) Clear added in v0.0.2

func (s *Int16) Clear()

Clear removes all items from the Int16.

func (Int16) Copy added in v0.0.2

func (s Int16) Copy() Int16

Copy returns new Int16 that clones from Int16.

func (Int16) Difference added in v0.0.2

func (s Int16) Difference(t Int16) Int16

Difference returns the difference of Int16 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Int16) Each added in v0.0.2

func (s Int16) Each(do func(i int16))

Each traverses the elements in the Int16, calling do func for each Int16 member.

func (Int16) EachE added in v0.0.2

func (s Int16) EachE(do func(i int16) error) error

EachE traverses the elements in the Int16, calling do func for each Int16 member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Int16) Equal added in v0.0.2

func (s Int16) Equal(t Int16) bool

Equal predicates that tests whether the Int16 s equals of Int16 t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Int16) Has added in v0.0.2

func (s Int16) Has(element int16) bool

Has judges the specified element whether exists in the Int16. it returns true if existed, and false if not.

func (Int16) HasAll added in v0.0.2

func (s Int16) HasAll(elements ...int16) bool

HasAll looks for the specified elements to judge whether all exist in the Int16. it returns true if existed, and false if not.

func (Int16) HasAny added in v0.0.2

func (s Int16) HasAny(elements ...int16) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Int16. it returns true if existed, and false if not.

func (Int16) Intersection added in v0.0.2

func (s Int16) Intersection(t Int16) Int16

Intersection returns the intersection of Int16 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Int16) IsEmpty added in v0.0.2

func (s Int16) IsEmpty() bool

IsEmpty returns whether the Int16 is Empty.

func (Int16) IsSubset added in v0.0.2

func (s Int16) IsSubset(t Int16) bool

IsSubset predicates that tests whether the Int16 s is a subset of Int16 t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Int16) IsSuperset added in v0.0.2

func (s Int16) IsSuperset(t Int16) bool

IsSuperset predicates that tests whether the Int16 s is a super of Int16 t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Int16) List added in v0.0.2

func (s Int16) List() []int16

List returns the all elements as a slice.

func (Int16) Pop added in v0.0.2

func (s Int16) Pop() (int16, bool)

Pop returns an arbitrary element of Int16, deleting it from Int16. The second value is a bool that is true if the elements existed in the Int16, and false if not.

func (Int16) Remove added in v0.0.2

func (s Int16) Remove(elements ...int16)

Remove removes the element from Int16, if it is present.

func (Int16) Size added in v0.0.2

func (s Int16) Size() int

Size returns the number of elements in Int16.

func (Int16) SortedList added in v0.0.2

func (s Int16) SortedList(less func(i, j int16) bool) []int16

SortedList returns the all elements as a slice sorted by less func.

func (Int16) String added in v0.0.2

func (s Int16) String() string

String returns a string representation of Int16

func (Int16) SymmetricDifference added in v0.0.2

func (s Int16) SymmetricDifference(t Int16) Int16

SymmetricDifference returns a new Int16 with the elements that are either in this Int16 or in the given Int16, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Int16) Union added in v0.0.2

func (s Int16) Union(t Int16) Int16

Union returns the union of Int16 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Int32 added in v0.0.2

type Int32 map[int32]struct{}

Int32 is a int32 collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewInt32 added in v0.0.2

func NewInt32(elements ...int32) Int32

NewInt32 initializes a new Int32.

func NewInt32WithSize added in v0.0.2

func NewInt32WithSize(size int) Int32

NewInt32WithSize initializes a new Int32 with the specified size.

func (Int32) Add added in v0.0.2

func (s Int32) Add(elements ...int32)

Add adds the elements to Int32, if it is not present already.

func (*Int32) Clear added in v0.0.2

func (s *Int32) Clear()

Clear removes all items from the Int32.

func (Int32) Copy added in v0.0.2

func (s Int32) Copy() Int32

Copy returns new Int32 that clones from Int32.

func (Int32) Difference added in v0.0.2

func (s Int32) Difference(t Int32) Int32

Difference returns the difference of Int32 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Int32) Each added in v0.0.2

func (s Int32) Each(do func(i int32))

Each traverses the elements in the Int32, calling do func for each Int32 member.

func (Int32) EachE added in v0.0.2

func (s Int32) EachE(do func(i int32) error) error

EachE traverses the elements in the Int32, calling do func for each Int32 member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Int32) Equal added in v0.0.2

func (s Int32) Equal(t Int32) bool

Equal predicates that tests whether the Int32 s equals of Int32 t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Int32) Has added in v0.0.2

func (s Int32) Has(element int32) bool

Has judges the specified element whether exists in the Int32. it returns true if existed, and false if not.

func (Int32) HasAll added in v0.0.2

func (s Int32) HasAll(elements ...int32) bool

HasAll looks for the specified elements to judge whether all exist in the Int32. it returns true if existed, and false if not.

func (Int32) HasAny added in v0.0.2

func (s Int32) HasAny(elements ...int32) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Int32. it returns true if existed, and false if not.

func (Int32) Intersection added in v0.0.2

func (s Int32) Intersection(t Int32) Int32

Intersection returns the intersection of Int32 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Int32) IsEmpty added in v0.0.2

func (s Int32) IsEmpty() bool

IsEmpty returns whether the Int32 is Empty.

func (Int32) IsSubset added in v0.0.2

func (s Int32) IsSubset(t Int32) bool

IsSubset predicates that tests whether the Int32 s is a subset of Int32 t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Int32) IsSuperset added in v0.0.2

func (s Int32) IsSuperset(t Int32) bool

IsSuperset predicates that tests whether the Int32 s is a super of Int32 t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Int32) List added in v0.0.2

func (s Int32) List() []int32

List returns the all elements as a slice.

func (Int32) Pop added in v0.0.2

func (s Int32) Pop() (int32, bool)

Pop returns an arbitrary element of Int32, deleting it from Int32. The second value is a bool that is true if the elements existed in the Int32, and false if not.

func (Int32) Remove added in v0.0.2

func (s Int32) Remove(elements ...int32)

Remove removes the element from Int32, if it is present.

func (Int32) Size added in v0.0.2

func (s Int32) Size() int

Size returns the number of elements in Int32.

func (Int32) SortedList added in v0.0.2

func (s Int32) SortedList(less func(i, j int32) bool) []int32

SortedList returns the all elements as a slice sorted by less func.

func (Int32) String added in v0.0.2

func (s Int32) String() string

String returns a string representation of Int32

func (Int32) SymmetricDifference added in v0.0.2

func (s Int32) SymmetricDifference(t Int32) Int32

SymmetricDifference returns a new Int32 with the elements that are either in this Int32 or in the given Int32, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Int32) Union added in v0.0.2

func (s Int32) Union(t Int32) Int32

Union returns the union of Int32 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Int64

type Int64 map[int64]struct{}

Int64 is a int64 collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewInt64

func NewInt64(elements ...int64) Int64

NewInt64 initializes a new Int64.

func NewInt64WithSize

func NewInt64WithSize(size int) Int64

NewInt64WithSize initializes a new Int64 with the specified size.

func (Int64) Add

func (s Int64) Add(elements ...int64)

Add adds the elements to Int64, if it is not present already.

func (*Int64) Clear

func (s *Int64) Clear()

Clear removes all items from the Int64.

func (Int64) Copy

func (s Int64) Copy() Int64

Copy returns new Int64 that clones from Int64.

func (Int64) Difference

func (s Int64) Difference(t Int64) Int64

Difference returns the difference of Int64 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Int64) Each

func (s Int64) Each(do func(i int64))

Each traverses the elements in the Int64, calling do func for each Int64 member.

func (Int64) EachE

func (s Int64) EachE(do func(i int64) error) error

EachE traverses the elements in the Int64, calling do func for each Int64 member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Int64) Equal

func (s Int64) Equal(t Int64) bool

Equal predicates that tests whether the Int64 s equals of Int64 t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Int64) Has

func (s Int64) Has(element int64) bool

Has judges the specified element whether exists in the Int64. it returns true if existed, and false if not.

func (Int64) HasAll

func (s Int64) HasAll(elements ...int64) bool

HasAll looks for the specified elements to judge whether all exist in the Int64. it returns true if existed, and false if not.

func (Int64) HasAny

func (s Int64) HasAny(elements ...int64) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Int64. it returns true if existed, and false if not.

func (Int64) Intersection

func (s Int64) Intersection(t Int64) Int64

Intersection returns the intersection of Int64 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Int64) IsEmpty

func (s Int64) IsEmpty() bool

IsEmpty returns whether the Int64 is Empty.

func (Int64) IsSubset

func (s Int64) IsSubset(t Int64) bool

IsSubset predicates that tests whether the Int64 s is a subset of Int64 t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Int64) IsSuperset

func (s Int64) IsSuperset(t Int64) bool

IsSuperset predicates that tests whether the Int64 s is a super of Int64 t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Int64) List

func (s Int64) List() []int64

List returns the all elements as a slice.

func (Int64) Pop

func (s Int64) Pop() (int64, bool)

Pop returns an arbitrary element of Int64, deleting it from Int64. The second value is a bool that is true if the elements existed in the Int64, and false if not.

func (Int64) Remove

func (s Int64) Remove(elements ...int64)

Remove removes the element from Int64, if it is present.

func (Int64) Size

func (s Int64) Size() int

Size returns the number of elements in Int64.

func (Int64) SortedList

func (s Int64) SortedList(less func(i, j int64) bool) []int64

SortedList returns the all elements as a slice sorted by less func.

func (Int64) String

func (s Int64) String() string

String returns a string representation of Int64

func (Int64) SymmetricDifference

func (s Int64) SymmetricDifference(t Int64) Int64

SymmetricDifference returns a new Int64 with the elements that are either in this Int64 or in the given Int64, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Int64) Union

func (s Int64) Union(t Int64) Int64

Union returns the union of Int64 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Int8 added in v0.0.2

type Int8 map[int8]struct{}

Int8 is a int8 collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewInt8 added in v0.0.2

func NewInt8(elements ...int8) Int8

NewInt8 initializes a new Int8.

func NewInt8WithSize added in v0.0.2

func NewInt8WithSize(size int) Int8

NewInt8WithSize initializes a new Int8 with the specified size.

func (Int8) Add added in v0.0.2

func (s Int8) Add(elements ...int8)

Add adds the elements to Int8, if it is not present already.

func (*Int8) Clear added in v0.0.2

func (s *Int8) Clear()

Clear removes all items from the Int8.

func (Int8) Copy added in v0.0.2

func (s Int8) Copy() Int8

Copy returns new Int8 that clones from Int8.

func (Int8) Difference added in v0.0.2

func (s Int8) Difference(t Int8) Int8

Difference returns the difference of Int8 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Int8) Each added in v0.0.2

func (s Int8) Each(do func(i int8))

Each traverses the elements in the Int8, calling do func for each Int8 member.

func (Int8) EachE added in v0.0.2

func (s Int8) EachE(do func(i int8) error) error

EachE traverses the elements in the Int8, calling do func for each Int8 member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Int8) Equal added in v0.0.2

func (s Int8) Equal(t Int8) bool

Equal predicates that tests whether the Int8 s equals of Int8 t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Int8) Has added in v0.0.2

func (s Int8) Has(element int8) bool

Has judges the specified element whether exists in the Int8. it returns true if existed, and false if not.

func (Int8) HasAll added in v0.0.2

func (s Int8) HasAll(elements ...int8) bool

HasAll looks for the specified elements to judge whether all exist in the Int8. it returns true if existed, and false if not.

func (Int8) HasAny added in v0.0.2

func (s Int8) HasAny(elements ...int8) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Int8. it returns true if existed, and false if not.

func (Int8) Intersection added in v0.0.2

func (s Int8) Intersection(t Int8) Int8

Intersection returns the intersection of Int8 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Int8) IsEmpty added in v0.0.2

func (s Int8) IsEmpty() bool

IsEmpty returns whether the Int8 is Empty.

func (Int8) IsSubset added in v0.0.2

func (s Int8) IsSubset(t Int8) bool

IsSubset predicates that tests whether the Int8 s is a subset of Int8 t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Int8) IsSuperset added in v0.0.2

func (s Int8) IsSuperset(t Int8) bool

IsSuperset predicates that tests whether the Int8 s is a super of Int8 t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Int8) List added in v0.0.2

func (s Int8) List() []int8

List returns the all elements as a slice.

func (Int8) Pop added in v0.0.2

func (s Int8) Pop() (int8, bool)

Pop returns an arbitrary element of Int8, deleting it from Int8. The second value is a bool that is true if the elements existed in the Int8, and false if not.

func (Int8) Remove added in v0.0.2

func (s Int8) Remove(elements ...int8)

Remove removes the element from Int8, if it is present.

func (Int8) Size added in v0.0.2

func (s Int8) Size() int

Size returns the number of elements in Int8.

func (Int8) SortedList added in v0.0.2

func (s Int8) SortedList(less func(i, j int8) bool) []int8

SortedList returns the all elements as a slice sorted by less func.

func (Int8) String added in v0.0.2

func (s Int8) String() string

String returns a string representation of Int8

func (Int8) SymmetricDifference added in v0.0.2

func (s Int8) SymmetricDifference(t Int8) Int8

SymmetricDifference returns a new Int8 with the elements that are either in this Int8 or in the given Int8, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Int8) Union added in v0.0.2

func (s Int8) Union(t Int8) Int8

Union returns the union of Int8 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Interface

type Interface map[interface{}]struct{}

Interface is a interface{} collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewInterface

func NewInterface(elements ...interface{}) Interface

NewInterface initializes a new Interface.

func NewInterfaceWithSize

func NewInterfaceWithSize(size int) Interface

NewInterfaceWithSize initializes a new Interface with the specified size.

func (Interface) Add

func (s Interface) Add(elements ...interface{})

Add adds the elements to Interface, if it is not present already.

func (*Interface) Clear

func (s *Interface) Clear()

Clear removes all items from the Interface.

func (Interface) Copy

func (s Interface) Copy() Interface

Copy returns new Interface that clones from Interface.

func (Interface) Difference

func (s Interface) Difference(t Interface) Interface

Difference returns the difference of Interface s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Interface) Each

func (s Interface) Each(do func(i interface{}))

Each traverses the elements in the Interface, calling do func for each Interface member.

func (Interface) EachE

func (s Interface) EachE(do func(i interface{}) error) error

EachE traverses the elements in the Interface, calling do func for each Interface member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Interface) Equal

func (s Interface) Equal(t Interface) bool

Equal predicates that tests whether the Interface s equals of Interface t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Interface) Has

func (s Interface) Has(element interface{}) bool

Has judges the specified element whether exists in the Interface. it returns true if existed, and false if not.

func (Interface) HasAll

func (s Interface) HasAll(elements ...interface{}) bool

HasAll looks for the specified elements to judge whether all exist in the Interface. it returns true if existed, and false if not.

func (Interface) HasAny

func (s Interface) HasAny(elements ...interface{}) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Interface. it returns true if existed, and false if not.

func (Interface) Intersection

func (s Interface) Intersection(t Interface) Interface

Intersection returns the intersection of Interface s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Interface) IsEmpty

func (s Interface) IsEmpty() bool

IsEmpty returns whether the Interface is Empty.

func (Interface) IsSubset

func (s Interface) IsSubset(t Interface) bool

IsSubset predicates that tests whether the Interface s is a subset of Interface t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Interface) IsSuperset

func (s Interface) IsSuperset(t Interface) bool

IsSuperset predicates that tests whether the Interface s is a super of Interface t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Interface) List

func (s Interface) List() []interface{}

List returns the all elements as a slice.

func (Interface) Pop

func (s Interface) Pop() (interface{}, bool)

Pop returns an arbitrary element of Interface, deleting it from Interface. The second value is a bool that is true if the elements existed in the Interface, and false if not.

func (Interface) Remove

func (s Interface) Remove(elements ...interface{})

Remove removes the element from Interface, if it is present.

func (Interface) Size

func (s Interface) Size() int

Size returns the number of elements in Interface.

func (Interface) SortedList

func (s Interface) SortedList(less func(i, j interface{}) bool) []interface{}

SortedList returns the all elements as a slice sorted by less func.

func (Interface) String

func (s Interface) String() string

String returns a string representation of Interface

func (Interface) SymmetricDifference

func (s Interface) SymmetricDifference(t Interface) Interface

SymmetricDifference returns a new Interface with the elements that are either in this Interface or in the given Interface, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Interface) Union

func (s Interface) Union(t Interface) Interface

Union returns the union of Interface s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type String

type String map[string]struct{}

String is a string collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewString

func NewString(elements ...string) String

NewString initializes a new String.

func NewStringWithSize

func NewStringWithSize(size int) String

NewStringWithSize initializes a new String with the specified size.

func (String) Add

func (s String) Add(elements ...string)

Add adds the elements to String, if it is not present already.

func (*String) Clear

func (s *String) Clear()

Clear removes all items from the String.

func (String) Copy

func (s String) Copy() String

Copy returns new String that clones from String.

func (String) Difference

func (s String) Difference(t String) String

Difference returns the difference of String s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (String) Each

func (s String) Each(do func(i string))

Each traverses the elements in the String, calling do func for each String member.

func (String) EachE

func (s String) EachE(do func(i string) error) error

EachE traverses the elements in the String, calling do func for each String member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (String) Equal

func (s String) Equal(t String) bool

Equal predicates that tests whether the String s equals of String t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (String) Has

func (s String) Has(element string) bool

Has judges the specified element whether exists in the String. it returns true if existed, and false if not.

func (String) HasAll

func (s String) HasAll(elements ...string) bool

HasAll looks for the specified elements to judge whether all exist in the String. it returns true if existed, and false if not.

func (String) HasAny

func (s String) HasAny(elements ...string) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the String. it returns true if existed, and false if not.

func (String) Intersection

func (s String) Intersection(t String) String

Intersection returns the intersection of String s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (String) IsEmpty

func (s String) IsEmpty() bool

IsEmpty returns whether the String is Empty.

func (String) IsSubset

func (s String) IsSubset(t String) bool

IsSubset predicates that tests whether the String s is a subset of String t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (String) IsSuperset

func (s String) IsSuperset(t String) bool

IsSuperset predicates that tests whether the String s is a super of String t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (String) List

func (s String) List() []string

List returns the all elements as a slice.

func (String) Pop

func (s String) Pop() (string, bool)

Pop returns an arbitrary element of String, deleting it from String. The second value is a bool that is true if the elements existed in the String, and false if not.

func (String) Remove

func (s String) Remove(elements ...string)

Remove removes the element from String, if it is present.

func (String) Size

func (s String) Size() int

Size returns the number of elements in String.

func (String) SortedList

func (s String) SortedList(less func(i, j string) bool) []string

SortedList returns the all elements as a slice sorted by less func.

func (String) String

func (s String) String() string

String returns a string representation of String

func (String) SymmetricDifference

func (s String) SymmetricDifference(t String) String

SymmetricDifference returns a new String with the elements that are either in this String or in the given String, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (String) Union

func (s String) Union(t String) String

Union returns the union of String s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Uint added in v0.0.2

type Uint map[uint]struct{}

Uint is a uint collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewUint added in v0.0.2

func NewUint(elements ...uint) Uint

NewUint initializes a new Uint.

func NewUintWithSize added in v0.0.2

func NewUintWithSize(size int) Uint

NewUintWithSize initializes a new Uint with the specified size.

func (Uint) Add added in v0.0.2

func (s Uint) Add(elements ...uint)

Add adds the elements to Uint, if it is not present already.

func (*Uint) Clear added in v0.0.2

func (s *Uint) Clear()

Clear removes all items from the Uint.

func (Uint) Copy added in v0.0.2

func (s Uint) Copy() Uint

Copy returns new Uint that clones from Uint.

func (Uint) Difference added in v0.0.2

func (s Uint) Difference(t Uint) Uint

Difference returns the difference of Uint s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Uint) Each added in v0.0.2

func (s Uint) Each(do func(i uint))

Each traverses the elements in the Uint, calling do func for each Uint member.

func (Uint) EachE added in v0.0.2

func (s Uint) EachE(do func(i uint) error) error

EachE traverses the elements in the Uint, calling do func for each Uint member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Uint) Equal added in v0.0.2

func (s Uint) Equal(t Uint) bool

Equal predicates that tests whether the Uint s equals of Uint t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Uint) Has added in v0.0.2

func (s Uint) Has(element uint) bool

Has judges the specified element whether exists in the Uint. it returns true if existed, and false if not.

func (Uint) HasAll added in v0.0.2

func (s Uint) HasAll(elements ...uint) bool

HasAll looks for the specified elements to judge whether all exist in the Uint. it returns true if existed, and false if not.

func (Uint) HasAny added in v0.0.2

func (s Uint) HasAny(elements ...uint) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Uint. it returns true if existed, and false if not.

func (Uint) Intersection added in v0.0.2

func (s Uint) Intersection(t Uint) Uint

Intersection returns the intersection of Uint s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Uint) IsEmpty added in v0.0.2

func (s Uint) IsEmpty() bool

IsEmpty returns whether the Uint is Empty.

func (Uint) IsSubset added in v0.0.2

func (s Uint) IsSubset(t Uint) bool

IsSubset predicates that tests whether the Uint s is a subset of Uint t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Uint) IsSuperset added in v0.0.2

func (s Uint) IsSuperset(t Uint) bool

IsSuperset predicates that tests whether the Uint s is a super of Uint t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Uint) List added in v0.0.2

func (s Uint) List() []uint

List returns the all elements as a slice.

func (Uint) Pop added in v0.0.2

func (s Uint) Pop() (uint, bool)

Pop returns an arbitrary element of Uint, deleting it from Uint. The second value is a bool that is true if the elements existed in the Uint, and false if not.

func (Uint) Remove added in v0.0.2

func (s Uint) Remove(elements ...uint)

Remove removes the element from Uint, if it is present.

func (Uint) Size added in v0.0.2

func (s Uint) Size() int

Size returns the number of elements in Uint.

func (Uint) SortedList added in v0.0.2

func (s Uint) SortedList(less func(i, j uint) bool) []uint

SortedList returns the all elements as a slice sorted by less func.

func (Uint) String added in v0.0.2

func (s Uint) String() string

String returns a string representation of Uint

func (Uint) SymmetricDifference added in v0.0.2

func (s Uint) SymmetricDifference(t Uint) Uint

SymmetricDifference returns a new Uint with the elements that are either in this Uint or in the given Uint, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Uint) Union added in v0.0.2

func (s Uint) Union(t Uint) Uint

Union returns the union of Uint s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Uint16 added in v0.0.2

type Uint16 map[uint16]struct{}

Uint16 is a uint16 collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewUint16 added in v0.0.2

func NewUint16(elements ...uint16) Uint16

NewUint16 initializes a new Uint16.

func NewUint16WithSize added in v0.0.2

func NewUint16WithSize(size int) Uint16

NewUint16WithSize initializes a new Uint16 with the specified size.

func (Uint16) Add added in v0.0.2

func (s Uint16) Add(elements ...uint16)

Add adds the elements to Uint16, if it is not present already.

func (*Uint16) Clear added in v0.0.2

func (s *Uint16) Clear()

Clear removes all items from the Uint16.

func (Uint16) Copy added in v0.0.2

func (s Uint16) Copy() Uint16

Copy returns new Uint16 that clones from Uint16.

func (Uint16) Difference added in v0.0.2

func (s Uint16) Difference(t Uint16) Uint16

Difference returns the difference of Uint16 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Uint16) Each added in v0.0.2

func (s Uint16) Each(do func(i uint16))

Each traverses the elements in the Uint16, calling do func for each Uint16 member.

func (Uint16) EachE added in v0.0.2

func (s Uint16) EachE(do func(i uint16) error) error

EachE traverses the elements in the Uint16, calling do func for each Uint16 member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Uint16) Equal added in v0.0.2

func (s Uint16) Equal(t Uint16) bool

Equal predicates that tests whether the Uint16 s equals of Uint16 t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Uint16) Has added in v0.0.2

func (s Uint16) Has(element uint16) bool

Has judges the specified element whether exists in the Uint16. it returns true if existed, and false if not.

func (Uint16) HasAll added in v0.0.2

func (s Uint16) HasAll(elements ...uint16) bool

HasAll looks for the specified elements to judge whether all exist in the Uint16. it returns true if existed, and false if not.

func (Uint16) HasAny added in v0.0.2

func (s Uint16) HasAny(elements ...uint16) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Uint16. it returns true if existed, and false if not.

func (Uint16) Intersection added in v0.0.2

func (s Uint16) Intersection(t Uint16) Uint16

Intersection returns the intersection of Uint16 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Uint16) IsEmpty added in v0.0.2

func (s Uint16) IsEmpty() bool

IsEmpty returns whether the Uint16 is Empty.

func (Uint16) IsSubset added in v0.0.2

func (s Uint16) IsSubset(t Uint16) bool

IsSubset predicates that tests whether the Uint16 s is a subset of Uint16 t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Uint16) IsSuperset added in v0.0.2

func (s Uint16) IsSuperset(t Uint16) bool

IsSuperset predicates that tests whether the Uint16 s is a super of Uint16 t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Uint16) List added in v0.0.2

func (s Uint16) List() []uint16

List returns the all elements as a slice.

func (Uint16) Pop added in v0.0.2

func (s Uint16) Pop() (uint16, bool)

Pop returns an arbitrary element of Uint16, deleting it from Uint16. The second value is a bool that is true if the elements existed in the Uint16, and false if not.

func (Uint16) Remove added in v0.0.2

func (s Uint16) Remove(elements ...uint16)

Remove removes the element from Uint16, if it is present.

func (Uint16) Size added in v0.0.2

func (s Uint16) Size() int

Size returns the number of elements in Uint16.

func (Uint16) SortedList added in v0.0.2

func (s Uint16) SortedList(less func(i, j uint16) bool) []uint16

SortedList returns the all elements as a slice sorted by less func.

func (Uint16) String added in v0.0.2

func (s Uint16) String() string

String returns a string representation of Uint16

func (Uint16) SymmetricDifference added in v0.0.2

func (s Uint16) SymmetricDifference(t Uint16) Uint16

SymmetricDifference returns a new Uint16 with the elements that are either in this Uint16 or in the given Uint16, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Uint16) Union added in v0.0.2

func (s Uint16) Union(t Uint16) Uint16

Union returns the union of Uint16 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Uint32 added in v0.0.2

type Uint32 map[uint32]struct{}

Uint32 is a uint32 collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewUint32 added in v0.0.2

func NewUint32(elements ...uint32) Uint32

NewUint32 initializes a new Uint32.

func NewUint32WithSize added in v0.0.2

func NewUint32WithSize(size int) Uint32

NewUint32WithSize initializes a new Uint32 with the specified size.

func (Uint32) Add added in v0.0.2

func (s Uint32) Add(elements ...uint32)

Add adds the elements to Uint32, if it is not present already.

func (*Uint32) Clear added in v0.0.2

func (s *Uint32) Clear()

Clear removes all items from the Uint32.

func (Uint32) Copy added in v0.0.2

func (s Uint32) Copy() Uint32

Copy returns new Uint32 that clones from Uint32.

func (Uint32) Difference added in v0.0.2

func (s Uint32) Difference(t Uint32) Uint32

Difference returns the difference of Uint32 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Uint32) Each added in v0.0.2

func (s Uint32) Each(do func(i uint32))

Each traverses the elements in the Uint32, calling do func for each Uint32 member.

func (Uint32) EachE added in v0.0.2

func (s Uint32) EachE(do func(i uint32) error) error

EachE traverses the elements in the Uint32, calling do func for each Uint32 member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Uint32) Equal added in v0.0.2

func (s Uint32) Equal(t Uint32) bool

Equal predicates that tests whether the Uint32 s equals of Uint32 t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Uint32) Has added in v0.0.2

func (s Uint32) Has(element uint32) bool

Has judges the specified element whether exists in the Uint32. it returns true if existed, and false if not.

func (Uint32) HasAll added in v0.0.2

func (s Uint32) HasAll(elements ...uint32) bool

HasAll looks for the specified elements to judge whether all exist in the Uint32. it returns true if existed, and false if not.

func (Uint32) HasAny added in v0.0.2

func (s Uint32) HasAny(elements ...uint32) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Uint32. it returns true if existed, and false if not.

func (Uint32) Intersection added in v0.0.2

func (s Uint32) Intersection(t Uint32) Uint32

Intersection returns the intersection of Uint32 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Uint32) IsEmpty added in v0.0.2

func (s Uint32) IsEmpty() bool

IsEmpty returns whether the Uint32 is Empty.

func (Uint32) IsSubset added in v0.0.2

func (s Uint32) IsSubset(t Uint32) bool

IsSubset predicates that tests whether the Uint32 s is a subset of Uint32 t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Uint32) IsSuperset added in v0.0.2

func (s Uint32) IsSuperset(t Uint32) bool

IsSuperset predicates that tests whether the Uint32 s is a super of Uint32 t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Uint32) List added in v0.0.2

func (s Uint32) List() []uint32

List returns the all elements as a slice.

func (Uint32) Pop added in v0.0.2

func (s Uint32) Pop() (uint32, bool)

Pop returns an arbitrary element of Uint32, deleting it from Uint32. The second value is a bool that is true if the elements existed in the Uint32, and false if not.

func (Uint32) Remove added in v0.0.2

func (s Uint32) Remove(elements ...uint32)

Remove removes the element from Uint32, if it is present.

func (Uint32) Size added in v0.0.2

func (s Uint32) Size() int

Size returns the number of elements in Uint32.

func (Uint32) SortedList added in v0.0.2

func (s Uint32) SortedList(less func(i, j uint32) bool) []uint32

SortedList returns the all elements as a slice sorted by less func.

func (Uint32) String added in v0.0.2

func (s Uint32) String() string

String returns a string representation of Uint32

func (Uint32) SymmetricDifference added in v0.0.2

func (s Uint32) SymmetricDifference(t Uint32) Uint32

SymmetricDifference returns a new Uint32 with the elements that are either in this Uint32 or in the given Uint32, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Uint32) Union added in v0.0.2

func (s Uint32) Union(t Uint32) Uint32

Union returns the union of Uint32 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Uint64 added in v0.0.2

type Uint64 map[uint64]struct{}

Uint64 is a uint64 collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewUint64 added in v0.0.2

func NewUint64(elements ...uint64) Uint64

NewUint64 initializes a new Uint64.

func NewUint64WithSize added in v0.0.2

func NewUint64WithSize(size int) Uint64

NewUint64WithSize initializes a new Uint64 with the specified size.

func (Uint64) Add added in v0.0.2

func (s Uint64) Add(elements ...uint64)

Add adds the elements to Uint64, if it is not present already.

func (*Uint64) Clear added in v0.0.2

func (s *Uint64) Clear()

Clear removes all items from the Uint64.

func (Uint64) Copy added in v0.0.2

func (s Uint64) Copy() Uint64

Copy returns new Uint64 that clones from Uint64.

func (Uint64) Difference added in v0.0.2

func (s Uint64) Difference(t Uint64) Uint64

Difference returns the difference of Uint64 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Uint64) Each added in v0.0.2

func (s Uint64) Each(do func(i uint64))

Each traverses the elements in the Uint64, calling do func for each Uint64 member.

func (Uint64) EachE added in v0.0.2

func (s Uint64) EachE(do func(i uint64) error) error

EachE traverses the elements in the Uint64, calling do func for each Uint64 member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Uint64) Equal added in v0.0.2

func (s Uint64) Equal(t Uint64) bool

Equal predicates that tests whether the Uint64 s equals of Uint64 t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Uint64) Has added in v0.0.2

func (s Uint64) Has(element uint64) bool

Has judges the specified element whether exists in the Uint64. it returns true if existed, and false if not.

func (Uint64) HasAll added in v0.0.2

func (s Uint64) HasAll(elements ...uint64) bool

HasAll looks for the specified elements to judge whether all exist in the Uint64. it returns true if existed, and false if not.

func (Uint64) HasAny added in v0.0.2

func (s Uint64) HasAny(elements ...uint64) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Uint64. it returns true if existed, and false if not.

func (Uint64) Intersection added in v0.0.2

func (s Uint64) Intersection(t Uint64) Uint64

Intersection returns the intersection of Uint64 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Uint64) IsEmpty added in v0.0.2

func (s Uint64) IsEmpty() bool

IsEmpty returns whether the Uint64 is Empty.

func (Uint64) IsSubset added in v0.0.2

func (s Uint64) IsSubset(t Uint64) bool

IsSubset predicates that tests whether the Uint64 s is a subset of Uint64 t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Uint64) IsSuperset added in v0.0.2

func (s Uint64) IsSuperset(t Uint64) bool

IsSuperset predicates that tests whether the Uint64 s is a super of Uint64 t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Uint64) List added in v0.0.2

func (s Uint64) List() []uint64

List returns the all elements as a slice.

func (Uint64) Pop added in v0.0.2

func (s Uint64) Pop() (uint64, bool)

Pop returns an arbitrary element of Uint64, deleting it from Uint64. The second value is a bool that is true if the elements existed in the Uint64, and false if not.

func (Uint64) Remove added in v0.0.2

func (s Uint64) Remove(elements ...uint64)

Remove removes the element from Uint64, if it is present.

func (Uint64) Size added in v0.0.2

func (s Uint64) Size() int

Size returns the number of elements in Uint64.

func (Uint64) SortedList added in v0.0.2

func (s Uint64) SortedList(less func(i, j uint64) bool) []uint64

SortedList returns the all elements as a slice sorted by less func.

func (Uint64) String added in v0.0.2

func (s Uint64) String() string

String returns a string representation of Uint64

func (Uint64) SymmetricDifference added in v0.0.2

func (s Uint64) SymmetricDifference(t Uint64) Uint64

SymmetricDifference returns a new Uint64 with the elements that are either in this Uint64 or in the given Uint64, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Uint64) Union added in v0.0.2

func (s Uint64) Union(t Uint64) Uint64

Union returns the union of Uint64 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Uint8 added in v0.0.2

type Uint8 map[uint8]struct{}

Uint8 is a uint8 collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewUint8 added in v0.0.2

func NewUint8(elements ...uint8) Uint8

NewUint8 initializes a new Uint8.

func NewUint8WithSize added in v0.0.2

func NewUint8WithSize(size int) Uint8

NewUint8WithSize initializes a new Uint8 with the specified size.

func (Uint8) Add added in v0.0.2

func (s Uint8) Add(elements ...uint8)

Add adds the elements to Uint8, if it is not present already.

func (*Uint8) Clear added in v0.0.2

func (s *Uint8) Clear()

Clear removes all items from the Uint8.

func (Uint8) Copy added in v0.0.2

func (s Uint8) Copy() Uint8

Copy returns new Uint8 that clones from Uint8.

func (Uint8) Difference added in v0.0.2

func (s Uint8) Difference(t Uint8) Uint8

Difference returns the difference of Uint8 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Uint8) Each added in v0.0.2

func (s Uint8) Each(do func(i uint8))

Each traverses the elements in the Uint8, calling do func for each Uint8 member.

func (Uint8) EachE added in v0.0.2

func (s Uint8) EachE(do func(i uint8) error) error

EachE traverses the elements in the Uint8, calling do func for each Uint8 member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Uint8) Equal added in v0.0.2

func (s Uint8) Equal(t Uint8) bool

Equal predicates that tests whether the Uint8 s equals of Uint8 t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Uint8) Has added in v0.0.2

func (s Uint8) Has(element uint8) bool

Has judges the specified element whether exists in the Uint8. it returns true if existed, and false if not.

func (Uint8) HasAll added in v0.0.2

func (s Uint8) HasAll(elements ...uint8) bool

HasAll looks for the specified elements to judge whether all exist in the Uint8. it returns true if existed, and false if not.

func (Uint8) HasAny added in v0.0.2

func (s Uint8) HasAny(elements ...uint8) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Uint8. it returns true if existed, and false if not.

func (Uint8) Intersection added in v0.0.2

func (s Uint8) Intersection(t Uint8) Uint8

Intersection returns the intersection of Uint8 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Uint8) IsEmpty added in v0.0.2

func (s Uint8) IsEmpty() bool

IsEmpty returns whether the Uint8 is Empty.

func (Uint8) IsSubset added in v0.0.2

func (s Uint8) IsSubset(t Uint8) bool

IsSubset predicates that tests whether the Uint8 s is a subset of Uint8 t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Uint8) IsSuperset added in v0.0.2

func (s Uint8) IsSuperset(t Uint8) bool

IsSuperset predicates that tests whether the Uint8 s is a super of Uint8 t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Uint8) List added in v0.0.2

func (s Uint8) List() []uint8

List returns the all elements as a slice.

func (Uint8) Pop added in v0.0.2

func (s Uint8) Pop() (uint8, bool)

Pop returns an arbitrary element of Uint8, deleting it from Uint8. The second value is a bool that is true if the elements existed in the Uint8, and false if not.

func (Uint8) Remove added in v0.0.2

func (s Uint8) Remove(elements ...uint8)

Remove removes the element from Uint8, if it is present.

func (Uint8) Size added in v0.0.2

func (s Uint8) Size() int

Size returns the number of elements in Uint8.

func (Uint8) SortedList added in v0.0.2

func (s Uint8) SortedList(less func(i, j uint8) bool) []uint8

SortedList returns the all elements as a slice sorted by less func.

func (Uint8) String added in v0.0.2

func (s Uint8) String() string

String returns a string representation of Uint8

func (Uint8) SymmetricDifference added in v0.0.2

func (s Uint8) SymmetricDifference(t Uint8) Uint8

SymmetricDifference returns a new Uint8 with the elements that are either in this Uint8 or in the given Uint8, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Uint8) Union added in v0.0.2

func (s Uint8) Union(t Uint8) Uint8

Union returns the union of Uint8 s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

type Uintptr added in v0.0.2

type Uintptr map[uintptr]struct{}

Uintptr is a uintptr collection that contains no duplicate elements, without any particular order. It supports typical set operations: Core set-theoretical operations, Static sets, Dynamic sets, Additional operations.

func NewUintptr added in v0.0.2

func NewUintptr(elements ...uintptr) Uintptr

NewUintptr initializes a new Uintptr.

func NewUintptrWithSize added in v0.0.2

func NewUintptrWithSize(size int) Uintptr

NewUintptrWithSize initializes a new Uintptr with the specified size.

func (Uintptr) Add added in v0.0.2

func (s Uintptr) Add(elements ...uintptr)

Add adds the elements to Uintptr, if it is not present already.

func (*Uintptr) Clear added in v0.0.2

func (s *Uintptr) Clear()

Clear removes all items from the Uintptr.

func (Uintptr) Copy added in v0.0.2

func (s Uintptr) Copy() Uintptr

Copy returns new Uintptr that clones from Uintptr.

func (Uintptr) Difference added in v0.0.2

func (s Uintptr) Difference(t Uintptr) Uintptr

Difference returns the difference of Uintptr s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Difference(s) = {b} s.Difference(s) = {d, e, f}

func (Uintptr) Each added in v0.0.2

func (s Uintptr) Each(do func(i uintptr))

Each traverses the elements in the Uintptr, calling do func for each Uintptr member.

func (Uintptr) EachE added in v0.0.2

func (s Uintptr) EachE(do func(i uintptr) error) error

EachE traverses the elements in the Uintptr, calling do func for each Uintptr member. the cycle will be stopped when the do func returns error. if err is ErrBreakEach, break the cycle and return nil, else, break the cycle and return error.

func (Uintptr) Equal added in v0.0.2

func (s Uintptr) Equal(t Uintptr) bool

Equal predicates that tests whether the Uintptr s equals of Uintptr t. For example: s equals of s s = {a, b, c} s = {a, b, c} s does not equal of s s = {a, f} s = {a, b, c, d}

func (Uintptr) Has added in v0.0.2

func (s Uintptr) Has(element uintptr) bool

Has judges the specified element whether exists in the Uintptr. it returns true if existed, and false if not.

func (Uintptr) HasAll added in v0.0.2

func (s Uintptr) HasAll(elements ...uintptr) bool

HasAll looks for the specified elements to judge whether all exist in the Uintptr. it returns true if existed, and false if not.

func (Uintptr) HasAny added in v0.0.2

func (s Uintptr) HasAny(elements ...uintptr) bool

HasAny looks for the specified elements to judge whether at least one of the element exists in the Uintptr. it returns true if existed, and false if not.

func (Uintptr) Intersection added in v0.0.2

func (s Uintptr) Intersection(t Uintptr) Uintptr

Intersection returns the intersection of Uintptr s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Intersection(s) = {a, c} s.Intersection(s) = {a, c} s.Intersection(s) = s.Intersection(s)

func (Uintptr) IsEmpty added in v0.0.2

func (s Uintptr) IsEmpty() bool

IsEmpty returns whether the Uintptr is Empty.

func (Uintptr) IsSubset added in v0.0.2

func (s Uintptr) IsSubset(t Uintptr) bool

IsSubset predicates that tests whether the Uintptr s is a subset of Uintptr t. For example: s is subset of s s = {a, b, c} s = {a, b, c, d} s is not subset of s s = {a, f} s = {a, b, c, d}

func (Uintptr) IsSuperset added in v0.0.2

func (s Uintptr) IsSuperset(t Uintptr) bool

IsSuperset predicates that tests whether the Uintptr s is a super of Uintptr t. For example: s is super of s s = {a, b, c, d} s = {a, b, c} s is not super of s s = {a, f} s = {a, b, c, d}

func (Uintptr) List added in v0.0.2

func (s Uintptr) List() []uintptr

List returns the all elements as a slice.

func (Uintptr) Pop added in v0.0.2

func (s Uintptr) Pop() (uintptr, bool)

Pop returns an arbitrary element of Uintptr, deleting it from Uintptr. The second value is a bool that is true if the elements existed in the Uintptr, and false if not.

func (Uintptr) Remove added in v0.0.2

func (s Uintptr) Remove(elements ...uintptr)

Remove removes the element from Uintptr, if it is present.

func (Uintptr) Size added in v0.0.2

func (s Uintptr) Size() int

Size returns the number of elements in Uintptr.

func (Uintptr) SortedList added in v0.0.2

func (s Uintptr) SortedList(less func(i, j uintptr) bool) []uintptr

SortedList returns the all elements as a slice sorted by less func.

func (Uintptr) String added in v0.0.2

func (s Uintptr) String() string

String returns a string representation of Uintptr

func (Uintptr) SymmetricDifference added in v0.0.2

func (s Uintptr) SymmetricDifference(t Uintptr) Uintptr

SymmetricDifference returns a new Uintptr with the elements that are either in this Uintptr or in the given Uintptr, but not in both. For example: s = {a, c} s = {a, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = {c, b, d} s.SymmetricDifference(s) = s.SymmetricDifference(s)

func (Uintptr) Union added in v0.0.2

func (s Uintptr) Union(t Uintptr) Uintptr

Union returns the union of Uintptr s and t. For example: s = {a, b, c} s = {a, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = {a, b, c, d, e, f} s.Union(s) = s.Union(s)

Directories

Path Synopsis
examples
int

Jump to

Keyboard shortcuts

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