]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.graph/src/org/simantics/graph/matching/DebugMatchingStrategy.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.graph / src / org / simantics / graph / matching / DebugMatchingStrategy.java
diff --git a/bundles/org.simantics.graph/src/org/simantics/graph/matching/DebugMatchingStrategy.java b/bundles/org.simantics.graph/src/org/simantics/graph/matching/DebugMatchingStrategy.java
new file mode 100644 (file)
index 0000000..fc1d58f
--- /dev/null
@@ -0,0 +1,20 @@
+package org.simantics.graph.matching;\r
+\r
+\r
+public enum DebugMatchingStrategy implements GraphMatchingStrategy {\r
+\r
+       INSTANCE;\r
+       \r
+       @Override\r
+       public void applyTo(GraphMatching matching) {\r
+               int[] aToB = matching.aToB;\r
+               String[] names = matching.aGraph.names;\r
+               for(int s=0;s<aToB.length;++s)\r
+                       if(aToB[s] < 0) {\r
+                               System.out.println(names[s]);\r
+                               for(Stat stat : matching.aGraph.statements[s]) {\r
+                                       System.out.println("    " + stat.toString(names));\r
+                               }\r
+                       }\r
+       }\r
+}\r