]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/MappingBase.java
Small changes to synchronization base impl to allow extending it
[simantics/platform.git] / bundles / org.simantics.structural.synchronization / src / org / simantics / structural / synchronization / utils / MappingBase.java
index 3c96a3feff3a8405938032973f457e25e34ada7e..423e5a1256b5b54921a4f2537bb84a566173bb2f 100644 (file)
@@ -1,12 +1,13 @@
 package org.simantics.structural.synchronization.utils;
 
 package org.simantics.structural.synchronization.utils;
 
-import java.io.PrintWriter;
-
 import gnu.trove.map.hash.THashMap;
 import gnu.trove.procedure.TObjectObjectProcedure;
 import gnu.trove.procedure.TObjectProcedure;
 import gnu.trove.set.hash.THashSet;
 
 import gnu.trove.map.hash.THashMap;
 import gnu.trove.procedure.TObjectObjectProcedure;
 import gnu.trove.procedure.TObjectProcedure;
 import gnu.trove.set.hash.THashSet;
 
+import java.io.PrintWriter;
+import java.util.function.Consumer;
+
 /**
  * The entry point to the mapping structure between Simantics database and a
  * designated solver. It is used to synchronize changes from Simantics to the
 /**
  * The entry point to the mapping structure between Simantics database and a
  * designated solver. It is used to synchronize changes from Simantics to the
@@ -219,4 +220,11 @@ abstract public class MappingBase<T extends ComponentBase<T>> {
         return !pendingRemoval.isEmpty();
     }
 
         return !pendingRemoval.isEmpty();
     }
 
+    public void forEachPendingRemoval(Consumer<T> consumer) {
+        pendingRemoval.forEach(c -> {
+            consumer.accept(c);
+            return true;
+        });
+    }
+
 }
 }