|
SandMark version 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sandmark.statistics.Stats
This class is a collection of StatisticsRecords. It builds these records from ClassFileCollection input. It can find a record, access it and provide statistical data about the classes it records.
Constructor Summary | |
Stats(ClassFileCollection aCollection)
Constructs a new Statistics collection. |
Method Summary | |
boolean |
callsDynamicMethods(java.lang.String className,
java.lang.String methodName)
Returns true if specified method calls other dynamic methods, or false if it does not. |
boolean |
callsStaticMethods(java.lang.String className,
java.lang.String methodName)
Returns true if specified method calls other static methods, or false if it does not. |
boolean |
findPackage(java.lang.String packageToFind)
Checks to see if the named package is in this collection. |
int |
getAverageNumberOfMethodParams(java.lang.String className)
|
int |
getAvgNumberOfInstanceMethods()
|
int |
getAvgNumberOfInstanceVariables()
|
java.util.List |
getByteCode()
|
java.util.List |
getByteCode(java.lang.String className,
java.lang.String methodName)
Returns the bytecode of a specified method. |
java.util.List |
getByteCodeByClassName(java.lang.String className)
|
java.util.List |
getByteCodeByPackage(java.lang.String packageName)
|
java.util.Hashtable |
getByteCodeUsage(java.lang.String className,
java.lang.String methodName)
|
int |
getClassHierarchyLevel(java.lang.String className)
|
java.lang.String |
getClassNameAt(int index)
Retruns the classname at the specified index |
java.util.List |
getListOfClassesByPackageName(java.lang.String packageName)
Returns a list of all of the classNames are in the specified package. |
java.lang.String |
getMethodByteCodeUsage(java.lang.String className,
java.lang.String methodName)
|
EDU.purdue.cs.bloat.editor.MethodEditor |
getMethodEditor(java.lang.String className,
java.lang.String methodName)
new stat implementation starts here .... |
java.lang.String[] |
getMethodNames(java.lang.String className)
Retruns the names of all of the methods in the class specified |
int |
getMethodSizeInBytes(java.lang.String className,
java.lang.String methodName)
Retruns the size of the method in bytes, or -1 if the class or method does not exist |
java.lang.String[] |
getNamesOfMethodsInvoked(java.lang.String className,
java.lang.String methodName)
|
java.util.List |
getNonStaticFields(java.lang.String className)
Returns a List of all the Non-Static fields in the specified class. |
int |
getNumberOfAbstractClasses()
|
int |
getNumberOfApiCalls(java.lang.String className)
|
int |
getNumberOfClassMethods(java.lang.String className)
|
int |
getNumberOfConditionalStatements(java.lang.String className)
|
int |
getNumberOfInstanceMethods(java.lang.String className)
|
int |
getNumberOfInstanceVariables(java.lang.String className)
|
int |
getNumberOfMessageSends(java.lang.String className,
java.lang.String methodName)
|
int |
getNumberOfMethodParams(java.lang.String className,
java.lang.String methodName)
|
int |
getNumberOfMethodsAdded(java.lang.String className)
|
int |
getNumberOfMethodsInherited(java.lang.String className)
|
int |
getNumberOfMethodsInScope(java.lang.String className)
|
int |
getNumberOfMethodsInvoked(java.lang.String className)
|
int |
getNumberOfMethodsOverridden(java.lang.String className)
|
int |
getNumberOfmultipleInheritance(java.lang.String className)
|
int |
getNumberOfPublicMethods(java.lang.String className)
|
int |
getNumberOfScalars(java.lang.String className)
|
int |
getNumberOfStaticFields(java.lang.String className)
Returns the number of fields in the specified class which are static, or -1 if the class does not exist |
int |
getNumberOfStatmentsInMethod(java.lang.String className,
java.lang.String methodName)
|
int |
getNumberOfSubClasses(java.lang.String className)
|
int |
getNumberOfVectors(java.lang.String className)
|
int |
getNumClasses()
Returns the number of classes in this collection |
int |
getNumClassesInPackage(java.lang.String packageName)
Returns the number of classes in the specified package. |
int |
getNumFieldsNonBasicTypes(java.lang.String className)
Returns the number of fields that are not basic in the specified class, or -1 if the class does not exist |
int |
getNumMethods(java.lang.String className)
Returns the number of the method in specified class, or -1 if class does not exist. |
int |
getNumNonStaticFields(java.lang.String className)
|
int |
getNumNonStaticFieldsByType(java.lang.String className,
java.lang.String type)
Returns the number of fields, by type in the specified class which are non-static, or -1 if the class does not exist |
int |
getNumPackages()
Returns the number of packages in this collection |
java.lang.String |
getPackageNameAt(int index)
Given a specific index, this method returns the packageName at that index |
java.util.List |
getPackageNames()
Returns a list of all of the packages in this collection, discounting duplicates. |
java.util.Vector |
getVectorDimensions(java.lang.String className)
|
java.util.Vector |
halsteadMeasures(java.lang.String className,
java.lang.String methodName)
|
boolean |
hasBackwardBranches(java.lang.String className,
java.lang.String methodName)
Returns true if specified method uses backward branches, or false if it does not. |
boolean |
hasForwardBranches(java.lang.String className,
java.lang.String methodName)
Returns true if specified method uses forward branches, or false if it does not. |
static void |
main(java.lang.String[] argv)
|
double |
nestingLevelComplexity(java.lang.String className,
java.lang.String methodName,
de.fub.bytecode.generic.MethodGen mg)
|
boolean |
throwsCatchesExceptions(java.lang.String className,
java.lang.String methodName)
Returns true if specified method throws or catches exceptions, or false if it does not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Stats(ClassFileCollection aCollection) throws java.lang.RuntimeException, java.io.IOException
aCollection
- The ClassFileCollection which
contains the classes to analyzeMethod Detail |
public java.util.List getByteCode()
public java.util.List getByteCodeByPackage(java.lang.String packageName)
public int getNumMethods(java.lang.String className)
className
- the name of the class
public java.lang.String[] getMethodNames(java.lang.String className)
className
- the name of the class
public java.lang.String getClassNameAt(int index)
index
- the index at which to get the classname
public int getNumClasses()
public java.lang.String getPackageNameAt(int index)
index
- the index at which to get the packageName
public int getNumPackages()
public java.util.List getListOfClassesByPackageName(java.lang.String packageName)
packageName
- the name of the package from which to get classNames.
public int getNumClassesInPackage(java.lang.String packageName)
packageName
- the name of the package to investigate.
public java.util.List getPackageNames()
public boolean findPackage(java.lang.String packageToFind)
packageToFind
- the name of the package to look for in this collection.
public java.util.List getByteCodeByClassName(java.lang.String className)
public java.util.List getByteCode(java.lang.String className, java.lang.String methodName)
className
- the name of the class.methodName
- the name of the method from which to get the bytecode.
List
representation of the bytecode.public java.lang.String getMethodByteCodeUsage(java.lang.String className, java.lang.String methodName)
public java.util.Hashtable getByteCodeUsage(java.lang.String className, java.lang.String methodName)
public int getMethodSizeInBytes(java.lang.String className, java.lang.String methodName)
className
- the name of the classmethodName
- the name of the method from which to get the size.
public boolean throwsCatchesExceptions(java.lang.String className, java.lang.String methodName)
className
- the name of the classmethodName
- the name of the method to investigate
public int getNumNonStaticFields(java.lang.String className)
public int getNumberOfStaticFields(java.lang.String className)
className
- the name of the class
public int getNumNonStaticFieldsByType(java.lang.String className, java.lang.String type)
className
- the name of the classtype
- the type to count.
public int getNumFieldsNonBasicTypes(java.lang.String className)
className
- the name of the class
public boolean hasForwardBranches(java.lang.String className, java.lang.String methodName)
className
- the name of the classmethodName
- the name of the method to investigate
public boolean hasBackwardBranches(java.lang.String className, java.lang.String methodName)
className
- the name of the classmethodName
- the name of the method to investigate
public java.util.List getNonStaticFields(java.lang.String className)
List
of all the Non-Static fields in the specified class.
className
- the name of the class from which to retrieve the Non-static field types
List
representation of all non-static field types in the
specified classpublic boolean callsStaticMethods(java.lang.String className, java.lang.String methodName)
className
- the name of the classmethodName
- the name of the method to investigate
public boolean callsDynamicMethods(java.lang.String className, java.lang.String methodName)
className
- the name of the classmethodName
- the name of the method to investigate
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
public EDU.purdue.cs.bloat.editor.MethodEditor getMethodEditor(java.lang.String className, java.lang.String methodName)
public java.util.Vector halsteadMeasures(java.lang.String className, java.lang.String methodName)
public double nestingLevelComplexity(java.lang.String className, java.lang.String methodName, de.fub.bytecode.generic.MethodGen mg)
public int getNumberOfStatmentsInMethod(java.lang.String className, java.lang.String methodName)
public int getNumberOfMessageSends(java.lang.String className, java.lang.String methodName)
public int getNumberOfPublicMethods(java.lang.String className)
public int getNumberOfInstanceMethods(java.lang.String className)
public int getAvgNumberOfInstanceMethods()
public int getNumberOfInstanceVariables(java.lang.String className)
public int getAvgNumberOfInstanceVariables()
public int getNumberOfClassMethods(java.lang.String className)
public int getNumberOfApiCalls(java.lang.String className)
public java.lang.String[] getNamesOfMethodsInvoked(java.lang.String className, java.lang.String methodName)
public int getNumberOfMethodParams(java.lang.String className, java.lang.String methodName)
public int getNumberOfConditionalStatements(java.lang.String className)
public int getAverageNumberOfMethodParams(java.lang.String className)
public int getNumberOfScalars(java.lang.String className)
public int getNumberOfVectors(java.lang.String className)
public java.util.Vector getVectorDimensions(java.lang.String className)
public int getNumberOfMethodsInvoked(java.lang.String className)
public int getNumberOfMethodsInScope(java.lang.String className)
public int getClassHierarchyLevel(java.lang.String className)
public int getNumberOfSubClasses(java.lang.String className)
public int getNumberOfAbstractClasses()
public int getNumberOfmultipleInheritance(java.lang.String className)
public int getNumberOfMethodsInherited(java.lang.String className)
public int getNumberOfMethodsAdded(java.lang.String className)
public int getNumberOfMethodsOverridden(java.lang.String className)
|
SandMark version 2.1 Wed Jul 3 17:27:43 MST 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |