func (r *Root) DeregisterElement(elem Element) {
	createdAt := elem.CreatedAt().Key()
	delete(r.elementMapByCreatedAt, createdAt)
	delete(r.removedElementPairMapByCreatedAt, createdAt)
}
DeregisterElement deregister the given element from hash tables.
package json
import (
	"github.com/yorkie-team/yorkie/pkg/document/time"
)
type ElementPair struct {
	parent Container
	elem   Element
}
type Root struct {
	object                               *Object
	elementMapByCreatedAt                map[string]Element
	removedElementPairMapByCreatedAt     map[string]ElementPair
	removedNodeTextElementMapByCreatedAt map[string]TextElement
}
func NewRoot(root *Object) *Root {
	r := &Root{
		elementMapByCreatedAt:                make(map[string]Element),
		removedElementPairMapByCreatedAt:     make(map[string]ElementPair),
		removedNodeTextElementMapByCreatedAt: make(map[string]TextElement),
	}
	r.object = root
	r.RegisterElement(root)
	root.Descendants(func(elem Element, parent Container) bool {
		r.RegisterElement(elem)
		return false
	})
	return r
}
func (r *Root) Object() *Object {
	return r.object
}
func (r *Root) FindByCreatedAt(createdAt *time.Ticket) Element {
	return r.elementMapByCreatedAt[createdAt.Key()]
}
func (r *Root) RegisterElement(elem Element) {
	r.elementMapByCreatedAt[elem.CreatedAt().Key()] = elem
}