]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.impl/src/org/simantics/db/impl/internal/RandomAccessValueSupport.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / internal / RandomAccessValueSupport.java
1 package org.simantics.db.impl.internal;\r
2 \r
3 import java.util.Collection;\r
4 \r
5 import org.simantics.db.ExternalValueSupport;\r
6 import org.simantics.db.Resource;\r
7 import org.simantics.db.Session;\r
8 import org.simantics.utils.datastructures.Pair;\r
9 \r
10 /**\r
11  * A database {@link Session} service for registering and retrieving random\r
12  * access binary instances related to a session.\r
13  * \r
14  * <p>\r
15  * This service is internal to the implementation and must not be used\r
16  * elsewhere.\r
17  * </p>\r
18  * \r
19  * @author Tuukka Lehtonen\r
20  * \r
21  * @see ExternalValueSupport\r
22  */\r
23 public interface RandomAccessValueSupport {\r
24 \r
25         /**\r
26          * Registers the specified value with the specified resource.\r
27          * \r
28          * @param resource\r
29          * @param data\r
30          * @throws IllegalStateException\r
31          *             if a previous registration already exists for the specified\r
32          *             resource\r
33          */\r
34         void put(Resource resource, ResourceData data);\r
35 \r
36         /**\r
37          * @param Resource\r
38          * @return currently registered value attached to the specified resource\r
39          */\r
40         ResourceData get(Resource resource);\r
41 \r
42         /**\r
43          * @return currently registered entries\r
44          */\r
45         Collection<Pair<Resource, ResourceData>> entries();\r
46 \r
47         /**\r
48          * Removes all value registrations from this registry.\r
49          * \r
50          * @return the set of previously registered values\r
51          */\r
52         Collection<Pair<Resource, ResourceData>> removeAll();\r
53 \r
54 }\r