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