[platform] AbstractStubIndex: javadoc

(cherry picked from commit f121c6daebf1f119643fe055796c8cd4766d861f)

IJ-CR-147511

GitOrigin-RevId: 60a959557b434a4d15b199bfd4000dc27dbccb3d
This commit is contained in:
Yann Cébron
2024-10-22 17:39:03 +02:00
committed by intellij-monorepo-bot
parent ddecda38af
commit 578c631e2a

View File

@@ -10,22 +10,32 @@ import org.jetbrains.annotations.NotNull;
import java.util.Collection;
public abstract class AbstractStubIndex<Key, Psi extends PsiElement> implements StubIndexExtension<Key, Psi> {
/**
* <em>NOTE:</em> May return stale/out-of-date data.
* Use {@link StubIndex#getElements} to obtain/verify actual existing elements for the given key.
*/
public Collection<Key> getAllKeys(Project project) {
return StubIndex.getInstance().getAllKeys(getKey(), project);
}
/**
* <em>NOTE:</em> May return stale/out-of-date data.
* Use {@link StubIndex#getElements} to obtain/verify actual existing elements for the given key.
*/
public boolean processAllKeys(Project project, Processor<? super Key> processor) {
return StubIndex.getInstance().processAllKeys(getKey(), project, processor);
}
/**
* @deprecated This method does not enforce element type of the returned collection, please use
* {@link StubIndex#getElements(StubIndexKey, Object, Project, GlobalSearchScope, Class)}
*
* Note that most {@link AbstractStubIndex} implementations are already equipped with a specialised getter. It is recommended to add such
* a getter to your {@link AbstractStubIndex} implementation, and use this getter rather than {@link StubIndex#getElements}.
*
* See for example {@link com.intellij.psi.impl.java.stubs.index.JavaFullClassNameIndex#getClasses(CharSequence, Project, GlobalSearchScope)}
* @deprecated This method does not enforce the element type of the returned collection, please use
* {@link StubIndex#getElements(StubIndexKey, Object, Project, GlobalSearchScope, Class)} instead.
* <p>
* Note that most {@link AbstractStubIndex} implementations are already equipped with a specialized getter.
* It is recommended to add such a getter to your {@link AbstractStubIndex} implementation,
* and use it instead of {@link StubIndex#getElements}.
* <p>
* Sample: {@link com.intellij.psi.impl.java.stubs.index.JavaFullClassNameIndex#getClasses(CharSequence, Project, GlobalSearchScope)}
*/
@Deprecated
public Collection<Psi> get(@NotNull Key key, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {