/******************************************************************************* * Copyright (c) 2007, 2011 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.databoard.units; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.simantics.databoard.accessor.reference.ChildReference; import org.simantics.databoard.binding.ArrayBinding; import org.simantics.databoard.binding.Binding; /** * This utility class contains a toolkit for synchronization of objects. * * @author toni.kalajainen */ public class SynchronizationUtil { /** * Compare arrays * * @param arrayBinding * @param oldArray * @param newArray * @param idRef reference identifier in item * @return Compare raport */ public CompareRaport compareArrays(ArrayBinding arrayBinding, T oldArray, T newArray, ChildReference idRef) { Binding cb = arrayBinding.componentBinding; CompareRaport result = new CompareRaport(); //Set oldIds = new HashSet( ) return result; } // public CompareRaport compareMaps(MapBinding mapBinding, T oldMap, T newMap, ChildReference idRef) // { // // } static class CompareRaport { public Set addedItems = new HashSet(); public Set removedItems = new HashSet(); public Map correspondences = new HashMap(); public T[] addedIndices; public T[] removedIndices; public Map indiceCorrespondence; } }