|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmain.progAnal.ProgramAnalyser
main.progAnal.ConditionChecker
Class to check conditions under which variables are assigned and used
Constructor Summary | |
ConditionChecker(LinkedHashMap inputMap,
String var,
ArrayList methodNames)
Constructor for ConditionChecker |
Method Summary | |
ArrayList |
arrayCheck()
Return list of statements where variable appears to be being used like an array |
ArrayList |
assignBeforeUse(HashMap usageInAssignments)
Return list of statements where variable is assigned with value in loop before it is used in that loop |
ArrayList |
assignedWithMethod(HashMap assignmentsInLoop)
Return list of statement in which variable is assigned with output from method call |
ArrayList |
assignmentInFor(String what)
Return list of statements where variable is assigned in a "for" loop declaration |
HashMap |
conditionAssignStatement()
Return map containing assignment statements and branch statements where variable is condition for branch |
HashMap |
conditionForAssignmentBranch(HashMap assignmentsInBranch,
HashMap inputLoopStatements)
Return map containing incidences where assignment in branch is also in loop |
HashMap |
foundIn(String what,
String where)
Return map of statements found in loops or branches |
HashMap |
foundInAssignmentLoop(HashMap assignmentsInLoop,
HashMap inputLoopStatements)
Return variable statements occuring in assignment loops together with loop signatures and line numbers |
boolean |
indirectUse(HashMap foundInAssignmentLoop)
Return true if assignment loop is dependent on assignment statement following conditional use for a given variable |
ArrayList |
nestedBooleanAssign(HashMap assignmentsInLoop)
Return list of statements in which variable is indirectly toggled by being set twice within a loop, once in a nested loop, with opposing values |
boolean |
noAssignmentStatement()
Return whether there is no assignment statement for variable |
boolean |
noDirectUsage()
Return if variable is not used directly in the program |
boolean |
onlyOneAssignmentStatement()
Return whether there is only one assignment statement for the variable in the program |
ArrayList |
otherAssignment(HashMap assignmentsInLoop)
Return list of statements where variable is assigned with value from instantiation of new object, or assigned directly with boolean value |
HashMap |
outsideAssignLoop(HashMap inAssignLoop,
String what)
Return map of statements where variable is used outside of the loop in which it is assigned |
ArrayList |
reorganize()
Return list of statements where variable appears to be being used as organizer |
ArrayList |
statementTypeCheck(HashMap assignmentsInLoop,
String statementType)
Return list of statement of a given type |
ArrayList |
transform(HashMap assignmentsInLoop)
Return list of statements where variable appears to be being used as transformation |
ArrayList |
useForLoopCondition(HashMap foundInAssignmentLoop)
Return ArrayList of statements where use in assignment loop is directly or indirectly related to loop condition |
Methods inherited from class main.progAnal.ProgramAnalyser |
afterEquals, arithExp, arithExp, branch, contains, control, inBrackets, is, isClass, isElse, isIf, isInArray, loop, methodStatement, printUse, removeSpaces, subString, throwStatement, tryCatchStatement |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ConditionChecker(LinkedHashMap inputMap, String var, ArrayList methodNames)
var
- Name of input variableinputMap
- Analysed map of variable statementsmethodNames
- List of method names in calssMethod Detail |
public boolean noAssignmentStatement()
public boolean onlyOneAssignmentStatement()
public HashMap foundIn(String what, String where)
what
- String being the category of statementwhere
- String signifying whether to look in loops or branches
public HashMap foundInAssignmentLoop(HashMap assignmentsInLoop, HashMap inputLoopStatements)
assignmentsInLoop
- HashMap of assignment statements found in loopsinputLoopStatements
- HashMap of loop statements
public ArrayList useForLoopCondition(HashMap foundInAssignmentLoop)
foundInAssignmentLoop
- HashMap of statement found in assignment loop
public boolean indirectUse(HashMap foundInAssignmentLoop)
foundInAssignmentLoop
- HashMap of statements found in assignment loop
public ArrayList assignmentInFor(String what)
what
- String signfying the category of statement
public boolean noDirectUsage()
public HashMap conditionAssignStatement()
public HashMap conditionForAssignmentBranch(HashMap assignmentsInBranch, HashMap inputLoopStatements)
assignmentsInBranch
- HashMap containing assignmentsInBranchinputLoopStatements
- HashMap containing loop statements
public ArrayList statementTypeCheck(HashMap assignmentsInLoop, String statementType)
assignmentsInLoop
- HashMap of assignment statements found in loopsstatementType
- String being the type of statement to look for
public HashMap outsideAssignLoop(HashMap inAssignLoop, String what)
inAssignLoop
- HashMap containing usage/conditional statement found in
assignment loopwhat
- String being category of statement
public ArrayList arrayCheck()
public ArrayList reorganize()
public ArrayList transform(HashMap assignmentsInLoop)
assignmentsInLoop
- HashMap containing assignments in loops
public ArrayList nestedBooleanAssign(HashMap assignmentsInLoop)
assignmentsInLoop
- HashMap of assignment statements in loop
public ArrayList assignedWithMethod(HashMap assignmentsInLoop)
assignmentsInLoop
- HashMap of assignment statements found in loops
public ArrayList assignBeforeUse(HashMap usageInAssignments)
usageInAssignments
-
public ArrayList otherAssignment(HashMap assignmentsInLoop)
assignmentsInLoop
- HashMap of assignment statement found in loops
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |