Class CmsSingleThreadDumperThread.SampleNode

    • Constructor Detail

      • SampleNode

        public SampleNode​(java.lang.Object key)
        Creates a new node.

        key - the key of the node, identifying it among its siblings
    • Method Detail

      • incrementPath

        public static void incrementPath​(CmsSingleThreadDumperThread.SampleNode root,
                                         java.util.List<?> path)
        Increment sample count for all nodes along the given path.

        root - the root node
        path - a sequence of keys constituting a path in the tree
      • nodesForPath

        public static java.util.List<CmsSingleThreadDumperThread.SampleNodenodesForPath​(CmsSingleThreadDumperThread.SampleNode root,
                                                                                          java.util.List<?> path)
        Given a path consisting of a list of node keys, this method collects all nodes along that path, including the given root node, and creates nodes if they don't exist in the tree yet.

        root - the root of the tree
        path - the path
        the sequence of nodes along the path
      • appendToXml

        public void appendToXml​(org.dom4j.Element parent)
        Dumps the tree node to XML.

        parent - the parent XML to append the XML to
      • getKey

        public java.lang.Object getKey()
        Gets the key of the node.

        the key of the node
      • getSamples

        public long getSamples()
        Returns the sample count.

        the sample count
      • hasChildren

        public boolean hasChildren()
        Check if this node has children.

        true if this node has children
      • increment

        public void increment()
        Increments the sample count for this node.

      • sortChildren

        public void sortChildren()
        Sorts the children of this node by descending sample count.

      • sortTree

        public void sortTree()
        Recursively sorts this node's and all its descendants' children.