pl.gda.pg.eti.ask.przemyslawbielicki.aeh.info
Class ClassStat

java.lang.Object
  extended bypl.gda.pg.eti.ask.przemyslawbielicki.aeh.info.ClassStat

public class ClassStat
extends Object

ClassStat contains statistics for class name className_. ClassStat contains list of method statistics MethodStat belonging to this class in methods_ field.

ClassStat contains methods_ that enable retrieving existing statistics from database by finder methods_. It also contains methods_ that enable adding new statistics to XML database.

ClassStat can be converted to XML element Element by getElement(DocumentImpl) method.

Version:
0.9
Author:
Przemyslaw Bielicki
Gdansk University of Technology
Faculty of Electronics, Telecommunication and Computer Science
Distributed Computer Systems

Field Summary
private  String className_
          Class name
private  HashMap methods_
          List of method statistics that belong to this class
 
Constructor Summary
ClassStat()
           
 
Method Summary
 void addMethodStat(MethodStat stat)
          Adds method statistics to list methods_.
 MethodStat findByMethod(Method method)
          Finds method statistics for given method.
 String getClassName()
          Getter method for class name
 ElementImpl getElement(DocumentImpl document)
          Retrieves XML element for current class statistics subtree.
 void setClassName(String string)
          Setter method for class name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

className_

private String className_
Class name


methods_

private HashMap methods_
List of method statistics that belong to this class

Constructor Detail

ClassStat

public ClassStat()
Method Detail

getElement

public ElementImpl getElement(DocumentImpl document)
Retrieves XML element for current class statistics subtree. This method iterative add all children of this class statistics element.

Parameters:
document - parent document to add current element to
Returns:
XML document of current class statistics element

findByMethod

public MethodStat findByMethod(Method method)
                        throws MethodNotFoundException
Finds method statistics for given method. This method searchs methods_ by name, return type, parameter types array length and parameter types compatibility (are these types equal). If method statistics doesn't exist MethodNotFoundException is thrown.

Parameters:
method - user is looking for statistics of this method
Returns:
method statistics for given method
Throws:
MethodNotFoundException - method statistics doesn't exist

getClassName

public String getClassName()
Getter method for class name

Returns:
class name

setClassName

public void setClassName(String string)
Setter method for class name

Parameters:
string - class name

addMethodStat

public void addMethodStat(MethodStat stat)
Adds method statistics to list methods_.

Parameters:
stat - method statistics to add