Class ConditionalTransferResult<V extends AbstractValue<V>,S extends Store<S>>
- Type Parameters:
V
- type of the abstract value that is trackedS
- the store type used in the analysis
TransferResult
with two non-exceptional stores. The 'then' store
contains information valid when the previous boolean-valued expression was true, and the 'else'
store contains information valid when the expression was false.
getRegularStore()
returns the least upper bound of the two underlying stores.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final S
The 'else' result store.protected final S
The 'then' result store.Fields inherited from class org.checkerframework.dataflow.analysis.TransferResult
exceptionalStores, resultValue
-
Constructor Summary
ConstructorDescriptionConditionalTransferResult
(@Nullable V value, S thenStore, S elseStore) Create a newConditionalTransferResult(AbstractValue, Store, Store, Map, boolean)
, usingfalse
for whether the store changed andnull
forTransferResult.exceptionalStores
.ConditionalTransferResult
(@Nullable V value, S thenStore, S elseStore, boolean storeChanged) Create a newConditionalTransferResult(AbstractValue, Store, Store, Map, boolean)
, usingnull
forTransferResult.exceptionalStores
.ConditionalTransferResult
(@Nullable V value, S thenStore, S elseStore, @Nullable Map<TypeMirror, S> exceptionalStores, boolean storeChanged) Create aConditionalTransferResult
withthenStore
as the resulting store if the correspondingNode
evaluates totrue
andelseStore
otherwise.ConditionalTransferResult
(V value, S thenStore, S elseStore, Map<TypeMirror, S> exceptionalStores) Create a newConditionalTransferResult(AbstractValue, Store, Store, Map, boolean)
, usingfalse
for thestoreChanged
formal parameter. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if and only if this transfer result contains two stores that are potentially not equal.Returns the result store produced if theNode
this result belongs to evaluates tofalse
.The regular result store.Returns the result store produced if theNode
this result belongs to evaluates totrue
.boolean
Returnstrue
if and only if the transfer function returning this transfer result changed the regularStore, elseStore, or thenStore.toString()
Methods inherited from class org.checkerframework.dataflow.analysis.TransferResult
getExceptionalStore, getExceptionalStores, getResultValue, setResultValue
-
Field Details
-
thenStore
The 'then' result store. -
elseStore
The 'else' result store.
-
-
Constructor Details
-
ConditionalTransferResult
Create a newConditionalTransferResult(AbstractValue, Store, 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:
thenStore
andelseStore
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 functionthenStore
- 'then' result storeelseStore
- 'else' result storestoreChanged
- whether the store changed- See Also:
-
ConditionalTransferResult
Create a newConditionalTransferResult(AbstractValue, Store, Store, Map, boolean)
, usingfalse
for whether the store changed andnull
forTransferResult.exceptionalStores
. -
ConditionalTransferResult
public ConditionalTransferResult(V value, S thenStore, S elseStore, Map<TypeMirror, S> exceptionalStores) Create a newConditionalTransferResult(AbstractValue, Store, Store, Map, boolean)
, usingfalse
for thestoreChanged
formal parameter.- Parameters:
value
- the abstract value produced by the transfer functionthenStore
-thenStore
elseStore
-elseStore
exceptionalStores
-TransferResult.exceptionalStores
- See Also:
-
ConditionalTransferResult
public ConditionalTransferResult(@Nullable V value, S thenStore, S elseStore, @Nullable Map<TypeMirror, S> exceptionalStores, boolean storeChanged) Create aConditionalTransferResult
withthenStore
as the resulting store if the correspondingNode
evaluates totrue
andelseStore
otherwise.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:
thenStore
,elseStore
, 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 functionthenStore
-thenStore
elseStore
-elseStore
exceptionalStores
-TransferResult.exceptionalStores
storeChanged
- whether the store changed; seeTransferResult.storeChanged()
.
-
-
Method Details
-
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
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
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
-
storeChanged
public boolean storeChanged()Description copied from class:TransferResult
Returnstrue
if and only if the transfer function returning this transfer result changed the regularStore, elseStore, or thenStore.- 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
-