Class DavaFlowSet<T>
- java.lang.Object
-
- soot.toolkits.scalar.AbstractFlowSet<T>
-
- soot.dava.toolkits.base.AST.structuredAnalysis.DavaFlowSet<T>
-
- Direct Known Subclasses:
CPFlowSet,UnreachableCodeFinder.UnreachableCodeFlowSet
public class DavaFlowSet<T> extends AbstractFlowSet<T>
-
-
Constructor Summary
Constructors Constructor Description DavaFlowSet()DavaFlowSet(DavaFlowSet<T> other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(T e)Addsobjtothis.voidaddToBreakList(String labelBroken, DavaFlowSet<T> set)When an explicit break statement is encountered this method should be called to store the current davaflowsetvoidaddToContinueList(String labelContinued, DavaFlowSet<T> set)When an explicit continue statement is encountered this method should be called to store the current davaflowsetvoidaddToImplicitBreaks(DAbruptStmt ab, DavaFlowSet<T> set)The next two methods take an abruptStmt as input along with a flowSet.voidaddToImplicitContinues(DAbruptStmt ab, DavaFlowSet<T> set)voidclear()implemented, but *very* inefficient.DavaFlowSet<T>clone()Clones the current FlowSet.booleancontains(Object obj)Returns true if this FlowSet containsobj.voidcopy(FlowSet<T> destFlow)Copies the current FlowSet into dest.voidcopyInternalDataFrom(DavaFlowSet<T> fromThis)voiddifference(FlowSet<T> otherFlow, FlowSet<T> destFlow)Returns the set difference (this intersect ~other) of this FlowSet andother, putting result intodest.FlowSet<T>emptySet()implemented, but inefficient.booleanequals(Object otherFlow)Notice that the equals method only checks the equality of the elements of the flow set DavaFlowSet also contains information regarding abrupt control flow This should also be checked by invoking the internalDataMatchesTo methodList<DavaFlowSet<T>>getBreakSet(String label)List<DavaFlowSet<T>>getContinueSet(String label)TgetElementAt(int idx)intgetElementCount()HashMap<Serializable,List<DavaFlowSet<T>>>getImplicitBreaks()HashMap<Serializable,List<DavaFlowSet<T>>>getImplicitContinues()List<DavaFlowSet<T>>getImplicitlyBrokenSets(ASTNode node)List<DavaFlowSet<T>>getImplicitlyContinuedSets(ASTNode node)booleaninternalDataMatchesTo(Object otherObj)voidintersection(FlowSet<T> otherFlow, FlowSet<T> destFlow)Notice that the intersection method only merges the elements of the flow set DavaFlowSet also contains information regarding abrupt control flow This should also be merged using the copyInternalDataFrom methodbooleanisEmpty()Returns true if this FlowSet is the empty set.Iterator<T>iterator()returns an iterator over the elements of the flowSet.voidremove(int idx)voidremove(Object obj)Removesobjfromthis.intsize()Returns the size of the current FlowSet.List<T>toList()Returns a unbacked list of elements in this set.StringtoString()voidunion(FlowSet<T> otherFlow, FlowSet<T> destFlow)Notice that the union method only merges the elements of the flow set DavaFlowSet also contains information regarding abrupt control flow This should also be merged using the copyInternalDataFrom method-
Methods inherited from class soot.toolkits.scalar.AbstractFlowSet
add, difference, hashCode, intersection, isSubSet, remove, union
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface soot.toolkits.scalar.FlowSet
copyFreshToExisting
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
elements
protected T[] elements
-
-
Constructor Detail
-
DavaFlowSet
public DavaFlowSet()
-
DavaFlowSet
public DavaFlowSet(DavaFlowSet<T> other)
-
-
Method Detail
-
clone
public DavaFlowSet<T> clone()
Description copied from interface:FlowSetClones the current FlowSet.
-
emptySet
public FlowSet<T> emptySet()
Description copied from class:AbstractFlowSetimplemented, but inefficient.
-
clear
public void clear()
Description copied from class:AbstractFlowSetimplemented, but *very* inefficient.
-
size
public int size()
Description copied from interface:FlowSetReturns the size of the current FlowSet.
-
isEmpty
public boolean isEmpty()
Description copied from interface:FlowSetReturns true if this FlowSet is the empty set.
-
remove
public void remove(Object obj)
Description copied from interface:FlowSetRemovesobjfromthis.
-
remove
public void remove(int idx)
-
union
public void union(FlowSet<T> otherFlow, FlowSet<T> destFlow)
Notice that the union method only merges the elements of the flow set DavaFlowSet also contains information regarding abrupt control flow This should also be merged using the copyInternalDataFrom method
-
intersection
public void intersection(FlowSet<T> otherFlow, FlowSet<T> destFlow)
Notice that the intersection method only merges the elements of the flow set DavaFlowSet also contains information regarding abrupt control flow This should also be merged using the copyInternalDataFrom method- Specified by:
intersectionin interfaceFlowSet<T>- Overrides:
intersectionin classAbstractFlowSet<T>
-
difference
public void difference(FlowSet<T> otherFlow, FlowSet<T> destFlow)
Description copied from interface:FlowSetReturns the set difference (this intersect ~other) of this FlowSet andother, putting result intodest.dest,otherandthiscould be the same object.- Specified by:
differencein interfaceFlowSet<T>- Overrides:
differencein classAbstractFlowSet<T>
-
contains
public boolean contains(Object obj)
Description copied from interface:FlowSetReturns true if this FlowSet containsobj.
-
equals
public boolean equals(Object otherFlow)
Notice that the equals method only checks the equality of the elements of the flow set DavaFlowSet also contains information regarding abrupt control flow This should also be checked by invoking the internalDataMatchesTo method- Overrides:
equalsin classAbstractFlowSet<T>
-
copy
public void copy(FlowSet<T> destFlow)
Description copied from interface:FlowSetCopies the current FlowSet into dest.
-
addToBreakList
public void addToBreakList(String labelBroken, DavaFlowSet<T> set)
When an explicit break statement is encountered this method should be called to store the current davaflowset
-
addToContinueList
public void addToContinueList(String labelContinued, DavaFlowSet<T> set)
When an explicit continue statement is encountered this method should be called to store the current davaflowset
-
addToImplicitBreaks
public void addToImplicitBreaks(DAbruptStmt ab, DavaFlowSet<T> set)
The next two methods take an abruptStmt as input along with a flowSet. It should be only invoked for abrupt stmts which do not have explicit labels The node being targeted by this implicit stmt should be found Then the flow set should be added to the list within the appropriate hashmap
-
addToImplicitContinues
public void addToImplicitContinues(DAbruptStmt ab, DavaFlowSet<T> set)
-
getImplicitBreaks
public HashMap<Serializable,List<DavaFlowSet<T>>> getImplicitBreaks()
-
getImplicitContinues
public HashMap<Serializable,List<DavaFlowSet<T>>> getImplicitContinues()
-
getImplicitlyBrokenSets
public List<DavaFlowSet<T>> getImplicitlyBrokenSets(ASTNode node)
-
getImplicitlyContinuedSets
public List<DavaFlowSet<T>> getImplicitlyContinuedSets(ASTNode node)
-
copyInternalDataFrom
public void copyInternalDataFrom(DavaFlowSet<T> fromThis)
-
internalDataMatchesTo
public boolean internalDataMatchesTo(Object otherObj)
-
getContinueSet
public List<DavaFlowSet<T>> getContinueSet(String label)
-
getBreakSet
public List<DavaFlowSet<T>> getBreakSet(String label)
-
toString
public String toString()
- Overrides:
toStringin classAbstractFlowSet<T>
-
iterator
public Iterator<T> iterator()
Description copied from interface:FlowSetreturns an iterator over the elements of the flowSet. Note that the iterator might be backed, and hence be faster in the creation, than doingtoList().iterator().
-
getElementCount
public int getElementCount()
-
getElementAt
public T getElementAt(int idx)
-
-