Documentation ¶
Overview ¶
Package BTree functions
Index ¶
- func IsLeaf(node *BNode) bool
- type BNode
- type BTree
- func (t *BTree) Clear()
- func (t *BTree) FromJSON(data []byte) error
- func (t *BTree) Get(key interface{}) interface{}
- func (t *BTree) Height() int
- func (t *BTree) IsEmpty() bool
- func (t *BTree) Iterator() Iterator
- func (t *BTree) Keys() []interface{}
- func (t *BTree) Left() *BNode
- func (t *BTree) LeftKey() interface{}
- func (t *BTree) LeftValue() interface{}
- func (t *BTree) Put(key interface{}, value interface{})
- func (t *BTree) Remove(key interface{})
- func (t *BTree) Right() *BNode
- func (t *BTree) RightKey() interface{}
- func (t *BTree) RightValue() interface{}
- func (t *BTree) Size() int
- func (t *BTree) String() string
- func (t *BTree) ToJSON() ([]byte, error)
- func (t *BTree) Values() []interface{}
- type Entry
- type Iterator
- func (iterator *Iterator) Begin()
- func (iterator *Iterator) End()
- func (iterator *Iterator) First() bool
- func (iterator *Iterator) Key() interface{}
- func (iterator *Iterator) Last() bool
- func (iterator *Iterator) Next() bool
- func (iterator *Iterator) Prev() bool
- func (iterator *Iterator) Value() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BNode ¶
type BNode struct { Parent *BNode Entries []*Entry // Contained keys in node Children []*BNode // Children nodes }
Node
type BTree ¶
type BTree struct { Root *BNode // Root node // contains filtered or unexported fields }
B-Tree object
func (*BTree) LeftKey ¶
func (t *BTree) LeftKey() interface{}
LeftKey returns the left-most (min) key or nil if tree is empty.
func (*BTree) LeftValue ¶
func (t *BTree) LeftValue() interface{}
LeftValue returns the left-most value or nil if tree is empty.
func (*BTree) Put ¶
func (t *BTree) Put(key interface{}, value interface{})
Put inserts key-value pair node into the tree
func (*BTree) RightKey ¶
func (t *BTree) RightKey() interface{}
RightKey returns the right-most (max) key or nil if tree is empty.
func (*BTree) RightValue ¶
func (t *BTree) RightValue() interface{}
RightValue returns the right-most value or nil if tree is empty.
type Entry ¶
type Entry struct { Key interface{} Value interface{} }
Entry is the key-value pair in node
Click to show internal directories.
Click to hide internal directories.