|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.callback.calltree.CallTreeNode
public class CallTreeNode
Call tree node is one Simon one for one call level, all splits for this Simon+Level(+Thread) tuple are kept for later analysis. Simon name is unique within parent tree node. Said differently a tree node can not have two children with same name.
| Field Summary | |
|---|---|
private Map<String,CallTreeNode> |
children
Child tree nodes. |
private String |
name
Name, used as a key. |
private CallTreeNode |
parent
Parent tree node. |
private List<Split> |
splits
Splits. |
| Constructor Summary | |
|---|---|
CallTreeNode(String name)
Main constructor. |
|
| Method Summary | |
|---|---|
CallTreeNode |
addChild(String name)
Adds a child to this tree node. |
void |
addSplit(Split split)
Adds a split to the current tree node. |
CallTreeNode |
getChild(String name)
Returns the child node by Simon name. |
Collection<CallTreeNode> |
getChildren()
Returns all child nodes. |
String |
getName()
Returns Simon name. |
CallTreeNode |
getOrAddChild(String name)
Returns a child node with given name or creates it if it does not exists. |
CallTreeNode |
getParent()
Returns parent tree node. |
Integer |
getPercent()
Returns the part of time spent in this node compared to parent. |
int |
getSplitCount()
Returns the number of splits in this node. |
long |
getTotal()
Returns the total time of splits using Split.runningFor(). |
void |
print(PrintWriter printWriter)
Recursively prints this tree node to given print writer. |
private void |
print(PrintWriter printWriter,
String prefix,
Long parentTotal)
Recursively prints this tree node to given print writer. |
String |
toString()
Returns a string representing the tree from this tree node, visiting recursively this tree branch. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final String name
private final List<Split> splits
private Map<String,CallTreeNode> children
private CallTreeNode parent
null for root tree node.
| Constructor Detail |
|---|
public CallTreeNode(String name)
name - Simon name| Method Detail |
|---|
public String getName()
public void addSplit(Split split)
split - Splitpublic int getSplitCount()
public long getTotal()
Split.runningFor().
public Integer getPercent()
public CallTreeNode addChild(String name)
name - Child Simon name
public CallTreeNode getChild(String name)
name - Simon name
public Collection<CallTreeNode> getChildren()
public CallTreeNode getOrAddChild(String name)
name - Simon name
public CallTreeNode getParent()
private void print(PrintWriter printWriter,
String prefix,
Long parentTotal)
printWriter - Output print writerprefix - Line prefix (used internally for indentation)parentTotal - Duration of parent node (used to compute duration ratio for child nodes), null for root nodespublic void print(PrintWriter printWriter)
printWriter - Output print writerpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||