Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data
In directory usw-pr-cvs1:/tmp/cvs-serv27736/net/sourceforge/javaprofiler/jpiimpl/data
Added Files:
CallTreeData.java
Log Message:
call tree item class
--- NEW FILE: CallTreeData.java ---
/*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License Version
* 1.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is available at http://www.sun.com/
*
* The Original Code is the Java Profiler module.
* The Initial Developers of the Original Code are Jan Stola, Pavel Vacha,
* Michal Pise, Petr Luner, Lukas Petru and Marek Przeczek.
* Portions created by Jan Stola are Copyright (C) 2000-2001. All Rights Reserved.
* Portions created by Pavel Vacha are Copyright (C) 2000-2001. All Rights Reserved.
* Portions created by Michal Pise are Copyright (C) 2000-2001. All Rights Reserved.
* Portions created by Petr Luner are Copyright (C) 2000-2001. All Rights Reserved.
* Portions created by Lukas Petru are Copyright (C) 2000-2001. All Rights Reserved.
* Portions created by Marek Przeczek are Copyright (C) 2000-2001. All Rights Reserved.
*
* Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner,
* Lukas Petru and Marek Przeczek.
*/
package net.sourceforge.javaprofiler.jpiimpl.data;
import java.util.*;
import net.sourceforge.javaprofiler.jpiimpl.commun.*;
import java.io.Serializable;
/** Call tree item of profiled application. Items are connected in a tree-like
* graph structure.
* @author Lukas Petru
*/
public class CallTreeData implements Serializable {
/** time spent in the method (including sub-calls) */
private long cumulativeTime;
/** number of calls of the method */
private long hits;
/** time spent in the method (excluding sub-calls) */
private long pureTime;
/** method of this item */
private MethodData method;
/** methods called by this method
* (list of sCallTree objects, can be null)
*/
private List children;
/** parent item (method from which current method was called) */
private CallTreeData parent;
/** number of children that are to be added while building call-tree */
int missingChildrenCount;
/** Creates new CallTreeData item.
* @param caller Parent item
* @aMethod Method which this item represents.
* @aCumulativeTime Cumulative time
* @aHits Number of hits
* @aPureTime Pure time
*/
CallTreeData (CallTreeData caller, MethodData aMethod, long
aCumulativeTime, long aHits, long aPureTime) {
parent = caller;
method = aMethod;
cumulativeTime = aCumulativeTime;
hits = aHits;
pureTime = aPureTime;
children = Collections.EMPTY_LIST;
}
/** Creates new CallTreeData item.
* @param caller Parent item
* @aMethod Method which this item represents.
* @aData sCallTree class as returned by communication layer.
*/
CallTreeData (CallTreeData caller, MethodData aMethod, IProf.sCallTree
aData) {
this (caller, aMethod, aData.cumulativeTime, aData.hits,
aData.pureTime);
}
/** Adds child item. (Method which was called from current method.)
*/
void addChild (CallTreeData child) {
if (children == Collections.EMPTY_LIST)
children = new LinkedList ();
children.add(child);
}
/** Returns method of this item. */
public MethodData getMethod () {
return method;
}
/** Returns parent of this item in the tree. */
public CallTreeData getParent () {
return parent;
}
/** Returns cumulative time. */
public long getCumulativeTime () {
return cumulativeTime;
}
/** Returns hit count. */
public long getHits () {
return hits;
}
/** returns pure time. */
public long getPureTime () {
return pureTime;
}
}
/*
* $Log: CallTreeData.java,v $
* Revision 1.1 2002/03/07 10:36:13 petrul
* call tree item class
*
*/
|