Package pascal.taie.util
Class AbstractResultHolder
java.lang.Object
pascal.taie.util.AbstractResultHolder
- All Implemented Interfaces:
ResultHolder
- Direct Known Subclasses:
DefaultIR
,JClass
,PointerAnalysisResultImpl
,World
Map-based implementation for
ResultHolder
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearAll()
Clears all cached results.void
clearResult
(String key) Clears result of the analysis specified by given key.getKeys()
<R> R
Given a key, returns the corresponding results.<R> R
If this holder contains the result for given key, then returns the result; otherwise, supplier is used to create a result, which is stored in the holder, and returned as the result of the call.<R> R
If this holder contains the result for given key, then returns the result; otherwise, return the given default result.boolean
<R> void
storeResult
(String key, R result) Stores the analysis result with the key.
-
Constructor Details
-
AbstractResultHolder
public AbstractResultHolder()
-
-
Method Details
-
storeResult
Description copied from interface:ResultHolder
Stores the analysis result with the key.- Specified by:
storeResult
in interfaceResultHolder
-
hasResult
- Specified by:
hasResult
in interfaceResultHolder
- Returns:
true
if the holder contains the result for given id.
-
getResult
Description copied from interface:ResultHolder
Given a key, returns the corresponding results.- Specified by:
getResult
in interfaceResultHolder
-
getResult
Description copied from interface:ResultHolder
If this holder contains the result for given key, then returns the result; otherwise, return the given default result.- Specified by:
getResult
in interfaceResultHolder
-
getResult
Description copied from interface:ResultHolder
If this holder contains the result for given key, then returns the result; otherwise, supplier is used to create a result, which is stored in the holder, and returned as the result of the call.- Specified by:
getResult
in interfaceResultHolder
-
getKeys
- Specified by:
getKeys
in interfaceResultHolder
- Returns:
- all keys in the holder.
-
clearResult
Description copied from interface:ResultHolder
Clears result of the analysis specified by given key.- Specified by:
clearResult
in interfaceResultHolder
-
clearAll
public void clearAll()Description copied from interface:ResultHolder
Clears all cached results.- Specified by:
clearAll
in interfaceResultHolder
-