set

package module
v0.0.0-...-f39cfa4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-set

golang set

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesIterationer

type BytesIterationer interface {
	// Next 是否有下一个数据.
	Next() bool
	// Key 获取数据.
	Key() []byte
	// Release 释放迭代.
	Release()
}

BytesIterationer 字节迭代器接口.

type DBSet

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

DBSet 基于数据库的集合.

Example
s := NewDBSet().Add([]byte("str1"), []byte("str2"))
defer s.Release()

i := s.Iteration()
defer i.Release()

for i.Next() {
	fmt.Println("value:", i.Key())
}
Output:
value: [115 116 114 49]
value: [115 116 114 50]

func NewDBSet

func NewDBSet() *DBSet

NewDBSet new databse set.

func (*DBSet) Add

func (s *DBSet) Add(bytes ...[]byte) *DBSet

Add adds some bytes and returns set.

func (*DBSet) Clear

func (s *DBSet) Clear() *DBSet

Clear 清空集合.

func (*DBSet) Complement

func (s *DBSet) Complement(full *DBSet) *DBSet

Complement 补集.

func (*DBSet) Dir

func (s *DBSet) Dir(dir string) *DBSet

Dir 设置目录.

func (*DBSet) Empty

func (s *DBSet) Empty() bool

Empty 是否为空.

func (*DBSet) Has

func (s *DBSet) Has(bytes ...[]byte) bool

Has 全部包含.

func (*DBSet) HasAny

func (s *DBSet) HasAny(bytes ...[]byte) bool

HasAny has any one.

func (*DBSet) Intersect

func (s *DBSet) Intersect(other *DBSet) *DBSet

Intersect 交集.

func (*DBSet) Iteration

func (s *DBSet) Iteration() BytesIterationer

Iteration 迭代.

func (*DBSet) Release

func (s *DBSet) Release() *DBSet

Release 释放资源.

func (*DBSet) Remove

func (s *DBSet) Remove(bytes ...[]byte) *DBSet

Remove 删除.

func (*DBSet) Size

func (s *DBSet) Size() int

Size 尺寸.

func (*DBSet) Union

func (s *DBSet) Union(other *DBSet) *DBSet

Union 并集.

type Set

type Set interface {
	// Union 合并.
	Union(other Set) Set
	// Intersect 交集.
	Intersect(other Set) Set
	// Empty 集合是否为空.
	Empty() bool
	// Clear 清空.
	Clear() Set
}

Set 接口.

type StringIteration

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

StringIteration 字符串迭代器.

func (*StringIteration) Key

func (i *StringIteration) Key() string

Key 字符串.

func (*StringIteration) Next

func (i *StringIteration) Next() bool

Next 是否有下一个字符串.

type StringIterationer

type StringIterationer interface {
	// Next 是否有下一个字符串.
	Next() bool
	// Key 获取字符串.
	Key() string
}

StringIterationer 字符串迭代器接口.

type StringSet

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

StringSet is string set.

func NewStringSet

func NewStringSet() *StringSet

NewStringSet new string set.

func (*StringSet) Add

func (s *StringSet) Add(strings ...string) *StringSet

Add adds some string and returns set.

func (*StringSet) Clear

func (s *StringSet) Clear() *StringSet

Clear 清空集合.

func (*StringSet) Complement

func (s *StringSet) Complement(full *StringSet) *StringSet

Complement 补集.

func (*StringSet) Empty

func (s *StringSet) Empty() bool

Empty 是否为空.

func (*StringSet) Has

func (s *StringSet) Has(strings ...string) bool

Has 全包含.

func (*StringSet) HasAny

func (s *StringSet) HasAny(strings ...string) bool

HasAny has any one.

func (*StringSet) Intersect

func (s *StringSet) Intersect(other *StringSet) *StringSet

Intersect 交集.

func (*StringSet) Iteration

func (s *StringSet) Iteration() StringIterationer

Iteration 迭代.

func (*StringSet) Remove

func (s *StringSet) Remove(strings ...string) *StringSet

Remove 删除.

func (*StringSet) Size

func (s *StringSet) Size() int

Size 尺寸.

func (*StringSet) Union

func (s *StringSet) Union(other *StringSet) *StringSet

Union 并集.

Jump to

Keyboard shortcuts

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