Class RegularTransferResult<V extends AbstractValue<V>,S extends Store<S>>
- java.lang.Object
-
- org.checkerframework.dataflow.analysis.TransferResult<V,S>
-
- org.checkerframework.dataflow.analysis.RegularTransferResult<V,S>
-
- Type Parameters:
V
- type of the abstract value that is trackedS
- the store type used in the analysis
public class RegularTransferResult<V extends AbstractValue<V>,S extends Store<S>> extends TransferResult<V,S>
Implementation of aTransferResult
with just one non-exceptional store. The result ofgetThenStore
andgetElseStore
is equal to the only underlying store.
-
-
Field Summary
Fields Modifier and Type Field Description protected S
store
The regular result store.-
Fields inherited from class org.checkerframework.dataflow.analysis.TransferResult
exceptionalStores, resultValue
-
-
Constructor Summary
Constructors Constructor Description RegularTransferResult(@Nullable V value, S resultStore)
Create a newRegularTransferResult(AbstractValue, Store, Map, boolean)
, usingnull
forTransferResult.exceptionalStores
andfalse
forTransferResult.storeChanged()
.RegularTransferResult(@Nullable V value, S resultStore, boolean storeChanged)
Create a newRegularTransferResult(AbstractValue, Store, Map, boolean)
, usingnull
forTransferResult.exceptionalStores
.RegularTransferResult(@Nullable V value, S resultStore, @Nullable java.util.Map<javax.lang.model.type.TypeMirror,S> exceptionalStores)
Create a newRegularTransferResult(AbstractValue, Store, Map, boolean)
, usingfalse
forTransferResult.storeChanged()
.RegularTransferResult(@Nullable V value, S resultStore, @Nullable java.util.Map<javax.lang.model.type.TypeMirror,S> exceptionalStores, boolean storeChanged)
Create aTransferResult
withresultStore
as the resulting store.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsTwoStores()
Returnstrue
if and only if this transfer result contains two stores that are potentially not equal.S
getElseStore()
Returns the result store produced if theNode
this result belongs to evaluates tofalse
.S
getRegularStore()
The regular result store.S
getThenStore()
Returns the result store produced if theNode
this result belongs to evaluates totrue
.boolean
storeChanged()
java.lang.String
toString()
-
Methods inherited from class org.checkerframework.dataflow.analysis.TransferResult
getExceptionalStore, getExceptionalStores, getResultValue, setResultValue
-
-
-
-
Constructor Detail
-
RegularTransferResult
public RegularTransferResult(@Nullable V value, S resultStore, boolean storeChanged)
Create a newRegularTransferResult(AbstractValue, Store, Map, boolean)
, usingnull
forTransferResult.exceptionalStores
.Exceptions: If the corresponding
Node
throws an exception, then it is assumed that no special handling is necessary and the store before the correspondingNode
will be passed along any exceptional edge.Aliasing:
resultStore
is not allowed to be used anywhere outside of this class (including use through aliases). Complete control over the object is transferred to this class.- Parameters:
value
- the abstract value produced by the transfer functionresultStore
- regular result storestoreChanged
- whether the store changed; seeTransferResult.storeChanged()
- See Also:
RegularTransferResult(AbstractValue, Store, Map, boolean)
-
RegularTransferResult
public RegularTransferResult(@Nullable V value, S resultStore)
Create a newRegularTransferResult(AbstractValue, Store, Map, boolean)
, usingnull
forTransferResult.exceptionalStores
andfalse
forTransferResult.storeChanged()
.- Parameters:
value
- the abstract value produced by the transfer functionresultStore
- regular result store- See Also:
RegularTransferResult(AbstractValue, Store, Map, boolean)
-
RegularTransferResult
public RegularTransferResult(@Nullable V value, S resultStore, @Nullable java.util.Map<javax.lang.model.type.TypeMirror,S> exceptionalStores)
Create a newRegularTransferResult(AbstractValue, Store, Map, boolean)
, usingfalse
forTransferResult.storeChanged()
.- Parameters:
value
- the abstract value produced by the transfer functionresultStore
- the regular result storeexceptionalStores
- the stores in case the basic block throws an exception, or null if the basic block does not throw any exceptions- See Also:
RegularTransferResult(AbstractValue, Store, Map, boolean)
-
RegularTransferResult
public RegularTransferResult(@Nullable V value, S resultStore, @Nullable java.util.Map<javax.lang.model.type.TypeMirror,S> exceptionalStores, boolean storeChanged)
Create aTransferResult
withresultStore
as the resulting store. If the correspondingNode
is a boolean node, thenresultStore
is used for both the 'then' and 'else' edge.Exceptions: If the corresponding
Node
throws an exception, then the corresponding store inexceptionalStores
is used. If no exception is found inexceptionalStores
, then it is assumed that no special handling is necessary and the store before the correspondingNode
will be passed along any exceptional edge.Aliasing:
resultStore
and any store inexceptionalStores
are not allowed to be used anywhere outside of this class (including use through aliases). Complete control over the objects is transferred to this class.- Parameters:
value
- the abstract value produced by the transfer functionresultStore
- the regular result storeexceptionalStores
- the stores in case the basic block throws an exception, or null if the basic block does not throw any exceptionsstoreChanged
- seeTransferResult.storeChanged()
-
-
Method Detail
-
getRegularStore
public S getRegularStore()
The regular result store.- Specified by:
getRegularStore
in classTransferResult<V extends AbstractValue<V>,S extends Store<S>>
- Returns:
- the regular result store produced if no exception is thrown by the
Node
corresponding to this transfer function result
-
getThenStore
public S getThenStore()
Description copied from class:TransferResult
Returns the result store produced if theNode
this result belongs to evaluates totrue
.- Specified by:
getThenStore
in classTransferResult<V extends AbstractValue<V>,S extends Store<S>>
- Returns:
- the result store produced if the
Node
this result belongs to evaluates totrue
-
getElseStore
public S getElseStore()
Description copied from class:TransferResult
Returns the result store produced if theNode
this result belongs to evaluates tofalse
.- Specified by:
getElseStore
in classTransferResult<V extends AbstractValue<V>,S extends Store<S>>
- Returns:
- the result store produced if the
Node
this result belongs to evaluates tofalse
-
containsTwoStores
public boolean containsTwoStores()
Description copied from class:TransferResult
Returnstrue
if and only if this transfer result contains two stores that are potentially not equal. Note that the resulttrue
does not imply thatgetRegularStore
cannot be called (or vice versa forfalse
). Rather, it indicates thatgetThenStore
orgetElseStore
can be used to give more precise results. Otherwise, if the result isfalse
, then all three methodsgetRegularStore
,getThenStore
, andgetElseStore
return equivalent stores.- Specified by:
containsTwoStores
in classTransferResult<V extends AbstractValue<V>,S extends Store<S>>
- Returns:
true
if and only if this transfer result contains two stores that are potentially not equal
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
storeChanged
public boolean storeChanged()
- Specified by:
storeChanged
in classTransferResult<V extends AbstractValue<V>,S extends Store<S>>
- Returns:
true
if and only if the transfer function returning this transfer result changed the regularStore, elseStore, or thenStore- See Also:
TransferResult.storeChanged()
-
-