1 package org.simantics.graph.compiler.internal.procedures;
3 import gnu.trove.procedure.TIntObjectProcedure;
4 import gnu.trove.set.hash.TIntHashSet;
6 import org.simantics.graph.compiler.internal.store.IPreValue;
7 import org.simantics.graph.compiler.internal.store.PreValueStore;
8 import org.simantics.graph.query.Path;
9 import org.simantics.graph.query.Paths;
10 import org.simantics.graph.store.GraphStore;
12 public class DefaultValueTyping implements Runnable {
17 public DefaultValueTyping(Paths paths, GraphStore store) {
24 final int instanceOfId = store.identities.createPathToId(paths.InstanceOf);
26 instanceOfDomain = store.statements.getRelationDomain(instanceOfId);
27 PreValueStore preValues = store.getStore(PreValueStore.class);
28 preValues.forEachPreValue(new TIntObjectProcedure<IPreValue>() {
30 public boolean execute(int a, IPreValue b) {
31 if(!instanceOfDomain.contains(a)) {
32 Path defaultType = b.getDefaultType(paths);
33 if(defaultType != null)
34 store.statements.add(a,
36 store.identities.createPathToId(defaultType)