]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.layer0.utils/src/org/simantics/layer0/utils/writer/GraphWriter.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.layer0.utils / src / org / simantics / layer0 / utils / writer / GraphWriter.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.layer0.utils.writer;\r
13 \r
14 import org.simantics.db.Resource;\r
15 import org.simantics.db.ReadGraph;\r
16 import org.simantics.db.exception.DatabaseException;\r
17 \r
18 public interface GraphWriter {\r
19 \r
20     ReadGraph getGraph(); // Returns read-only graph\r
21         \r
22         GraphWriter flush() throws DatabaseException;\r
23         \r
24         // Begin\r
25         GraphWriter create() throws DatabaseException;\r
26         GraphWriter create(Resource type) throws DatabaseException;\r
27         GraphWriter create(int clusterHint) throws DatabaseException;\r
28         GraphWriter create(int clusterHint, Resource type) throws DatabaseException;\r
29         GraphWriter create(String name, Resource type) throws DatabaseException;\r
30         GraphWriter create(int clusterHint, String name, Resource type) throws DatabaseException;\r
31         GraphWriter createLiteral(Object value, Resource dataType) throws DatabaseException;\r
32         GraphWriter createLiteral(int clusterHint, Object value, Resource dataType) throws DatabaseException;\r
33         GraphWriter createInverse(Resource r) throws DatabaseException;\r
34         GraphWriter createInverse(int clusterHint, Resource r) throws DatabaseException;\r
35         GraphWriter handle(Resource s);\r
36         \r
37         // Edit\r
38         GraphWriter let(Resource p, Resource o) throws DatabaseException;\r
39         //GraphWriter letWithoutInverse(Resource p, Resource o);\r
40         GraphWriter let(int clusterHint, Resource p, Object value, Resource dataType) throws DatabaseException; \r
41         GraphWriter let(Resource p, Object value, Resource dataType) throws DatabaseException;\r
42         //GraphWriter letWithoutInverse(Resource p, Object value, Resource dataType);\r
43         GraphWriter stat(Resource s, Resource p, Resource o) throws DatabaseException;\r
44         Resource    get();\r
45         \r
46 }\r