Class CmsSingleThreadDumperThread.SampleNode

    • Constructor Detail

      • SampleNode

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

        Parameters:
        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.

        Parameters:
        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.

        Parameters:
        root - the root of the tree
        path - the path
        Returns:
        the sequence of nodes along the path
      • appendToXml

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

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

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

        Returns:
        the key of the node
      • getSamples

        public long getSamples()
        Returns the sample count.

        Returns:
        the sample count
      • hasChildren

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

        Returns:
        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.