Class TransferResult<V extends AbstractValue<V>,S extends Store<S>>
java.lang.Object
org.checkerframework.dataflow.analysis.TransferResult<V,S>
- Type Parameters:
V
- type of the abstract value that is trackedS
- the store type used in the analysis
- Direct Known Subclasses:
ConditionalTransferResult
,RegularTransferResult
TransferResult
is used as the result type of the individual transfer functions of a
TransferFunction
. It always belongs to the result of the individual transfer function for
a particular Node
, even though that
org.checkerframework.dataflow.cfg.node.Node
is not explicitly stored in TransferResult
.
A TransferResult
consists of a result value, plus one or more stores. It contains one
or two stores (for 'then' and 'else'), plus zero or more stores with a cause (TypeMirror
).
-
Field Summary
Modifier and TypeFieldDescriptionprotected final @Nullable Map<TypeMirror,
S> The stores in case the basic block throws an exception (ornull
if the correspondingNode
does not throw any exceptions).The abstract value of theNode
associated with thisTransferResult
, ornull
if no value has been produced. -
Constructor Summary
ModifierConstructorDescriptionprotected
TransferResult
(@Nullable V resultValue, @Nullable Map<TypeMirror, S> exceptionalStores) Create a new TransferResult, givenresultValue
andexceptionalStores
. -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
Returnstrue
if and only if this transfer result contains two stores that are potentially not equal.abstract S
Returns the result store produced if theNode
this result belongs to evaluates tofalse
.getExceptionalStore
(TypeMirror exception) Returns the store that flows along the outgoing exceptional edge labeled withexception
(ornull
if no special handling is required for exceptional edges).abstract S
Returns the regular result store produced if no exception is thrown by theNode
corresponding to this transfer function result.Returns the abstract value produced by the transfer function,null
otherwise.abstract S
Returns the result store produced if theNode
this result belongs to evaluates totrue
.void
setResultValue
(V resultValue) Set the value ofresultValue
.abstract boolean
Returnstrue
if and only if the transfer function returning this transfer result changed the regularStore, elseStore, or thenStore.
-
Field Details
-
resultValue
The abstract value of theNode
associated with thisTransferResult
, ornull
if no value has been produced.Is set by
setResultValue(V)
. -
exceptionalStores
The stores in case the basic block throws an exception (ornull
if the correspondingNode
does not throw any exceptions). Does not necessarily contain a store for every exception, in which case the in-store will be used.
-
-
Constructor Details
-
TransferResult
Create a new TransferResult, givenresultValue
andexceptionalStores
.- Parameters:
resultValue
- the abstract value of theNode
associated with thisTransferResult
exceptionalStores
- the stores in case the basic block throws an exception (ornull
if the correspondingNode
does not throw any exceptions)
-
-
Method Details
-
getResultValue
Returns the abstract value produced by the transfer function,null
otherwise.- Returns:
- the abstract value produced by the transfer function,
null
otherwise
-
setResultValue
Set the value ofresultValue
.- Parameters:
resultValue
- the abstract value of theNode
associated with thisTransferResult
-
getRegularStore
Returns the regular result store produced if no exception is thrown by theNode
corresponding to this transfer function result.- Returns:
- the regular result store produced if no exception is thrown by the
Node
corresponding to this transfer function result
-
getThenStore
Returns the result store produced if theNode
this result belongs to evaluates totrue
.- Returns:
- the result store produced if the
Node
this result belongs to evaluates totrue
-
getElseStore
Returns the result store produced if theNode
this result belongs to evaluates tofalse
.- Returns:
- the result store produced if the
Node
this result belongs to evaluates tofalse
-
getExceptionalStore
Returns the store that flows along the outgoing exceptional edge labeled withexception
(ornull
if no special handling is required for exceptional edges).- Parameters:
exception
- an exception type- Returns:
- the store that flows along the outgoing exceptional edge labeled with
exception
(ornull
if no special handling is required for exceptional edges)
-
getExceptionalStores
- Returns:
- a Map of
TypeMirror
toStore
,null
otherwise - See Also:
-
containsTwoStores
public abstract boolean containsTwoStores()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.- Returns:
true
if and only if this transfer result contains two stores that are potentially not equal
-
storeChanged
public abstract boolean storeChanged()Returnstrue
if and only if the transfer function returning this transfer result changed the regularStore, elseStore, or thenStore.- Returns:
true
if and only if the transfer function returning this transfer result changed the regularStore, elseStore, or thenStore
-