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
.util
.Processor
;
20 import org
.jetbrains
.annotations
.NotNull
;
22 import java
.io
.Flushable
;
23 import java
.io
.IOException
;
24 import java
.util
.Collection
;
27 * @author Eugene Zhuravlev
30 public interface IndexStorage
<Key
, Value
> extends Flushable
{
32 void addValue(Key key
, int inputId
, Value value
) throws StorageException
;
34 void removeValue(Key key
, int inputId
, Value value
) throws StorageException
;
36 void removeAllValues(Key key
, int inputId
) throws StorageException
;
38 void clear() throws StorageException
;
41 ValueContainer
<Value
> read(Key key
) throws StorageException
;
43 boolean processKeys(Processor
<Key
> processor
) throws StorageException
;
45 Collection
<Key
> getKeys() throws StorageException
;
47 void close() throws StorageException
;
49 void flush() throws IOException
;