update copyrights
[fedora-idea.git] / platform / lang-impl / src / com / intellij / util / indexing / FileBasedIndexExtension.java
blob235d28cb9bba0fa842a86d3a03aa1dea6744f455
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.intellij.util.indexing;
19 import com.intellij.openapi.extensions.ExtensionPointName;
20 import com.intellij.openapi.fileTypes.FileType;
21 import com.intellij.util.io.DataExternalizer;
22 import com.intellij.util.io.KeyDescriptor;
23 import org.jetbrains.annotations.NotNull;
25 import java.util.Collection;
26 import java.util.Collections;
28 /**
29 * @author Eugene Zhuravlev
30 * Date: Dec 26, 2007
31 * V class MUST have equals / hashcode properly defined!!!
33 public abstract class FileBasedIndexExtension<K, V> {
34 public static final ExtensionPointName<FileBasedIndexExtension> EXTENSION_POINT_NAME = ExtensionPointName.create("com.intellij.fileBasedIndex");
35 public static final int DEFAULT_CACHE_SIZE = 1024;
37 public abstract ID<K, V> getName();
39 public abstract DataIndexer<K, V, FileContent> getIndexer();
41 public abstract KeyDescriptor<K> getKeyDescriptor();
43 public abstract DataExternalizer<V> getValueExternalizer();
45 public abstract FileBasedIndex.InputFilter getInputFilter();
47 public abstract boolean dependsOnFileContent();
49 public abstract int getVersion();
51 /**
52 * @see FileBasedIndexExtension#DEFAULT_CACHE_SIZE
54 public int getCacheSize() {
55 return DEFAULT_CACHE_SIZE;
58 /**
59 * For most indices the method should return an empty collection.
60 * @return collection of file types to which file size limit will not be applied when indexing.
61 * This is the way to allow indexing of files whose limit exceeds FileManagerImpl.MAX_INTELLISENSE_FILESIZE.
63 * Use carefully, because indexing large files may influence index update speed dramatically.
65 * @see com.intellij.psi.impl.file.impl.FileManagerImpl#MAX_INTELLISENSE_FILESIZE
67 @NotNull
68 public Collection<FileType> getFileTypesWithSizeLimitNotApplicable() {
69 return Collections.emptyList();