]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.layer0.utils/src/org/simantics/layer0/utils/writer/GraphWriter.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.layer0.utils / src / org / simantics / layer0 / utils / writer / GraphWriter.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.layer0.utils.writer;
13
14 import org.simantics.db.Resource;
15 import org.simantics.db.ReadGraph;
16 import org.simantics.db.exception.DatabaseException;
17
18 public interface GraphWriter {
19
20     ReadGraph getGraph(); // Returns read-only graph
21         
22         GraphWriter flush() throws DatabaseException;
23         
24         // Begin
25         GraphWriter create() throws DatabaseException;
26         GraphWriter create(Resource type) throws DatabaseException;
27         GraphWriter create(int clusterHint) throws DatabaseException;
28         GraphWriter create(int clusterHint, Resource type) throws DatabaseException;
29         GraphWriter create(String name, Resource type) throws DatabaseException;
30         GraphWriter create(int clusterHint, String name, Resource type) throws DatabaseException;
31         GraphWriter createLiteral(Object value, Resource dataType) throws DatabaseException;
32         GraphWriter createLiteral(int clusterHint, Object value, Resource dataType) throws DatabaseException;
33         GraphWriter createInverse(Resource r) throws DatabaseException;
34         GraphWriter createInverse(int clusterHint, Resource r) throws DatabaseException;
35         GraphWriter handle(Resource s);
36         
37         // Edit
38         GraphWriter let(Resource p, Resource o) throws DatabaseException;
39         //GraphWriter letWithoutInverse(Resource p, Resource o);
40         GraphWriter let(int clusterHint, Resource p, Object value, Resource dataType) throws DatabaseException; 
41         GraphWriter let(Resource p, Object value, Resource dataType) throws DatabaseException;
42         //GraphWriter letWithoutInverse(Resource p, Object value, Resource dataType);
43         GraphWriter stat(Resource s, Resource p, Resource o) throws DatabaseException;
44         Resource    get();
45         
46 }