SandMark version 2.0


sandmark.util
Class StatisticsRecord

java.lang.Object
  |
  +--sandmark.util.StatisticsRecord

public class StatisticsRecord
extends java.lang.Object

This class contains statistical information about one class including data about its fields, methods and the package in which it is located.


Constructor Summary
StatisticsRecord()
          Constructs a new StatisticsRecord
 
Method Summary
 void addNonStaticField(java.lang.String type)
          Adds a non-static field object of specified type to the collection.
 boolean callsDynamicMethods(java.lang.String methodName)
          Returns true if the specified method calls other dynamic methods, otherwise false
 boolean callsStaticMethods(java.lang.String methodName)
          Returns true if the specified method calls other static methods, otherwise false
 boolean equals(java.lang.Object o)
          Returns true if this object is the same as the one to which it is being compared.
 java.util.Hashtable getByteCodeUsage(java.lang.String methodName)
           
 java.lang.String getClassName()
          Returns the name of this class.
 java.util.List getMethodByteCodes(java.lang.String methodName)
          Returns a List of the bytecodes in the specied method.
 java.lang.String getMethodByteCodeUsage(java.lang.String methodName)
           
 java.lang.String[] getMethodNames()
          Retruns the names of all of the methods in the class specified
 int getMethodSize(java.lang.String methodName)
          Returns the size of the given method in bytes
 java.util.List getNonStaticFields()
          Returns a List of all the Non-Static fields in the specified class.
 int getNumberMethods()
          Returns the number of methods which this method contains
 int getNumNonBasicFields()
          Returns the number of non-basic fields that this class contains.
 int getNumNonStatFieldsByType(java.lang.String type)
          Returns the number of non-static fields in this class that are of the specified type.
 int getNumNonStaticFields()
          Returns the number of non-static fields in this class.
 int getNumStaticFields()
          Returns the number of static fields in this class.
 java.lang.String getPackageName()
          Returns the name of the package to which this class belongs.
 boolean hasBackwardBranch(java.lang.String methodName)
          Returns true if there is a backward branch instruction in the method specified.
 boolean hasForwardBranch(java.lang.String methodName)
          Returns true if there is a forward branch instruction in the method specified.
 void setClassName(java.lang.String name)
          Sets the class name associated with this record to the one provided.
 void setMethods(EDU.purdue.cs.bloat.editor.MethodEditor[] methods)
          Sets the methods in this class to the specified array of MethodEditor objects.
 void setNumNonBasicFields(int numNonBasic)
          Sets the number fields with non-basic types to the specified number
 void setNumStaticFields(int number)
          Sets the number of static fields to the specified number.
 void setPackageName(java.lang.String toSet)
          Sets the package name of this class to the specified argument.
 boolean throwsCatchesExc(java.lang.String methodName)
          Returns true if this method throws or catches exceptions, otherwise it returns false.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticsRecord

public StatisticsRecord()
Constructs a new StatisticsRecord

Method Detail

setClassName

public void setClassName(java.lang.String name)
Sets the class name associated with this record to the one provided.

Parameters:
name - the name of the class

getClassName

public java.lang.String getClassName()
Returns the name of this class.

Returns:
the name of this class.

equals

public boolean equals(java.lang.Object o)
Returns true if this object is the same as the one to which it is being compared.

Overrides:
equals in class java.lang.Object
Returns:
true if this object has the same class name and package name as the one to which it is being compared. False if either of these two tests if false.

getPackageName

public java.lang.String getPackageName()
Returns the name of the package to which this class belongs.

Returns:
the name of the package to which this class belongs.

setPackageName

public void setPackageName(java.lang.String toSet)
Sets the package name of this class to the specified argument.

Parameters:
toSet - the name of the package this class to which this class it to be set.

getMethodSize

public int getMethodSize(java.lang.String methodName)
Returns the size of the given method in bytes

Parameters:
methodName - the name of the method
Returns:
the number of bytes that make up this method

throwsCatchesExc

public boolean throwsCatchesExc(java.lang.String methodName)
Returns true if this method throws or catches exceptions, otherwise it returns false.

Parameters:
methodName - the name of the method
Returns:
true if this method throws or catches exceptions, false otherwise.

getNumNonStaticFields

public int getNumNonStaticFields()
Returns the number of non-static fields in this class.

Returns:
the number of non-static fields in this class.

getNonStaticFields

public java.util.List getNonStaticFields()
Returns a List of all the Non-Static fields in the specified class.

Returns:
a List representation of all non-static field types in the specified class

addNonStaticField

public void addNonStaticField(java.lang.String type)
Adds a non-static field object of specified type to the collection.

Parameters:
type - the type of non-static field to add.

setNumStaticFields

public void setNumStaticFields(int number)
Sets the number of static fields to the specified number.

Parameters:
number - the number of static fields to acknowledge.

getNumStaticFields

public int getNumStaticFields()
Returns the number of static fields in this class.

Returns:
the number of static fields in this class

setNumNonBasicFields

public void setNumNonBasicFields(int numNonBasic)
Sets the number fields with non-basic types to the specified number

Parameters:
numNonBasic - the number of fields of non-basic type

getNumNonBasicFields

public int getNumNonBasicFields()
Returns the number of non-basic fields that this class contains.

Returns:
the number of non-basic fields that this class contains.

getNumberMethods

public int getNumberMethods()
Returns the number of methods which this method contains

Returns:
the number of methods which this method contains

setMethods

public void setMethods(EDU.purdue.cs.bloat.editor.MethodEditor[] methods)
Sets the methods in this class to the specified array of MethodEditor objects.

Parameters:
methods - the array of MethodEditor objects to add.

getMethodNames

public java.lang.String[] getMethodNames()
Retruns the names of all of the methods in the class specified

Returns:
String array representing all of the method names in the class specified

getMethodByteCodes

public java.util.List getMethodByteCodes(java.lang.String methodName)
Returns a List of the bytecodes in the specied method.

Parameters:
methodName - the name of the method from which to draw the bytecodes.
Returns:
a List of the bytecodes in the specied method.

getMethodByteCodeUsage

public java.lang.String getMethodByteCodeUsage(java.lang.String methodName)

getByteCodeUsage

public java.util.Hashtable getByteCodeUsage(java.lang.String methodName)

getNumNonStatFieldsByType

public int getNumNonStatFieldsByType(java.lang.String type)
Returns the number of non-static fields in this class that are of the specified type.

Parameters:
type - type to count.
Returns:
the number of non-static fields in this class that are of the specified type.

hasForwardBranch

public boolean hasForwardBranch(java.lang.String methodName)
Returns true if there is a forward branch instruction in the method specified.

Parameters:
methodName - the name of the method to inspect.
Returns:
true if there is a forward branch, otherwise false.

hasBackwardBranch

public boolean hasBackwardBranch(java.lang.String methodName)
Returns true if there is a backward branch instruction in the method specified.

Parameters:
methodName - the name of the method to inspect.
Returns:
true if there is a backward branch, otherwise false.

callsStaticMethods

public boolean callsStaticMethods(java.lang.String methodName)
Returns true if the specified method calls other static methods, otherwise false

Parameters:
methodName - the name of the method to investigate
Returns:
true if the specified method calls other static methods, otherwise false

callsDynamicMethods

public boolean callsDynamicMethods(java.lang.String methodName)
Returns true if the specified method calls other dynamic methods, otherwise false

Parameters:
methodName - the name of the method to investigate
Returns:
true if the specified method calls other static methods, otherwise false

SandMark version 2.0

Mon Jun 17 12:30:47 MST 2002