Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Private Attributes
CallTree Class Reference

Represents a global tree of calls. More...

Collaboration diagram for CallTree:
Collaboration graph
[legend]

List of all members.

Classes

class  Node

Public Member Functions

 CallTree (StringTable strings)
Node parseNode (String line)
 Parses a line of the form: function[file,offset]
Node addNode (int id, int pid)
Node getNode (int id)

Private Attributes

Vector nodes = new Vector(16000)
StringTable strings

Detailed Description

Represents a global tree of calls.

Definition at line 43 of file CallTree.java.


Constructor & Destructor Documentation

CallTree.CallTree ( StringTable  strings) [inline]

Definition at line 58 of file CallTree.java.

                                         {
        nodes.addElement(null);
        this.strings = strings;
    }

Member Function Documentation

Node CallTree.addNode ( int  id,
int  pid 
) [inline]

Definition at line 92 of file CallTree.java.

                                            {
           Node parent = (Node) nodes.elementAt(pid);
           Node node = new Node(id, parent);
           nodes.addElement(node);
           if (nodes.size() != (id + 1))
               throw new Error("inconsistent node id");
           return node;
       }

Here is the caller graph for this function:

Node CallTree.getNode ( int  id) [inline]

Definition at line 101 of file CallTree.java.

                                   {
           return (Node) nodes.elementAt(id);
       }
Node CallTree.parseNode ( String  line) [inline]

Parses a line of the form: function[file,offset]

Definition at line 67 of file CallTree.java.

                                          {
        try {
            int start = 1 + line.indexOf('=');
            int endTag = line.indexOf('>');
            if (line.charAt(endTag - 1) == '/') {
                // just references an already parsed node.
                int id = Integer.parseInt(line.substring(start, endTag - 1));
                return (Node) nodes.elementAt(id);
            } else {
                int end = line.indexOf(' ', start + 1);
                int id = Integer.parseInt(line.substring(start, end));
                start = 1 + line.indexOf('=', end + 1);
                end = line.indexOf('>', start + 1);
                int pid = Integer.parseInt(line.substring(start, end));
                Node node = addNode(id, pid);
                start = end + 1;
                end = line.lastIndexOf('<');
                node.data = strings.intern(line.substring(start, end));
                return node;
            }
        } catch (NumberFormatException nfe) {
        }
        return null;
       }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Vector CallTree.nodes = new Vector(16000) [private]

Definition at line 55 of file CallTree.java.

Definition at line 56 of file CallTree.java.


The documentation for this class was generated from the following file: