Guava ClassToInstanceMap - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava ClassToInstanceMap class.

This code example shows how to use the following methods:getInstance, putInstance, containsKey
    analysis.analyze();
    return analysis;
  } 
   
  private <T extends Analysis> T getOrCreate(Class<T> clazz) {
    if (!analysisCache.containsKey(clazz)) {
      analysisCache.putInstance(clazz, construct(clazz));
    } 
    return analysisCache.getInstance(clazz);
  } 
 
  public VFAnalysis getKindAnalysis() { 
   return getOrCreate(VFPreorderAnalysis.class); 
  } 
 
  public ReachingDefs getReachingDefinitionsAnalysis() { 
    return getOrCreate(ReachingDefs.class); 
  } 
   
  public UseDefDefUseChain getUseDefDefUseChain() { 
6
CodeRank
This code example shows how to use the following methods:getInstance, containsKey, put
        return transformation;
    } 
     
    private <T extends TamerPlusTransformation> T getOrCreate(Class<T> clazz)
    { 
        if (!fTransformationCache.containsKey(clazz))
        { 
            fTransformationCache.put(clazz, construct(clazz));
        } 
        return fTransformationCache.getInstance(clazz);
    } 
     
    public RenameVariablesForTIRNodes getVariableRenameTransformation() 
    { 
        return getOrCreate(RenameVariablesForTIRNodes.class); 
    } 
     
    public TIRToMcSAFIRWithoutTemp getTIRToMcSAFIRWithoutTemp() 
    { 
        return getOrCreate(TIRToMcSAFIRWithoutTemp.class); 
6
CodeRank
This code example shows how to use the following methods:getInstance, putInstance, containsKey
        return analysis;
    } 
     
    private <T extends TamerPlusAnalysis> T getOrCreate(Class<T> clazz)
    { 
        if (!fAnalysisCache.containsKey(clazz))
        { 
            fAnalysisCache.putInstance(clazz, construct(clazz));
        } 
        return fAnalysisCache.getInstance(clazz);
    } 
     
    public DefinedVariablesNameCollector getDefinedVariablesAnalysis() 
    { 
        return getOrCreate(DefinedVariablesNameCollector.class); 
    } 
     
    public UsedVariablesNameCollector getUsedVariablesAnalysis() 
    { 
        return getOrCreate(UsedVariablesNameCollector.class); 
6
CodeRank
This code example shows how to use the following methods:getInstance
        return schemaContext;
    } 
 
    @Override 
    public <T extends DOMService> Optional<T> getService(final Class<T> cls) {
        return Optional.fromNullable(services.getInstance(cls));
    } 
} 
4
CodeRank
See Code Examples for Guava ClassToInstanceMap Methods: