X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.graph.compiler%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fcompiler%2Finternal%2Fprocedures%2FDefaultValueTyping.java;fp=bundles%2Forg.simantics.graph.compiler%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fcompiler%2Finternal%2Fprocedures%2FDefaultValueTyping.java;h=98ae7b943a6e1bdbc588c124e9070e6db8d1762f;hp=a6b54b4a57062977bbaf5c84473b68ecde1b6236;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/procedures/DefaultValueTyping.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/procedures/DefaultValueTyping.java index a6b54b4a5..98ae7b943 100644 --- a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/procedures/DefaultValueTyping.java +++ b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/procedures/DefaultValueTyping.java @@ -1,44 +1,44 @@ -package org.simantics.graph.compiler.internal.procedures; - -import gnu.trove.procedure.TIntObjectProcedure; -import gnu.trove.set.hash.TIntHashSet; - -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; - -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() { - @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; - } - }); - } - -} +package org.simantics.graph.compiler.internal.procedures; + +import gnu.trove.procedure.TIntObjectProcedure; +import gnu.trove.set.hash.TIntHashSet; + +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; + +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() { + @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; + } + }); + } + +}