]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db/src/org/simantics/db/VirtualGraphContext.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / VirtualGraphContext.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.db;\r
13 \r
14 import org.simantics.databoard.binding.Binding;\r
15 import org.simantics.db.request.Write;\r
16 import org.simantics.db.request.WriteOnly;\r
17 \r
18 /**\r
19  * An interface that VirtualGraphSource can use to manipulate the transient virtual graph.\r
20  * \r
21  * @author Antti Villberg\r
22  */\r
23 public interface VirtualGraphContext {\r
24     \r
25         /**\r
26          * Creates a new transient resource.\r
27          * @return\r
28          */\r
29     int newResource(boolean lazy);\r
30     \r
31     void finish(int resource);\r
32     \r
33     /**\r
34      * Converts a transient or persistent resource to an integer id.\r
35      * @param resource\r
36      * @return\r
37      */\r
38     int getIndex(Resource resource);\r
39     /**\r
40      * Converts an integer id to a resource.\r
41      * @param index\r
42      * @return\r
43      */\r
44     Resource getResource(int index);\r
45     @Deprecated\r
46     void initialise(Write write);\r
47     void postModification(AsyncRequestProcessor processor, WriteOnly request);\r
48     /**\r
49      * Updates previously given result to getStatements.\r
50      * @param resource\r
51      * @param statements\r
52      */\r
53     void updateStatements(int resource, int[] statements);\r
54     /**\r
55      * Updates previously given result to getValue.\r
56      * @param resource\r
57      * @param value\r
58      * @param binding\r
59      */\r
60     void updateValue(int resource, Object value, Binding binding);\r
61 //    /**\r
62 //     * Makes a request to persistent graph in getStatements of getValue\r
63 //     * and updates the results.\r
64 //     * @param <T>\r
65 //     * @param read\r
66 //     * @param procedure\r
67 //     */\r
68 //    <T> void pending(AsyncRead<T> read, Procedure<T> procedure);\r
69 \r
70 }\r