|
SandMark version 2.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sandmark.util.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. |
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)
|
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)
|
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.util.List |
getNonStaticFields(java.lang.String className)
Returns a List of all the Non-Static fields in the specified class. |
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 |
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)
Returns true if specified method throws or catches exceptions, or false if it does not. |
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. |
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)
|
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)
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)
className
- the name of the class
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
|
SandMark version 2.0 Mon Jun 17 12:30:47 MST 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |