]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.graph/src/org/simantics/graph/query/IGraph.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.graph / src / org / simantics / graph / query / IGraph.java
1 package org.simantics.graph.query;\r
2 \r
3 import java.io.IOException;\r
4 import java.util.Collection;\r
5 \r
6 import org.simantics.databoard.binding.Binding;\r
7 import org.simantics.databoard.binding.error.BindingException;\r
8 import org.simantics.databoard.binding.mutable.Variant;\r
9 import org.simantics.databoard.serialization.RuntimeSerializerConstructionException;\r
10 import org.simantics.databoard.serialization.SerializationException;\r
11 import org.simantics.databoard.type.Datatype;\r
12 \r
13 /**\r
14  * Graph browsing interface for transferable graphs.\r
15  * @author Hannu Niemist�\r
16  */\r
17 public interface IGraph {\r
18 \r
19         /**\r
20          * Get value of the resource as variant. Returns null, if there is no value.\r
21          */\r
22         Variant getValue(Res resource);\r
23 \r
24         /**\r
25          * Sets value of the resource.\r
26         */\r
27         void setValue(Res resource, Object value, Binding binding);\r
28 \r
29         /**\r
30          * Gets the value of the resource using the given binding.\r
31          */\r
32         Object getValue(Res resource, Binding binding) throws RuntimeSerializerConstructionException, SerializationException, IOException, BindingException, NoValueException;\r
33         \r
34         /**\r
35          * Gets the data type of the resource or null if it doesn't have a data type.\r
36          */\r
37         Datatype getDatatype(Res resource);\r
38         \r
39         /**\r
40          * Gets raw objects without assertions\r
41          */\r
42         Collection<Res> rawGetObjects(Res subject, Res predicate);\r
43         \r
44         /**\r
45          * Gets single raw object or throws NoUniqueObjectException if that is not possible\r
46          */\r
47         Res singleRawObject(Res subject, Res predicate) throws NoUniqueObjectException;\r
48 \r
49         /**\r
50          * Gets raw and asserted objects.\r
51          */\r
52         Collection<Res> getObjects(Res subject, Res predicate);\r
53         \r
54         /**\r
55          * Gets all types of the given resource\r
56          */\r
57         Collection<Res> getTypes(Res resource); \r
58         \r
59         /**\r
60          * Gets all instances of the given type\r
61          */\r
62         Collection<Res> getInstances(Res type);\r
63 \r
64         Datatype getAssertedDatatype(Res type);\r
65         \r
66         Collection<Res> getChildren(Res res);\r
67         \r
68         Paths getPaths();    \r
69 \r
70 }\r