KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > kaha > impl > index > Index


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
4  * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
5  * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
6  * License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
11  * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
12  * specific language governing permissions and limitations under the License.
13  */

14
15 package org.apache.activemq.kaha.impl.index;
16
17 import java.io.IOException JavaDoc;
18 import org.apache.activemq.kaha.Marshaller;
19 import org.apache.activemq.kaha.StoreEntry;
20
21 /**
22  * Simplier than a Map
23  *
24  * @version $Revision: 1.2 $
25  */

26 public interface Index{
27
28     /**
29      * clear the index
30      * @throws IOException
31      *
32      */

33     public void clear() throws IOException JavaDoc;
34
35     /**
36      * @param key
37      * @return true if it contains the key
38      * @throws IOException
39      */

40     public boolean containsKey(Object JavaDoc key) throws IOException JavaDoc;
41
42     /**
43      * remove the index key
44      *
45      * @param key
46      * @return StoreEntry removed
47      * @throws IOException
48      */

49     public StoreEntry remove(Object JavaDoc key) throws IOException JavaDoc;
50
51     /**
52      * store the key, item
53      *
54      * @param key
55      * @param entry
56      * @throws IOException
57      */

58     public void store(Object JavaDoc key,StoreEntry entry) throws IOException JavaDoc;
59     
60     
61     /**
62      * @param key
63      * @return the entry
64      * @throws IOException
65      */

66     public StoreEntry get(Object JavaDoc key) throws IOException JavaDoc;
67
68     /**
69      * @return true if the index is transient
70      */

71     public boolean isTransient();
72     
73     /**
74      * load indexes
75      */

76     public void load();
77     
78     /**
79      * unload indexes
80      * @throws IOException
81      */

82     public void unload() throws IOException JavaDoc;
83     
84     
85     
86     /**
87      * Set the marshaller for key objects
88      * @param marshaller
89      */

90     public void setKeyMarshaller(Marshaller marshaller);
91 }
92
Popular Tags