|
|
|
@ -28,6 +28,11 @@ func (tree *Tree) Iterator() Iterator {
|
|
|
|
|
return Iterator{tree: tree, node: nil, position: begin}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IteratorAt returns a stateful iterator whose elements are key/value pairs that is initialised at a particular node.
|
|
|
|
|
func (tree *Tree) IteratorAt(node *Node) Iterator {
|
|
|
|
|
return Iterator{tree: tree, node: node, position: between}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Next moves the iterator to the next element and returns true if there was a next element in the container.
|
|
|
|
|
// If Next() returns true, then next element's key and value can be retrieved by Key() and Value().
|
|
|
|
|
// If Next() was called for the first time, then it will point the iterator to the first element if it exists.
|
|
|
|
|