Method and apparatus for runtime merging of hierarchical trees
AssigneeSun Microsystems, Inc.
InventorsKrishnendu Chakraborty, Amy M. Wong, Joerg Heilig
Life of this patent
Estimating the term…
Abstract
Embodiments of the present invention relate to a method and apparatus for a runtime merging system of hierarchical trees with a reference node implementation. According to one or more embodiments of the present invention, a reference node is implemented which holds a reference to a node in a DOM tree active in memory. The reference node class allows adding nodes to the merged tree without having to make a clone of the node, which is an expensive operation. In one embodiment, if a particular node is not present below a certain level of the tree in any layer except a unique layer, it renders visiting the children of that node unnecessary. A reference is kept to the node in the memory.
Claims33
A method in a data processing system comprising:
- examining nodes in a plurality of hierarchical trees;
- determining if a node is present in only one tree by comparing two or more of the hierarchical trees;
- creating a merged tree based on the nodes in the hierarchical trees;
- determining if the hierarchical trees comprise a set of equivalent nodes
- selecting a node with the highest priority from the set of equivalent nodes if the hierarchical trees comprise a set of equivalent nodes;
- creating a shallow clone of the selected node;
- and
- adding the shallow clone to the merged tree.
A data processing computer comprising:
- a memory comprising a program that:
- examines nodes in a plurality of hierarchical trees;
- determines if a node is present in only one tree by comparing two or more of the hierarchical trees;
- creates a merged tree based on the nodes in the hierarchical trees;
- determines if the hierarchical trees comprise a set of equivalent nodes;
- selects a node with the highest priority from the set of equivalent nodes if the hierarchical trees comprise a set of equivalent nodes;
- creates a shallow clone of the selected node;
- and
- adds the shallow clone to the merged tree;
- and
- a processor for running the program.
A computer-readable medium storing computer-readable instructions for controlling a data processing system to perform a method comprising the steps of:
- examining nodes in a plurality of hierarchical trees;
- determining if a node is present in only one tree by comparing two or more of the hierarchical trees;
- and
- creating a merged tree based on the nodes in the hierarchical trees;
- determining if the hierarchical trees comprise a set of equivalent nodes;
- selecting a node with the highest priority from the set of equivalent nodes if the hierarchical trees comprise a set of equivalent nodes;
- creating a shallow clone of the selected node;
- and
- adding the shallow clone to the merged tree.
Dependencies are inferred from the claim text.