common

package
v0.0.0-...-d7c879d Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompareAble

type CompareAble interface {
	/*
			进行大小的比较
			-1  <= compareAble
			 0  == compareAble
		     1  >= compareAble
	*/
	CompareTo(compareAble CompareAble) int
}

表示结构体是可比较的

type CompareFunc

type CompareFunc func(thisValue interface{}, compareValue interface{}) int

常用比较函数定义

type ForIntIterator

type ForIntIterator interface {
	Begin() int

	Next() int

	End() bool
}

for循环 int 类型迭代器

type IndexError

type IndexError struct {
}

索引异常

func (IndexError) Error

func (i IndexError) Error() string

type Integer

type Integer int

func (Integer) CompareTo

func (integer Integer) CompareTo(compareAble CompareAble) int

Integer 是可比较的

type Iterator

type Iterator interface {
	Set(value interface{}) error

	Get() (interface{}, error)

	Remove()
}

loopList迭代器,用于再遍历的过程中删除元素和修改元素

type IteratorAble

type IteratorAble interface {
	/*
		增强迭代器,可以在迭代的过程中删除和修改元素
	*/
	Iterator(iteratorFunc func(iterator Iterator) bool)
}

type OperatorNotUseful

type OperatorNotUseful struct {
}

操作得不到预期结果异常

func (OperatorNotUseful) Error

func (i OperatorNotUseful) Error() string

type SliceAble

type SliceAble interface {
	ToSlice() []interface{}
}

可以转化为切片

type SortAble

type SortAble interface {
	IteratorAble

	SliceAble
}

可以转换成切片,可以迭代的就是可以排序的数据结构

Jump to

Keyboard shortcuts

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