org.eclipse.emf.cdo.compare
Class CDOCompareUtil

java.lang.Object
  extended by org.eclipse.emf.cdo.compare.CDOCompareUtil

public final class CDOCompareUtil
extends Object

Provides static factory methods that return CDO-scoped comparisons.

Two different scopes are supported:

The origin side of a comparison is automatically determined by inspecting the branch tree and used if its different from the left or right side.

The matcher used by the comparisons is based on an ID function that considers the CDOIDs of the objects. Resources and folders are treated as normal EObjects.


Method Summary
static Comparison compare(CDOObject left, CDOView rightView, CDOView[] originView)
          Takes an arbitrary object (including resource nodes) and returns matches for all elements of its content tree.
static Comparison compare(CDOView leftView, CDOView rightView, CDOView[] originView)
          Takes a view/transaction and returns matches only for the changed elements of the entire content tree of its root resource.
static Comparison compare(CDOView leftView, CDOView rightView, CDOView[] originView, Set<CDOID> ids)
           
static Comparison compare(IComparisonScope scope)
           
static Comparison compareUncommittedChanges(CDOTransaction transaction)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

compare

public static Comparison compare(IComparisonScope scope)

compare

public static Comparison compare(CDOObject left,
                                 CDOView rightView,
                                 CDOView[] originView)
Takes an arbitrary object (including resource nodes) and returns matches for all elements of its content tree. This scope has the advantage that the comparison can be rooted at specific objects that are different from (below of) the root resource. The disadvantage is that all the transitive children of this specific object are matched, whether they differ or not. Major parts of huge repositories can be loaded to the client side easily, if no attention is paid.


compare

public static Comparison compare(CDOView leftView,
                                 CDOView rightView,
                                 CDOView[] originView)
Takes a view/transaction and returns matches only for the changed elements of the entire content tree of its root resource. The advantage of this scope is that CDO-specific mechanisms are used to efficiently (remotely) determine the set of changed objects. Only those and their container objects are considered as matches, making this scope scale seamlessly with the overall size of a repository.


compare

public static Comparison compare(CDOView leftView,
                                 CDOView rightView,
                                 CDOView[] originView,
                                 Set<CDOID> ids)

compareUncommittedChanges

public static Comparison compareUncommittedChanges(CDOTransaction transaction)


Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.