Package proguard.analysis.cpa.bam
Class BamCacheImpl<ContentT extends AbstractState<ContentT>>
- java.lang.Object
-
- proguard.analysis.cpa.bam.BamCacheImpl<ContentT>
-
- Type Parameters:
ContentT- The content of the jvm states. For example, this can be aSetAbstractStateof taints for taint analysis or aValueAbstractStatefor value analysis.
- All Implemented Interfaces:
BamCache<ContentT>
public class BamCacheImpl<ContentT extends AbstractState<ContentT>> extends java.lang.Object implements BamCache<ContentT>
A simple implementation ofBamCachewhere the cache is implemented as aHashMap.
-
-
Constructor Summary
Constructors Constructor Description BamCacheImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<BlockAbstraction<ContentT>>get(Precision precision, MethodSignature blockKey)Returns a collection of all the cache entries for a specified method with a certain precision, empty in case there are not such entries.BlockAbstraction<ContentT>get(JvmAbstractState<ContentT> stateKey, Precision precisionKey, MethodSignature blockKey)Gets the block abstraction identified by the provided keys from the cache.java.util.Collection<BlockAbstraction<ContentT>>get(MethodSignature blockKey)Returns a collection of all the cache entries for a specified method, empty in case there are not such entries.java.util.Set<MethodSignature>getAllMethods()Returns a set of all the methods that have an entry in the cache.voidput(JvmAbstractState<ContentT> stateKey, Precision precisionKey, MethodSignature blockKey, BlockAbstraction<ContentT> blockAbstraction)Adds the block abstraction identified by the provided keys to the cache.intsize()Returns the size of the cache.java.util.Collection<BlockAbstraction<ContentT>>values()Returns block abstractions stored in the cache.
-
-
-
Method Detail
-
put
public void put(JvmAbstractState<ContentT> stateKey, Precision precisionKey, MethodSignature blockKey, BlockAbstraction<ContentT> blockAbstraction)
Description copied from interface:BamCacheAdds the block abstraction identified by the provided keys to the cache.- Specified by:
putin interfaceBamCache<ContentT extends AbstractState<ContentT>>
-
get
public BlockAbstraction<ContentT> get(JvmAbstractState<ContentT> stateKey, Precision precisionKey, MethodSignature blockKey)
Description copied from interface:BamCacheGets the block abstraction identified by the provided keys from the cache.- Specified by:
getin interfaceBamCache<ContentT extends AbstractState<ContentT>>- Returns:
- The requested block abstraction, null in case of cache-miss.
-
get
public java.util.Collection<BlockAbstraction<ContentT>> get(MethodSignature blockKey)
Description copied from interface:BamCacheReturns a collection of all the cache entries for a specified method, empty in case there are not such entries.- Specified by:
getin interfaceBamCache<ContentT extends AbstractState<ContentT>>
-
get
public java.util.Collection<BlockAbstraction<ContentT>> get(Precision precision, MethodSignature blockKey)
Description copied from interface:BamCacheReturns a collection of all the cache entries for a specified method with a certain precision, empty in case there are not such entries.- Specified by:
getin interfaceBamCache<ContentT extends AbstractState<ContentT>>
-
values
public java.util.Collection<BlockAbstraction<ContentT>> values()
Description copied from interface:BamCacheReturns block abstractions stored in the cache.- Specified by:
valuesin interfaceBamCache<ContentT extends AbstractState<ContentT>>
-
size
public int size()
Description copied from interface:BamCacheReturns the size of the cache.- Specified by:
sizein interfaceBamCache<ContentT extends AbstractState<ContentT>>
-
getAllMethods
public java.util.Set<MethodSignature> getAllMethods()
Description copied from interface:BamCacheReturns a set of all the methods that have an entry in the cache.- Specified by:
getAllMethodsin interfaceBamCache<ContentT extends AbstractState<ContentT>>
-
-