de.unisaarland.cs.st.jerify.verifier.typestate
Class MethodTypestateAnalysis

java.lang.Object
  extended by de.unisaarland.cs.st.jerify.verifier.typestate.MethodTypestateAnalysis
All Implemented Interfaces:
CFGAnalysis<MethodTypestateAnalysis>

@DefaultQualifier(value="checkers.nullness.quals.NonNull")
public class MethodTypestateAnalysis
extends java.lang.Object
implements CFGAnalysis<MethodTypestateAnalysis>

The analysis data that is propagated in the control flow graph.

Author:
Daniel Wand (typestate@ewand.de)

Constructor Summary
MethodTypestateAnalysis(checkers.types.AnnotatedTypeFactory factory)
          Create an empty Analysis
MethodTypestateAnalysis(checkers.types.AnnotatedTypeFactory factory, MethodTypestateAnalysis copyFrom)
          Create an Analysis which copies its content form the passed Analysis
 
Method Summary
 void addReference(java.lang.Integer id)
          Declare that there is an additional Reference for the Object with id id
 void applyFilter(java.util.Set<Pair<java.lang.Integer,java.util.Collection<java.lang.String>>> filterSet)
          Apply the Changes previously parsed from the set changes
 void applySetChanges(java.util.Set<Pair<java.lang.Integer,State>> stateSetTo)
          Apply the Changes previously parsed from the set changes
 void applyStateChanges(com.sun.source.tree.Tree tree, StateChanges stateChanges, java.util.Collection<java.lang.Integer> aliases)
          Apply the Changes previously parsed from the state changes
 CFGAnalysis<MethodTypestateAnalysis> deepCopy()
          Return an isolated Analysis, where changes will not affect this
 boolean equals(java.lang.Object o)
           
 MethodTypestateAnalysis getAnalysisData()
          return the analysis
 boolean isSubsetOf(CFGAnalysis<MethodTypestateAnalysis> analysis)
          Tests if this is a subset of analysis
 MethodTypestateAnalysis merge(CFGAnalysis<MethodTypestateAnalysis> other)
          Incorporate the analysis (other) into this analysis.
 void removeObject(java.lang.Integer id)
          Removes an Object from the analysis (useful if that object scope ends ...)
 void removeReference(java.lang.Integer id)
          Declare that there is one Reference less of the Object with id id.
 void removeReferences(java.util.Set<java.lang.Integer> ids)
           
 MethodTypestateAnalysis replaceWith(CFGAnalysis<MethodTypestateAnalysis> other)
          Replace this analysis with the one passed (other).
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.unisaarland.cs.st.jerify.verifier.cfg.flownodes.CFGAnalysis
hashCode
 

Constructor Detail

MethodTypestateAnalysis

public MethodTypestateAnalysis(checkers.types.AnnotatedTypeFactory factory)
Create an empty Analysis


MethodTypestateAnalysis

public MethodTypestateAnalysis(checkers.types.AnnotatedTypeFactory factory,
                               MethodTypestateAnalysis copyFrom)
Create an Analysis which copies its content form the passed Analysis

Parameters:
copyFrom - to copy from
Method Detail

deepCopy

public CFGAnalysis<MethodTypestateAnalysis> deepCopy()
Return an isolated Analysis, where changes will not affect this

Specified by:
deepCopy in interface CFGAnalysis<MethodTypestateAnalysis>

isSubsetOf

public boolean isSubsetOf(CFGAnalysis<MethodTypestateAnalysis> analysis)
Tests if this is a subset of analysis

Specified by:
isSubsetOf in interface CFGAnalysis<MethodTypestateAnalysis>

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface CFGAnalysis<MethodTypestateAnalysis>
Overrides:
equals in class java.lang.Object

replaceWith

public MethodTypestateAnalysis replaceWith(CFGAnalysis<MethodTypestateAnalysis> other)
Replace this analysis with the one passed (other). This is used in the visitors because the analysis is stored in the variable that is passed as an argument, and cannot be changed by returning a different analysis. So we must be able to replace the analysis.

Specified by:
replaceWith in interface CFGAnalysis<MethodTypestateAnalysis>

merge

public MethodTypestateAnalysis merge(CFGAnalysis<MethodTypestateAnalysis> other)
Incorporate the analysis (other) into this analysis.

Specified by:
merge in interface CFGAnalysis<MethodTypestateAnalysis>

addReference

public void addReference(java.lang.Integer id)
Declare that there is an additional Reference for the Object with id id

Parameters:
id - the id of the object

removeReferences

public void removeReferences(java.util.Set<java.lang.Integer> ids)

removeReference

public void removeReference(java.lang.Integer id)
Declare that there is one Reference less of the Object with id id. The tracking of the Object stops, when there are zero References. So be careful when removing references (so the analysis does not lose objects).

Parameters:
id - the id of the object

removeObject

public void removeObject(java.lang.Integer id)
Removes an Object from the analysis (useful if that object scope ends ...)

Parameters:
id - the object to remove

applySetChanges

public void applySetChanges(java.util.Set<Pair<java.lang.Integer,State>> stateSetTo)
Apply the Changes previously parsed from the set changes

Parameters:
tree -
stateChanges -
aliases -

applyFilter

public void applyFilter(java.util.Set<Pair<java.lang.Integer,java.util.Collection<java.lang.String>>> filterSet)
Apply the Changes previously parsed from the set changes

Parameters:
tree -
stateChanges -
aliases -

applyStateChanges

public void applyStateChanges(com.sun.source.tree.Tree tree,
                              StateChanges stateChanges,
                              java.util.Collection<java.lang.Integer> aliases)
Apply the Changes previously parsed from the state changes

Parameters:
tree -
stateChanges -
aliases -

toString

public java.lang.String toString()
Specified by:
toString in interface CFGAnalysis<MethodTypestateAnalysis>
Overrides:
toString in class java.lang.Object

getAnalysisData

public MethodTypestateAnalysis getAnalysisData()
return the analysis

Specified by:
getAnalysisData in interface CFGAnalysis<MethodTypestateAnalysis>