Class AllocationSite
- java.lang.Object
-
- com.tonic.analysis.simulation.heap.AllocationSite
-
public final class AllocationSite extends Object
The identity of one allocation in the program - class, owning method and instruction index - which bounds points-to analysis to one abstract object per NEW instruction.
-
-
Field Summary
Fields Modifier and Type Field Description static AllocationSiteEXTERNALstatic StringUNKNOWN_METHOD
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static AllocationSiteexternal(String className)Creates a site for an object that entered from outside the analysed code.StringgetClassName()intgetInstructionIndex()StringgetMethodKey()inthashCode()booleanisExternal()booleanisSynthetic()static AllocationSiteof(String className, int instructionIndex, String methodKey)Creates a site for an allocation seen in analysed code.static AllocationSitesynthetic(String className, String description)Creates a site for an object the analysis invents rather than one the program allocates.StringtoString()
-
-
-
Field Detail
-
UNKNOWN_METHOD
public static final String UNKNOWN_METHOD
- See Also:
- Constant Field Values
-
EXTERNAL
public static final AllocationSite EXTERNAL
-
-
Method Detail
-
of
public static AllocationSite of(String className, int instructionIndex, String methodKey)
Creates a site for an allocation seen in analysed code.- Parameters:
className- internal name of the allocated classinstructionIndex- index of the allocating instructionmethodKey- key of the method containing the allocation- Returns:
- the allocation site
- Throws:
NullPointerException- if className or methodKey is null
-
external
public static AllocationSite external(String className)
Creates a site for an object that entered from outside the analysed code.- Parameters:
className- internal name of the object's class- Returns:
- the allocation site
- Throws:
NullPointerException- if className is null
-
synthetic
public static AllocationSite synthetic(String className, String description)
Creates a site for an object the analysis invents rather than one the program allocates.- Parameters:
className- internal name of the object's classdescription- what the synthetic object stands for- Returns:
- the allocation site
- Throws:
NullPointerException- if className is null
-
getClassName
public String getClassName()
- Returns:
- the class name
-
getInstructionIndex
public int getInstructionIndex()
- Returns:
- the instruction index
-
getMethodKey
public String getMethodKey()
- Returns:
- the method key
-
isExternal
public boolean isExternal()
- Returns:
- true if this site stands for an object from outside the analysed code
-
isSynthetic
public boolean isSynthetic()
- Returns:
- true if this site stands for an object invented by the analysis
-
-