Class SynchronizationModel

java.lang.Object
org.eclipse.emf.compare.ide.ui.logical.SynchronizationModel
All Implemented Interfaces:
IDiagnosable

@Beta public final class SynchronizationModel extends Object implements IDiagnosable
This class acts as a simple DTO that allows us to store the three traversals corresponding to the three sides of a comparison while we build its scope.
Since:
4.0
  • Constructor Details

    • SynchronizationModel

      public SynchronizationModel(StorageTraversal leftTraversal, StorageTraversal rightTraversal, StorageTraversal originTraversal)
      Constructs our logical model given the three traversal for our sides.
      Parameters:
      leftTraversal - The traversal corresponding to the left side.
      rightTraversal - The traversal corresponding to the right side.
      originTraversal - The traversal corresponding to the common ancestor of both other side. Can be null.
    • SynchronizationModel

      public SynchronizationModel(StorageTraversal leftTraversal, StorageTraversal rightTraversal, StorageTraversal originTraversal, Diagnostic diagnostic)
      Constructs our logical model given the three traversal for our sides.
      Parameters:
      leftTraversal - The traversal corresponding to the left side.
      rightTraversal - The traversal corresponding to the right side.
      originTraversal - The traversal corresponding to the common ancestor of both other side. Can be null.
      diagnostic - The diagnostic that have gathered during the computation of the traversals.
  • Method Details

    • getLeftTraversal

      public StorageTraversal getLeftTraversal()
      Returns the left traversal of this model.
      Returns:
      The left traversal of this model.
    • getRightTraversal

      public StorageTraversal getRightTraversal()
      Returns the right traversal of this model.
      Returns:
      The right traversal of this model.
    • getOriginTraversal

      public StorageTraversal getOriginTraversal()
      Returns the origin traversal of this model, if any.
      Returns:
      The origin traversal of this model, null if none.
    • getDiagnostic

      public Diagnostic getDiagnostic()
      Returns the diagnostics that may have been issued for the synchronization model, as well as for the left, right, and origin side.
      Specified by:
      getDiagnostic in interface IDiagnosable
      Returns:
      The diagnostics of the synchronization model, left, right, and origin side.
    • setDiagnostic

      public void setDiagnostic(Diagnostic diagnostic)
      Set the diagnostic to be associated with this scope.
      Specified by:
      setDiagnostic in interface IDiagnosable
      Parameters:
      diagnostic - the diagnostic
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getResources

      public Set<org.eclipse.core.resources.IResource> getResources()
      Returns the set of resources this synchronization model spans.

      The returned set may contain resources that do not exist locally. The set of resources is cached. If no cached set is available, this method will compute and cache it. Note that the cache may not be in sync, if the traversals of this synchronization model have been changed after getResources() has been called.

      Returns:
      The set of resources this synchronization model spans.
      Since:
      4.1
    • getAllInvolvedResources

      public Set<org.eclipse.core.resources.IResource> getAllInvolvedResources()
      Returns the all resources that are involved in this synchronization model.

      This is the set of resources involved directly after the instantiation of this synchronization model and hence the set of resources before any minimization that may have been applied.

      Returns:
      The initial set of all resources this synchronization model spans.
      Since:
      4.3