KickJava   Java API By Example, From Geeks To Geeks.

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


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 /** Representation of non-unique index. Sorted list of values is
22  * associated with each key.
23  * @author Pavel Buzek
24  * @version
25  */

26 public interface MultivaluedOrderedIndex extends MultivaluedIndex {
27     /** Returns a list view of the values assosiated in the index with specified key.
28      * Returned collection is live and modifiable.
29      * If there are no values associated with the key empty collection is returned.
30      * @param key
31      * @return
32      */

33     public java.util.List JavaDoc getItemsOrdered (Object JavaDoc key) throws StorageException;
34
35       /** Like getItemsOrdered, but if the index contains keys, this returns the objects
36      * corresponding to the key
37      * @return
38      * @param key
39      * @throws StorageException
40      */

41     public java.util.Collection JavaDoc getObjectsOrdered (Object JavaDoc key, SinglevaluedIndex repos) throws StorageException;
42   
43     /** Inserts the specified element at the specified position in the list of values
44      * associated with the specified key.
45      * Throws StorageBadRequestException if the index is out of range.
46      * @param key
47      * @param index
48      * @param value
49      */

50     public void add (Object JavaDoc key, int index, Object JavaDoc value) throws StorageException;
51     
52     /** Removes the element at the specified position in the list of values
53      * associated with the specified key.
54      * @return true if this index changed as a result of this call
55      * @param key
56      * @param index
57      */

58     public boolean remove (Object JavaDoc key, int index) throws StorageException;
59     
60     /** Replaces the element at the specified position in the list of values
61      * associated with the specified key with the specified element.
62      * Throws StorageBadRequestException if the index is out of range.
63      * @param key
64      * @param index
65      * @param element
66      * @throws StorageException
67      */

68     public void replace(Object JavaDoc key, int index, Object JavaDoc element) throws StorageException;
69 }
70
Popular Tags