本文整理汇总了Java中edu.umd.cs.findbugs.util.MapCache类的典型用法代码示例。如果您正苦于以下问题:Java MapCache类的具体用法?Java MapCache怎么用?Java MapCache使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MapCache类属于edu.umd.cs.findbugs.util包,在下文中一共展示了MapCache类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMap
import edu.umd.cs.findbugs.util.MapCache; //导入依赖的package包/类
private static <DescriptorType> Map<DescriptorType, Object> createMap(
final Map<Class<?>, ? extends IAnalysisEngine<DescriptorType, ?>> engineMap,
final Class<?> analysisClass) {
Map<DescriptorType, Object> descriptorMap;
// Create a MapCache that allows the analysis engine to
// decide that analysis results should be retained indefinitely.
IAnalysisEngine<DescriptorType, ?> engine = engineMap.get(analysisClass);
if (analysisClass.equals(JavaClass.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_JAVACLASS_RESULTS_TO_CACHE);
} else if (analysisClass.equals(ConstantPoolGen.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_CONSTANT_POOL_GEN_RESULTS_TO_CACHE);
} else if (analysisClass.equals(ClassContext.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(10);
} else if (engine instanceof IClassAnalysisEngine && ((IClassAnalysisEngine<?>) engine).canRecompute()) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_CLASS_RESULTS_TO_CACHE);
} else {
descriptorMap = new HashMap<DescriptorType, Object>();
}
return descriptorMap;
}
示例2: createMap
import edu.umd.cs.findbugs.util.MapCache; //导入依赖的package包/类
private static <DescriptorType> Map<DescriptorType, Object> createMap(
final Map<Class<?>, ? extends IAnalysisEngine<DescriptorType, ?>> engineMap,
final Class<?> analysisClass) {
Map<DescriptorType, Object> descriptorMap;
// Create a MapCache that allows the analysis engine to
// decide that analysis results should be retained indefinitely.
IAnalysisEngine<DescriptorType, ?> engine = engineMap.get(analysisClass);
if (analysisClass.equals(JavaClass.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_JAVACLASS_RESULTS_TO_CACHE);
} else if (analysisClass.equals(FBClassReader.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_FBCLASSREADER_RESULTS_TO_CACHE);
} else if (analysisClass.equals(ConstantPoolGen.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_CONSTANT_POOL_GEN_RESULTS_TO_CACHE);
} else if (analysisClass.equals(ClassContext.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(10);
} else if (engine instanceof IClassAnalysisEngine && ((IClassAnalysisEngine<?>) engine).canRecompute()) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_CLASS_RESULTS_TO_CACHE);
} else {
descriptorMap = new HashMap<DescriptorType, Object>();
}
return descriptorMap;
}
示例3: getObjectMap
import edu.umd.cs.findbugs.util.MapCache; //导入依赖的package包/类
public Map<MethodDescriptor, Object> getObjectMap(Class<?> analysisClass) {
Map<MethodDescriptor, Object> objectMap = methodAnalysisObjectMap.get(analysisClass);
if (objectMap == null) {
if (analysisClass == ValueNumberDataflow.class)
objectMap = new MapCache<MethodDescriptor, Object>(300);
else if (Dataflow.class.isAssignableFrom(analysisClass))
objectMap = new MapCache<MethodDescriptor, Object>(500);
else
objectMap = new HashMap<MethodDescriptor, Object>();
methodAnalysisObjectMap.put(analysisClass, objectMap);
}
return objectMap;
}
示例4: Subtypes2
import edu.umd.cs.findbugs.util.MapCache; //导入依赖的package包/类
/**
* Constructor.
*/
public Subtypes2() {
this.graph = new InheritanceGraph();
this.classDescriptorToVertexMap = new HashMap<ClassDescriptor, ClassVertex>();
this.supertypeSetMap = new MapCache<ClassDescriptor, SupertypeQueryResults>(500);
this.subtypeSetMap = new MapCache<ClassDescriptor, Set<ClassDescriptor>>(500);
this.xclassSet = new HashSet<XClass>();
this.SERIALIZABLE = ObjectTypeFactory.getInstance("java.io.Serializable");
this.CLONEABLE = ObjectTypeFactory.getInstance("java.lang.Cloneable");
this.firstCommonSuperclassQueryCache = new DualKeyHashMap<ReferenceType, ReferenceType, ReferenceType>();
}
示例5: initialValue
import edu.umd.cs.findbugs.util.MapCache; //导入依赖的package包/类
@Override
protected MapCache<XMethod, BitSet> initialValue() {
return new MapCache<XMethod, BitSet>(64);
}
示例6: cachedBitsets
import edu.umd.cs.findbugs.util.MapCache; //导入依赖的package包/类
/**
* @return
*/
private static MapCache<XMethod, BitSet> cachedBitsets() {
return cachedBitsets_AL.get();
}
示例7: cachedLoopExits
import edu.umd.cs.findbugs.util.MapCache; //导入依赖的package包/类
/**
* @return
*/
private static MapCache<XMethod, Set<Integer>> cachedLoopExits() {
return cachedLoopExits_AL.get();
}