package org.simantics.graph.compiler.internal.procedures; import gnu.trove.procedure.TObjectProcedure; import org.simantics.graph.query.Paths; import org.simantics.graph.store.GraphStore; import org.simantics.graph.store.IdentityStore; import org.simantics.graph.store.IdentityStore.ConsistsOf; import org.simantics.graph.store.StatementStore; public class AddConsistsOf implements Runnable { GraphStore store; Paths paths; public AddConsistsOf(Paths paths, GraphStore store) { this.paths = paths; this.store = store; } @Override public void run() { final IdentityStore identities = store.identities; final int consistsOf = identities.createPathToId(paths.ConsistsOf); final StatementStore statements = store.statements; identities.forEachChild(new TObjectProcedure() { @Override public boolean execute(ConsistsOf co) { if(identities.isNewResource(co.child)) statements.add(co.parent, consistsOf, co.child); return true; } }); } }