com.intellij.psi.search
Interface PsiShortNamesCache


public interface PsiShortNamesCache

Allows to retrieve files and Java classes, methods and fields in a project by non-qualified names.

See Also:
PsiManager.getShortNamesCache()

Method Summary
 java.lang.String[] getAllClassNames(boolean searchInLibraries)
          Returns the list of names of all classes in the project and (optionally) libraries.
 void getAllClassNames(boolean searchInLibraries, HashSet<java.lang.String> dest)
          Adds the names of all classes in the project and (optionally) libraries to the specified set.
 java.lang.String[] getAllFieldNames(boolean searchInLibraries)
          Returns the list of names of all fields in the project and (optionally) libraries.
 void getAllFieldNames(boolean searchInLibraries, HashSet<java.lang.String> set)
          Adds the names of all methods in the project and (optionally) libraries to the specified set.
 java.lang.String[] getAllFileNames()
          Returns the list of names of all files in the project.
 java.lang.String[] getAllMethodNames(boolean searchInLibraries)
          Returns the list of names of all methods in the project and (optionally) libraries.
 void getAllMethodNames(boolean searchInLibraries, HashSet<java.lang.String> set)
          Adds the names of all methods in the project and (optionally) libraries to the specified set.
 PsiClass[] getClassesByName(java.lang.String name, GlobalSearchScope scope)
          Returns the list of all classes with the specified name in the specified scope.
 PsiField[] getFieldsByName(java.lang.String name, GlobalSearchScope scope)
          Returns the list of all fields with the specified name in the specified scope.
 PsiFile[] getFilesByName(java.lang.String name)
          Returns the list of files with the specified name.
 PsiMethod[] getMethodsByName(java.lang.String name, GlobalSearchScope scope)
          Returns the list of all methods with the specified name in the specified scope.
 void runStartupActivity()
          Initializes the cache.
 

Method Detail

runStartupActivity

void runStartupActivity()
Initializes the cache. To be used by custom PsiShortNameCache implementations registered through PsiManager.registerShortNamesCache(PsiShortNamesCache) }.


getFilesByName

PsiFile[] getFilesByName(java.lang.String name)
Returns the list of files with the specified name.

Parameters:
name - the name of the files to find.
Returns:
the list of files in the project which have the specified name.

getAllFileNames

java.lang.String[] getAllFileNames()
Returns the list of names of all files in the project.

Returns:
the list of all file names in the project.

getClassesByName

PsiClass[] getClassesByName(java.lang.String name,
                            GlobalSearchScope scope)
Returns the list of all classes with the specified name in the specified scope.

Parameters:
name - the non-qualified name of the classes to find.
scope - the scope in which classes are searched.
Returns:
the list of found classes.

getAllClassNames

java.lang.String[] getAllClassNames(boolean searchInLibraries)
Returns the list of names of all classes in the project and (optionally) libraries.

Parameters:
searchInLibraries - if true, libraries are included in the search; otherwise, only the project is searched.
Returns:
the list of all class names.

getAllClassNames

void getAllClassNames(boolean searchInLibraries,
                      HashSet<java.lang.String> dest)
Adds the names of all classes in the project and (optionally) libraries to the specified set.

Parameters:
searchInLibraries - if true, libraries are included in the search; otherwise, only the project is searched.
dest - the set to add the names to.

getMethodsByName

PsiMethod[] getMethodsByName(java.lang.String name,
                             GlobalSearchScope scope)
Returns the list of all methods with the specified name in the specified scope.

Parameters:
name - the name of the methods to find.
scope - the scope in which methods are searched.
Returns:
the list of found methods.

getAllMethodNames

java.lang.String[] getAllMethodNames(boolean searchInLibraries)
Returns the list of names of all methods in the project and (optionally) libraries.

Parameters:
searchInLibraries - if true, libraries are included in the search; otherwise, only the project is searched.
Returns:
the list of all method names.

getAllMethodNames

void getAllMethodNames(boolean searchInLibraries,
                       HashSet<java.lang.String> set)
Adds the names of all methods in the project and (optionally) libraries to the specified set.

Parameters:
searchInLibraries - if true, libraries are included in the search; otherwise, only the project is searched.
set - the set to add the names to.

getFieldsByName

PsiField[] getFieldsByName(java.lang.String name,
                           GlobalSearchScope scope)
Returns the list of all fields with the specified name in the specified scope.

Parameters:
name - the name of the fields to find.
scope - the scope in which fields are searched.
Returns:
the list of found fields.

getAllFieldNames

java.lang.String[] getAllFieldNames(boolean searchInLibraries)
Returns the list of names of all fields in the project and (optionally) libraries.

Parameters:
searchInLibraries - if true, libraries are included in the search; otherwise, only the project is searched.
Returns:
the list of all field names.

getAllFieldNames

void getAllFieldNames(boolean searchInLibraries,
                      HashSet<java.lang.String> set)
Adds the names of all methods in the project and (optionally) libraries to the specified set.

Parameters:
searchInLibraries - if true, libraries are included in the search; otherwise, only the project is searched.
set - the set to add the names to.