|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--PremChaRM.PreUtils
This class contains lots of utilities for PremChaRM
class.
It contains only static fields and methods.
Field Summary | |
private static java.lang.String |
className
This field contains the name of the class instanciating PremChaRM class. |
static int |
dbgAllocation
Constant value for debugging. |
static int |
dbgGraphField
Constant value for debugging. |
static int |
dbgGraphMethod
Constant value for debugging. |
static int |
dbgMethodCall
Constant value for debugging. |
static int |
dbgOpenClasses
Constant value for debugging. |
static int |
dbgPrepClasses
Constant value for debugging. |
static int |
dbgPrintClasses
Constant value for debugging. |
static int |
dbgPrintExpression
Constant value for debugging. |
static int |
dbgSyntax
Constant value for debugging. |
static int |
dbgUtils
Constant value for debugging. |
static boolean[] |
debugLevel
Boolean array determining which debug levels have to be considered. |
Constructor Summary | |
PreUtils()
|
Method Summary | |
static java.util.Vector |
array2Vector(java.lang.Object[] inputArray)
This utility get a Vector object from an array one. |
static boolean |
equalsParameterType(OJMethod m1,
OJMethod m2)
This method tests if two OJMethod objects have the same parameter types. |
static boolean |
equalsParameterType(java.lang.String[] m1,
java.lang.String[] m2)
This method tests if two arrays of String have the same values. |
private static java.util.Vector |
expressionHandling(Expression expr,
java.util.Vector fields,
java.util.Vector ojFields)
This method returns all fields accessed by the given expression. |
static java.util.Vector |
fieldHandling(StatementList body,
java.util.Vector parameters,
java.util.Vector ojFields)
This method returns all fields accessed by the given statements. |
static void |
getCalledMethods(OJMethod method,
java.util.Vector foundMethods,
java.util.Vector allEnvs)
This method returns all MethodCall expressions present in the given OJMethod object's body. |
private static void |
getCalledMethodsByExpression(Expression expr,
java.util.Vector foundMethods,
java.util.Vector allEnvs,
ClosedEnvironment localEnv)
This method returns all MethodCall expressions found examining given expression. |
private static void |
getCalledMethodsByStatement(Statement stmnt,
java.util.Vector foundMethods,
java.util.Vector allEnvs,
ClosedEnvironment localEnv)
This method returns all MethodCall expressions found examining given statement. |
private static void |
getCalledMethodsByVariableInitializer(VariableInitializer varInit,
java.util.Vector foundMethods,
java.util.Vector allEnvs,
ClosedEnvironment localEnv)
This method returns all MethodCall expressions found examining given VariableInitializer. |
private static java.lang.String |
getName()
This method read the name of the class instanciating PremChaRM class. |
(package private) static boolean |
overriddenMethod(OJMethod ojMethod1,
OJMethod ojMethod2)
Check if two given OJMethod objects are overridden. |
static void |
printDebug(java.lang.String Msg,
int type,
int level)
Print on standard output the given string if the cell of debugLevel[] specified by type is true. |
static void |
printExceptionText(java.lang.String Text,
java.lang.Throwable e)
Print on standard error the given string followed by the stack trace of the given expression. |
static void |
setName(java.lang.String name)
This method allow to change the name of the class instanciating PremChaRM class. |
private static java.util.Vector |
statementHandling(Statement stmnt,
java.util.Vector fields,
java.util.Vector ojFields)
This method returns all fields accessed by the given statement. |
private static java.util.Vector |
VariableInitializerHandling(VariableInitializer varInit,
java.util.Vector fields,
java.util.Vector ojFields)
This method returns all fields accessed by the given VariableInitializer. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int dbgSyntax
public static final int dbgOpenClasses
public static final int dbgPrepClasses
public static final int dbgGraphMethod
public static final int dbgGraphField
public static final int dbgUtils
public static final int dbgPrintClasses
public static final int dbgPrintExpression
public static final int dbgAllocation
public static final int dbgMethodCall
public static final boolean[] debugLevel
false
that level must not be present, othewise it must be.
It is used by printDebug method.private static java.lang.String className
Constructor Detail |
public PreUtils()
Method Detail |
public static void setName(java.lang.String name)
name
.
name
- the name of the class instanciating PremChaRM class.private static java.lang.String getName()
public static boolean equalsParameterType(java.lang.String[] m1, java.lang.String[] m2)
m1
- first array.m2
- second array.public static boolean equalsParameterType(OJMethod m1, OJMethod m2)
m1
- first OJMethod object.m2
- second OJMethod object.public static void getCalledMethods(OJMethod method, java.util.Vector foundMethods, java.util.Vector allEnvs)
method
- starting OJMethod object.private static void getCalledMethodsByStatement(Statement stmnt, java.util.Vector foundMethods, java.util.Vector allEnvs, ClosedEnvironment localEnv)
stmnt
- statement to be examined.private static void getCalledMethodsByVariableInitializer(VariableInitializer varInit, java.util.Vector foundMethods, java.util.Vector allEnvs, ClosedEnvironment localEnv)
varInit
- VariableInitializar object to be examined.private static void getCalledMethodsByExpression(Expression expr, java.util.Vector foundMethods, java.util.Vector allEnvs, ClosedEnvironment localEnv)
expr
- Expression object to be examined.public static java.util.Vector fieldHandling(StatementList body, java.util.Vector parameters, java.util.Vector ojFields)
body
- starting statements to check (usually it is the body of a method).parameters
- a String Vector containing starting variables (usually these are a method's parameters).ojFields
- fields already declared (usually got with getAllFields).private static java.util.Vector VariableInitializerHandling(VariableInitializer varInit, java.util.Vector fields, java.util.Vector ojFields)
varInit
- starting VariableInitializer object to check.fields
- a String Vector containing starting variables.ojFields
- fields already declared.private static java.util.Vector statementHandling(Statement stmnt, java.util.Vector fields, java.util.Vector ojFields)
clone()
method). So new local
declared variables are stored into the copy and their scope is local to the statement.
stmnt
- starting statement to check.fields
- a String Vector containing starting variables.ojFields
- fields already declared.private static java.util.Vector expressionHandling(Expression expr, java.util.Vector fields, java.util.Vector ojFields)
stmnt
- starting statement to check.fields
- a String Vector containing starting variables.ojFields
- fields already declared.public static java.util.Vector array2Vector(java.lang.Object[] inputArray)
inputArray
- input Object array to be changed into Vector.static boolean overriddenMethod(OJMethod ojMethod1, OJMethod ojMethod2)
ojMethod1
- first OJMethod object.ojMethod2
- second OJMethod object.public static void printExceptionText(java.lang.String Text, java.lang.Throwable e)
Text
- String to be printed.e
- Exception whose stack trace must be printed.public static void printDebug(java.lang.String Msg, int type, int level)
Msg
- String to be printed.type
- index of debudLevel[] rappresenting the type of print.level
- rappresent the indent of print.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |