--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.diagram.synchronization;\r
+\r
+import java.util.ArrayDeque;\r
+import java.util.Deque;\r
+\r
+import org.simantics.utils.threads.IThreadWorkQueue;\r
+\r
+/**\r
+ * @author Tuukka Lehtonen\r
+ */\r
+public class CollectingModificationQueue implements IModificationQueue {\r
+\r
+ private final Deque<IModification> queue = new ArrayDeque<IModification>();\r
+\r
+ @Override\r
+ public boolean offer(IModification m) {\r
+ return offer(m, null);\r
+ }\r
+\r
+ @Override\r
+ public boolean offer(IModification m, IThreadWorkQueue completionThread) {\r
+ return queue.add(m);\r
+ }\r
+\r
+ public Deque<IModification> getQueue() {\r
+ return queue;\r
+ }\r
+\r
+ @Override\r
+ public void finish() throws InterruptedException {\r
+ // Do nothing\r
+ }\r
+\r
+ @Override\r
+ public void flush() {\r
+ // Do nothing\r
+ }\r
+\r
+}
\ No newline at end of file