-package org.simantics.graph.compiler.internal.procedures;\r
-\r
-import gnu.trove.procedure.TIntObjectProcedure;\r
-import gnu.trove.set.hash.TIntHashSet;\r
-\r
-import org.simantics.graph.compiler.internal.store.IPreValue;\r
-import org.simantics.graph.compiler.internal.store.PreValueStore;\r
-import org.simantics.graph.query.Path;\r
-import org.simantics.graph.query.Paths;\r
-import org.simantics.graph.store.GraphStore;\r
-\r
-public class DefaultValueTyping implements Runnable {\r
-\r
- GraphStore store;\r
- Paths paths;\r
- \r
- public DefaultValueTyping(Paths paths, GraphStore store) {\r
- this.paths = paths;\r
- this.store = store;\r
- }\r
-\r
- @Override\r
- public void run() {\r
- final int instanceOfId = store.identities.createPathToId(paths.InstanceOf);\r
- final TIntHashSet \r
- instanceOfDomain = store.statements.getRelationDomain(instanceOfId);\r
- PreValueStore preValues = store.getStore(PreValueStore.class);\r
- preValues.forEachPreValue(new TIntObjectProcedure<IPreValue>() { \r
- @Override\r
- public boolean execute(int a, IPreValue b) {\r
- if(!instanceOfDomain.contains(a)) {\r
- Path defaultType = b.getDefaultType(paths);\r
- if(defaultType != null)\r
- store.statements.add(a, \r
- instanceOfId,\r
- store.identities.createPathToId(defaultType)\r
- );\r
- }\r
- return true;\r
- }\r
- });\r
- } \r
-\r
-}\r
+package org.simantics.graph.compiler.internal.procedures;
+
+import org.simantics.graph.compiler.internal.store.IPreValue;
+import org.simantics.graph.compiler.internal.store.PreValueStore;
+import org.simantics.graph.query.Path;
+import org.simantics.graph.query.Paths;
+import org.simantics.graph.store.GraphStore;
+
+import gnu.trove.procedure.TIntObjectProcedure;
+import gnu.trove.set.hash.TIntHashSet;
+
+public class DefaultValueTyping implements Runnable {
+
+ GraphStore store;
+ Paths paths;
+
+ public DefaultValueTyping(Paths paths, GraphStore store) {
+ this.paths = paths;
+ this.store = store;
+ }
+
+ @Override
+ public void run() {
+ final int instanceOfId = store.identities.createPathToId(paths.InstanceOf);
+ final TIntHashSet
+ instanceOfDomain = store.statements.getRelationDomain(instanceOfId);
+ PreValueStore preValues = store.getStore(PreValueStore.class);
+ preValues.forEachPreValue(new TIntObjectProcedure<IPreValue>() {
+ @Override
+ public boolean execute(int a, IPreValue b) {
+ if(!instanceOfDomain.contains(a)) {
+ Path defaultType = b.getDefaultType(paths);
+ if(defaultType != null)
+ store.statements.add(a,
+ instanceOfId,
+ store.identities.createPathToId(defaultType)
+ );
+ }
+ return true;
+ }
+ });
+ }
+
+}