datastruct

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddressBitsPerWord uint8          = 6
	WordsPerSize       document.DocId = 64
)
View Source
const (
	DefaultMaxLevel    = 12
	DefaultProbability = 0x3FFF
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitSet

type BitSet []document.DocId

func NewBitMap

func NewBitMap() *BitSet

func (*BitSet) Del

func (bs *BitSet) Del(bitIndex document.DocId)

func (*BitSet) IsExist

func (bs *BitSet) IsExist(bitIndex document.DocId) bool

func (*BitSet) IsFully

func (bs *BitSet) IsFully() bool

func (*BitSet) Set

func (bs *BitSet) Set(bitIndex document.DocId)

type Element

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

func ElementCopy

func ElementCopy(element *Element) (e *Element)

func (*Element) Key

func (e *Element) Key() document.DocId

func (*Element) Next

func (e *Element) Next(n int) *Element

func (*Element) Value

func (e *Element) Value() interface{}

type Iterator

type Iterator interface {
	HasNext() bool
	Next()
	Current() *Element
	GetGE(id document.DocId) *Element
	GetFieldName() string
}

type SkipList

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

func NewSkipList

func NewSkipList(level int) *SkipList

func (*SkipList) Add

func (sl *SkipList) Add(key document.DocId, value interface{})

func (*SkipList) Contains

func (sl *SkipList) Contains(key document.DocId) (ok bool)

func (*SkipList) Del

func (sl *SkipList) Del(key document.DocId)

func (*SkipList) Get

func (sl *SkipList) Get(key document.DocId) (x *Element, err error)

func (*SkipList) Iterator

func (sl *SkipList) Iterator() *SkipListIterator

func (*SkipList) Len

func (sl *SkipList) Len() int

type SkipListIterator

type SkipListIterator struct {
	Element   *Element
	FieldName string
}

func NewSkipListIterator

func NewSkipListIterator(element *Element) *SkipListIterator

func (*SkipListIterator) Current

func (si *SkipListIterator) Current() *Element

func (*SkipListIterator) GetFieldName added in v0.0.14

func (si *SkipListIterator) GetFieldName() string

func (*SkipListIterator) GetGE

func (si *SkipListIterator) GetGE(key document.DocId) *Element

func (*SkipListIterator) GetLE

func (si *SkipListIterator) GetLE(key document.DocId) *Element

func (*SkipListIterator) HasNext

func (si *SkipListIterator) HasNext() bool

func (*SkipListIterator) Next

func (si *SkipListIterator) Next()

type Slice added in v0.0.4

type Slice []*Element

func NewSlice added in v0.0.4

func NewSlice() *Slice

func (*Slice) Add added in v0.0.4

func (s *Slice) Add(id document.DocId, value interface{})

func (*Slice) Get added in v0.0.4

func (s *Slice) Get(id document.DocId) (*Element, error)

func (Slice) Iterator added in v0.0.4

func (s Slice) Iterator() *SliceIterator

func (Slice) Len added in v0.0.4

func (s Slice) Len() int

type SliceIterator added in v0.0.4

type SliceIterator struct {
	FieldName string
	// contains filtered or unexported fields
}

func (*SliceIterator) Current added in v0.0.4

func (s *SliceIterator) Current() *Element

func (*SliceIterator) GetFieldName added in v0.0.14

func (s *SliceIterator) GetFieldName() string

func (*SliceIterator) GetGE added in v0.0.4

func (s *SliceIterator) GetGE(id document.DocId) *Element

func (*SliceIterator) HasNext added in v0.0.4

func (s *SliceIterator) HasNext() bool

func (*SliceIterator) Next added in v0.0.4

func (s *SliceIterator) Next()

type Stack

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

func NewStack

func NewStack() *Stack

func (*Stack) Empty

func (s *Stack) Empty() bool

func (*Stack) Len

func (s *Stack) Len() int

func (*Stack) Peek

func (s *Stack) Peek() interface{}

func (*Stack) Pop

func (s *Stack) Pop() interface{}

func (*Stack) Push

func (s *Stack) Push(value interface{})

type TreeNode

type TreeNode struct {
	Data  interface{}
	Right *TreeNode
	Left  *TreeNode
}

func (*TreeNode) Print

func (treeNode *TreeNode) Print()

func (*TreeNode) To

func (treeNode *TreeNode) To() Stack

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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