public final class CompilerReferenceServiceImpl extends CompilerReferenceServiceBase<JavaBackwardReferenceIndexReaderFactory.BackwardReferenceReader> implements CompilerReferenceServiceEx
CompilerReferenceServiceBase.CompilerElementInfo, CompilerReferenceServiceBase.ElementPlace, CompilerReferenceServiceBase.HierarchySearchKey, CompilerReferenceServiceBase.IndexCloseReason, CompilerReferenceServiceBase.IndexOpenReason, CompilerReferenceServiceBase.ReferentFileSearcher, CompilerReferenceServiceBase.ScopeWithoutReferencesOnCompilationmyActiveBuilds, myCompilationCount, myDirtyScopeHolder, myFileTypes, myLock, myOpenCloseLock, myProject, myProjectFileIndex, myReadDataLock, myReader, myReaderFactoryIS_ENABLED_KEYEVER_CHANGED, NEVER_CHANGED| Constructor and Description |
|---|
CompilerReferenceServiceImpl(Project project) |
| Modifier and Type | Method and Description |
|---|---|
java.util.SortedSet<ChainOpAndOccurrences<MethodCall>> |
findMethodReferenceOccurrences(java.lang.String rawReturnType,
byte iteratorKind,
ChainCompletionContext context) |
CompilerRef.CompilerClassHierarchyElementDef [] |
getDirectInheritors(CompilerRef.CompilerClassHierarchyElementDef baseClass) |
int |
getInheritorCount(CompilerRef.CompilerClassHierarchyElementDef baseClass) |
ChainOpAndOccurrences<TypeCast> |
getMostUsedTypeCast(java.lang.String operandQName) |
java.lang.String |
getName(int idx) |
int |
getNameId(java.lang.String name) |
CompilerRef.CompilerClassHierarchyElementDef |
mayCallOfTypeCast(CompilerRef.JavaCompilerMethodRef method,
int probabilityThreshold)
finds one best candidate to do a cast type before given method call (eg.:
((B) a).someMethod()). |
boolean |
mayHappen(CompilerRef qualifier,
CompilerRef base,
int probabilityThreshold)
conditional probability P(ref1 | ref2) = P(ref1 * ref2) / P(ref2) > 1 - 1 / threshold
where P(ref) is a probability that ref is occurred in a file.
|
void |
projectOpened()
Invoked when the project corresponding to this component instance is opened.
|
asCompilerElements, buildScopeWithoutReferences, calculateDirectInheritors, calculateOccurrenceCount, closeReaderIfNeeded, executeOnBuildThread, getAllDirtyModulesForTest, getCompileTimeOccurrenceCount, getDirectInheritors, getFileIndex, getFileTypes, getFunExpressions, getHierarchyInfo, getModificationCount, getProject, getReferentFileIds, getReferentFileIds, getReferentFileIdsViaImplicitToString, getReferentFiles, getScopeWithoutCodeReferences, getScopeWithoutImplicitToStringCodeReferences, getTestFindUsages, getTestFunExpressions, getTestHierarchy, intersection, isActive, isServiceEnabledFor, markAsOutdated, onException, openReaderIfNeeded, requireIndexRebuildclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCompileTimeOccurrenceCount, getDirectInheritors, getFunExpressions, getInstance, getScopeWithoutCodeReferences, getScopeWithoutImplicitToStringCodeReferences, isActive, isEnabledprojectCloseddisposeComponent, initComponentgetComponentNamepublic CompilerReferenceServiceImpl(Project project)
public void projectOpened()
ProjectComponentNote that components may be created for even unopened projects and this method can be never invoked for a particular component instance (for example for default project).
projectOpened in interface ProjectComponentprojectOpened in class CompilerReferenceServiceBase<JavaBackwardReferenceIndexReaderFactory.BackwardReferenceReader>public java.util.SortedSet<ChainOpAndOccurrences<MethodCall>> findMethodReferenceOccurrences(java.lang.String rawReturnType, byte iteratorKind, ChainCompletionContext context)
findMethodReferenceOccurrences in interface CompilerReferenceServiceExpublic ChainOpAndOccurrences<TypeCast> getMostUsedTypeCast(java.lang.String operandQName) throws ReferenceIndexUnavailableException
getMostUsedTypeCast in interface CompilerReferenceServiceExReferenceIndexUnavailableExceptionpublic CompilerRef.CompilerClassHierarchyElementDef mayCallOfTypeCast(CompilerRef.JavaCompilerMethodRef method, int probabilityThreshold) throws ReferenceIndexUnavailableException
((B) a).someMethod()). Follows given formula:
#(files where method & type cast is occurred) / #(files where method is occurred) > 1 - 1 / probabilityThresholdmayCallOfTypeCast in interface CompilerReferenceServiceExReferenceIndexUnavailableExceptionpublic boolean mayHappen(CompilerRef qualifier, CompilerRef base, int probabilityThreshold)
mayHappen in interface CompilerReferenceServiceExpublic java.lang.String getName(int idx)
throws ReferenceIndexUnavailableException
getName in interface CompilerReferenceServiceExReferenceIndexUnavailableExceptionpublic int getNameId(java.lang.String name)
throws ReferenceIndexUnavailableException
getNameId in interface CompilerReferenceServiceExReferenceIndexUnavailableExceptionpublic CompilerRef.CompilerClassHierarchyElementDef [] getDirectInheritors(CompilerRef.CompilerClassHierarchyElementDef baseClass) throws ReferenceIndexUnavailableException
getDirectInheritors in interface CompilerReferenceServiceExReferenceIndexUnavailableExceptionpublic int getInheritorCount(CompilerRef.CompilerClassHierarchyElementDef baseClass) throws ReferenceIndexUnavailableException
getInheritorCount in interface CompilerReferenceServiceExReferenceIndexUnavailableException