]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - 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
diff --git a/bundles/org.simantics.graph/src/org/simantics/graph/query/IGraph.java b/bundles/org.simantics.graph/src/org/simantics/graph/query/IGraph.java
new file mode 100644 (file)
index 0000000..e902270
--- /dev/null
@@ -0,0 +1,70 @@
+package org.simantics.graph.query;\r
+\r
+import java.io.IOException;\r
+import java.util.Collection;\r
+\r
+import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.binding.error.BindingException;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.databoard.serialization.RuntimeSerializerConstructionException;\r
+import org.simantics.databoard.serialization.SerializationException;\r
+import org.simantics.databoard.type.Datatype;\r
+\r
+/**\r
+ * Graph browsing interface for transferable graphs.\r
+ * @author Hannu Niemist�\r
+ */\r
+public interface IGraph {\r
+\r
+       /**\r
+        * Get value of the resource as variant. Returns null, if there is no value.\r
+        */\r
+       Variant getValue(Res resource);\r
+\r
+       /**\r
+        * Sets value of the resource.\r
+       */\r
+       void setValue(Res resource, Object value, Binding binding);\r
+\r
+       /**\r
+        * Gets the value of the resource using the given binding.\r
+        */\r
+       Object getValue(Res resource, Binding binding) throws RuntimeSerializerConstructionException, SerializationException, IOException, BindingException, NoValueException;\r
+       \r
+       /**\r
+        * Gets the data type of the resource or null if it doesn't have a data type.\r
+        */\r
+       Datatype getDatatype(Res resource);\r
+       \r
+       /**\r
+        * Gets raw objects without assertions\r
+        */\r
+       Collection<Res> rawGetObjects(Res subject, Res predicate);\r
+       \r
+       /**\r
+        * Gets single raw object or throws NoUniqueObjectException if that is not possible\r
+        */\r
+       Res singleRawObject(Res subject, Res predicate) throws NoUniqueObjectException;\r
+\r
+       /**\r
+        * Gets raw and asserted objects.\r
+        */\r
+       Collection<Res> getObjects(Res subject, Res predicate);\r
+       \r
+       /**\r
+        * Gets all types of the given resource\r
+        */\r
+       Collection<Res> getTypes(Res resource); \r
+       \r
+       /**\r
+        * Gets all instances of the given type\r
+        */\r
+       Collection<Res> getInstances(Res type);\r
+\r
+       Datatype getAssertedDatatype(Res type);\r
+       \r
+       Collection<Res> getChildren(Res res);\r
+       \r
+       Paths getPaths();    \r
+\r
+}\r