stringmatch

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AND = "AND"
	OR  = "OR"
)

Variables

This section is empty.

Functions

func Calculate

func Calculate(str string, stackSize int, boolFunc func(string) bool) (r bool, b error)

Types

type Stack

type Stack[T StackValue] struct {
	// contains filtered or unexported fields
}

栈 对象,用来存储数据或者比较结果

func (*Stack[T]) IsEmpty

func (s *Stack[T]) IsEmpty() bool

判断堆栈是否为空

func (*Stack[T]) IsFull

func (s *Stack[T]) IsFull() bool

判断堆栈是否满了

func (*Stack[T]) Len

func (s *Stack[T]) Len() int

计算栈内还是多少个值

func (*Stack[T]) Peek

func (s *Stack[T]) Peek() T

获得栈值,但是不出栈

func (*Stack[T]) Pop

func (s *Stack[T]) Pop() T

取出栈值-后进先出

func (*Stack[T]) Push

func (s *Stack[T]) Push(d T)

压入栈值

type StackValue

type StackValue interface {
	~string | ~bool
}

定义堆栈的值范围,泛型

Jump to

Keyboard shortcuts

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