set

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapSet

type MapSet[T comparable] struct {
	// contains filtered or unexported fields
}

func NewMapSet

func NewMapSet[T comparable](size int) *MapSet[T]

func (*MapSet[T]) Add

func (s *MapSet[T]) Add(val T)

func (*MapSet[T]) Delete

func (s *MapSet[T]) Delete(key T)

func (*MapSet[T]) Exist

func (s *MapSet[T]) Exist(key T) bool

func (*MapSet[T]) Keys

func (s *MapSet[T]) Keys() []T

Keys 方法返回的元素顺序不固定

type Set

type Set[T comparable] interface {
	Add(key T)
	Delete(key T)
	// Exist 返回是否存在这个元素
	Exist(key T) bool
	Keys() []T
}

type TreeSet

type TreeSet[T any] struct {
	// contains filtered or unexported fields
}

func NewTreeSet

func NewTreeSet[T any](compare ekit.Comparator[T]) (*TreeSet[T], error)

func (*TreeSet[T]) Add

func (s *TreeSet[T]) Add(key T)

func (*TreeSet[T]) Delete

func (s *TreeSet[T]) Delete(key T)

func (*TreeSet[T]) Exist

func (s *TreeSet[T]) Exist(key T) bool

func (*TreeSet[T]) Keys

func (s *TreeSet[T]) Keys() []T

Keys 方法返回的元素顺序不固定

Jump to

Keyboard shortcuts

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