KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > mdr > persistence > Index


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.mdr.persistence;
20
21 /**
22  * Representation of index in the Storage.
23  * @author Pavel Buzek
24  * @version 1.0
25  */

26
27 public interface Index {
28     /** Returns the unique name of the index in the Storage.
29      * @return
30      * @throws StorageException
31      */

32     public String JavaDoc getName() throws StorageException;
33
34     /** Returns the type of values indexed by this index.
35      * @return
36      * @throws StorageException
37      */

38     public Storage.EntryType getValueType() throws StorageException;
39
40     /** Returns the type of keys in index.
41      * @return
42      * @throws StorageException
43      */

44     public Storage.EntryType getKeyType() throws StorageException;
45
46     /** Returns a set view of the keys contained in this index.
47      * Returned set is read only and may not be modified.
48      * @return keys contained in this index
49      * @throws StorageException
50      */

51     public java.util.Set JavaDoc keySet() throws StorageException;
52
53     /** Adds the specified value to values associated in this index with the
54      * specified key. If the index puts limit on number of values associated
55      * with one key and adding value would break this limit, it throws
56      * StorageBadRequestException.
57      * @param key
58      * @param value
59      * @throws StorageException
60      */

61     public void add(Object JavaDoc key, Object JavaDoc value) throws StorageException;
62     
63     /** Removes all values assosiated in the index with specified key.
64      * @return true if this index changed as a result of this call
65      * @param key
66      * @throws StorageException
67      */

68     public boolean remove (Object JavaDoc key) throws StorageException;
69 }
70
Popular Tags