public class CachingDiffRelationshipComputer extends Object implements IDiffRelationshipComputer
IMerger2| Modifier and Type | Field and Description | 
|---|---|
| protected Map<Diff,Set<Diff>> | allResultingMergesL2RAll resulting merges: left to right. | 
| protected Map<Diff,Set<Diff>> | allResultingMergesR2LAll resulting merges: right to left. | 
| protected Map<Diff,Set<Diff>> | allResultingRejectionsL2RAll resulting rejections: left to right. | 
| protected Map<Diff,Set<Diff>> | allResultingRejectionsR2LAll resulting rejections: right to left. | 
| protected IDiffRelationshipComputer | computerA computer instance to calculate the relationships between diffs. | 
| protected Map<Diff,Set<Diff>> | directMergeDependenciesL2RDirect merge dependencies: left to right. | 
| protected Map<Diff,Set<Diff>> | directMergeDependenciesR2LDirect merge dependencies: right to left. | 
| protected Map<Diff,Set<Diff>> | directResultingMergesL2RDirect resulting merges: left to right. | 
| protected Map<Diff,Set<Diff>> | directResultingMergesR2LDirect resulting merges: right to left. | 
| protected Map<Diff,Set<Diff>> | directResultingRejectionsL2RDirect resulting rejections: left to right. | 
| protected Map<Diff,Set<Diff>> | directResultingRejectionsR2LDirect resulting rejections: right to left. | 
| Constructor and Description | 
|---|
| CachingDiffRelationshipComputer(IDiffRelationshipComputer computer)Creates a new computer by wrapping the given instance. | 
| CachingDiffRelationshipComputer(IMerger.Registry registry)Creates a new computer with the given registry. | 
| CachingDiffRelationshipComputer(IMerger.Registry registry,
                               IMergeCriterion criterion)Creates a new computer with the given registry and merge criterion. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected Set<Diff> | computeAllResultingMerges(Diff diff,
                         boolean mergeRightToLeft)Computes all resulting merges for the given diff. | 
| protected Set<Diff> | computeAllResultingRejections(Diff diff,
                             boolean mergeRightToLeft)Computes all resulting rejections for the given diff. | 
| protected Set<Diff> | computeDirectMergeDependencies(Diff diff,
                              boolean mergeRightToLeft)Computes direct merge dependencies for the given diff. | 
| protected Set<Diff> | computeDirectResultingMerges(Diff diff,
                            boolean mergeRightToLeft)Computes direct resulting merges for the given diff. | 
| protected Set<Diff> | computeDirectResultingRejections(Diff diff,
                                boolean mergeRightToLeft)Computes the direct resulting rejections. | 
| Set<Diff> | getAllResultingMerges(Diff diff,
                     boolean mergeRightToLeft)Returns the cached direct resulting merges, if present. | 
| Set<Diff> | getAllResultingRejections(Diff diff,
                         boolean mergeRightToLeft)Retrieves the set of all diffs that will be rejected if the given  diffis merged, either
 because of unresolveable conflicts or because of unreachable requirements. | 
| protected Set<Diff> | getCachedAllResultingMerges(Diff diff,
                           boolean mergeRightToLeft)Returns the cached all resulting merges. | 
| protected Set<Diff> | getCachedAllResultingRejections(Diff diff,
                               boolean mergeRightToLeft)Returns the cached all resulting rejections. | 
| protected Set<Diff> | getCachedDirectMergeDependencies(Diff diff,
                                boolean mergeRightToLeft)Returns the cached direct merge dependencies. | 
| protected Set<Diff> | getCachedDirectResultingMerges(Diff diff,
                              boolean mergeRightToLeft)Returns the cached direct resulting merges. | 
| protected Set<Diff> | getCachedDirectResultingRejections(Diff diff,
                                  boolean mergeRightToLeft)Returns the cached direct resulting rejections. | 
| protected IDiffRelationshipComputer | getComputer()Returns the internal computer instance used to compute the diff relationships. | 
| Set<Diff> | getDirectMergeDependencies(Diff diff,
                          boolean mergeRightToLeft)Returns the cached direct merge dependencies, if present. | 
| Set<Diff> | getDirectResultingMerges(Diff diff,
                        boolean mergeRightToLeft)Returns the cached direct resulting merges, if present. | 
| Set<Diff> | getDirectResultingRejections(Diff diff,
                            boolean mergeRightToLeft)Returns the set of all differences that need to be rejected if  diffis merged in the given
 direction. | 
| IMergeCriterion | getMergeCriterion()Returns the merge criterion considered for calculating the diff relationships. | 
| IMerger2 | getMerger(Diff diff)Returns the best-fitting merger for the given diff according to the  merger
 registryand themerge criterion. | 
| IMerger.Registry | getMergerRegistry()Returns the merger registry used for calculating the diff relationships. | 
| boolean | hasMerger(Diff diff)Indicates whether a best-fitting merger for the given diff is available. | 
| void | invalidate()Invalidates the complete cache, so that relationships will be re-calculated any diff the next time a
 respective method is called. | 
| void | invalidate(Diff diff)Invalidates the cache for the given diff, so that relationships will be re-calculated for this diff the
 next time a respective method is called. | 
| void | invalidate(Iterable<Diff> diffs)Invalidates the cache for all given diffs, so that relationships will be re-calculated for each diff
 the next time a respective method is called. | 
| protected void | setCachedAllResultingMerges(Diff diff,
                           boolean mergeRightToLeft,
                           Set<Diff> allResultingMerges)Caches the given all resulting merges. | 
| protected void | setCachedAllResultingRejections(Diff diff,
                               boolean mergeRightToLeft,
                               Set<Diff> allResultingRejections)Caches the given all resulting rejections. | 
| protected void | setCachedDirectMergeDependencies(Diff diff,
                                boolean mergeRightToLeft,
                                Set<Diff> directMergeDependencies)Caches the given direct merge dependencies. | 
| protected void | setCachedDirectResultingMerges(Diff diff,
                              boolean mergeRightToLeft,
                              Set<Diff> directResultingMerges)Caches the given direct resulting merges. | 
| protected void | setCachedDirectResultingRejections(Diff diff,
                                  boolean mergeRightToLeft,
                                  Set<Diff> directResultingRejections)Caches the given direct resulting rejections. | 
| void | setMergeCriterion(IMergeCriterion mergeCriterion)Sets the merge criterion considered for calculating the diff relationships. | 
| void | setMergerRegistry(IMerger.Registry mergerRegistry)Sets the merger registry used for calculating the diff relationships. | 
protected IDiffRelationshipComputer computer
protected Map<Diff,Set<Diff>> directMergeDependenciesR2L
protected Map<Diff,Set<Diff>> directMergeDependenciesL2R
protected Map<Diff,Set<Diff>> directResultingMergesR2L
protected Map<Diff,Set<Diff>> directResultingMergesL2R
protected Map<Diff,Set<Diff>> directResultingRejectionsR2L
protected Map<Diff,Set<Diff>> directResultingRejectionsL2R
protected Map<Diff,Set<Diff>> allResultingMergesR2L
protected Map<Diff,Set<Diff>> allResultingMergesL2R
protected Map<Diff,Set<Diff>> allResultingRejectionsR2L
public CachingDiffRelationshipComputer(IMerger.Registry registry)
registry - merger registrypublic CachingDiffRelationshipComputer(IMerger.Registry registry, IMergeCriterion criterion)
registry - merger registrycriterion - merge criterion used to get the merger from the registry, use IMergeCriterion.NONE
            if no special criterion should be set.public CachingDiffRelationshipComputer(IDiffRelationshipComputer computer)
computer - computer instance used for calculating diff relationships.protected IDiffRelationshipComputer getComputer()
public IMerger.Registry getMergerRegistry()
IDiffRelationshipComputergetMergerRegistry in interface IDiffRelationshipComputerpublic void setMergerRegistry(IMerger.Registry mergerRegistry)
setMergerRegistry in interface IDiffRelationshipComputermergerRegistry - The merger registry.public IMergeCriterion getMergeCriterion()
IDiffRelationshipComputergetMergeCriterion in interface IDiffRelationshipComputerpublic IMerger2 getMerger(Diff diff)
IDiffRelationshipComputermerger
 registry and the merge criterion.getMerger in interface IDiffRelationshipComputerdiff - The difference for which we seek the merger.public boolean hasMerger(Diff diff)
IDiffRelationshipComputerhasMerger in interface IDiffRelationshipComputerdiff - The difference for which we seek the merger.public void setMergeCriterion(IMergeCriterion mergeCriterion)
setMergeCriterion in interface IDiffRelationshipComputermergeCriterion - The merger criterion.protected void setCachedDirectMergeDependencies(Diff diff, boolean mergeRightToLeft, Set<Diff> directMergeDependencies)
diff - diffmergeRightToLeft - merge directiondirectMergeDependencies - direct merge dependencies of diffprotected Set<Diff> getCachedDirectMergeDependencies(Diff diff, boolean mergeRightToLeft)
diff - diffmergeRightToLeft - merge directionprotected Set<Diff> computeDirectMergeDependencies(Diff diff, boolean mergeRightToLeft)
diff - diffmergeRightToLeft - merge directionpublic Set<Diff> getDirectMergeDependencies(Diff diff, boolean mergeRightToLeft)
getDirectMergeDependencies in interface IDiffRelationshipComputerdiff - diffmergeRightToLeft - merge directionIMerger2.getDirectMergeDependencies(Diff, boolean)protected void setCachedDirectResultingMerges(Diff diff, boolean mergeRightToLeft, Set<Diff> directResultingMerges)
diff - diffmergeRightToLeft - merge directiondirectResultingMerges - direct resulting mergesprotected Set<Diff> getCachedDirectResultingMerges(Diff diff, boolean mergeRightToLeft)
diff - diffmergeRightToLeft - merge directionprotected Set<Diff> computeDirectResultingMerges(Diff diff, boolean mergeRightToLeft)
diff - diffmergeRightToLeft - merge directionpublic Set<Diff> getDirectResultingMerges(Diff diff, boolean mergeRightToLeft)
getDirectResultingMerges in interface IDiffRelationshipComputerdiff - diffmergeRightToLeft - merge directionIMerger2.getDirectResultingMerges(Diff, boolean)protected void setCachedDirectResultingRejections(Diff diff, boolean mergeRightToLeft, Set<Diff> directResultingRejections)
diff - diffmergeRightToLeft - merge directiondirectResultingRejections - direct resulting rejectionsprotected Set<Diff> getCachedDirectResultingRejections(Diff diff, boolean mergeRightToLeft)
diff - diffmergeRightToLeft - merge directionprotected Set<Diff> computeDirectResultingRejections(Diff diff, boolean mergeRightToLeft)
diff - diffmergeRightToLeft - merge directionpublic Set<Diff> getDirectResultingRejections(Diff diff, boolean mergeRightToLeft)
IDiffRelationshipComputerdiff is merged in the given
 direction.getDirectResultingRejections in interface IDiffRelationshipComputerdiff - The difference for which we seek the direct resulting rejections.mergeRightToLeft - The direction in which we're considering a merge.IDiffRelationshipComputer.getAllResultingRejections(Diff, boolean), 
IMerger2.getDirectResultingRejections(Diff, boolean)protected void setCachedAllResultingRejections(Diff diff, boolean mergeRightToLeft, Set<Diff> allResultingRejections)
diff - diffmergeRightToLeft - merge directionallResultingRejections - all resulting rejectionsprotected Set<Diff> getCachedAllResultingRejections(Diff diff, boolean mergeRightToLeft)
diff - diffmergeRightToLeft - merge directionprotected Set<Diff> computeAllResultingRejections(Diff diff, boolean mergeRightToLeft)
diff - diffmergeRightToLeft - merge directionpublic Set<Diff> getAllResultingRejections(Diff diff, boolean mergeRightToLeft)
IDiffRelationshipComputerdiff is merged, either
 because of unresolveable conflicts or because of unreachable requirements.getAllResultingRejections in interface IDiffRelationshipComputerdiff - The difference for which we seek all opposite ones.mergeRightToLeft - The direction in which we're considering a merge.diff is merged in
         the given direction.protected void setCachedAllResultingMerges(Diff diff, boolean mergeRightToLeft, Set<Diff> allResultingMerges)
diff - diffmergeRightToLeft - merge directionallResultingMerges - all resulting mergesprotected Set<Diff> getCachedAllResultingMerges(Diff diff, boolean mergeRightToLeft)
diff - diffmergeRightToLeft - merge directionprotected Set<Diff> computeAllResultingMerges(Diff diff, boolean mergeRightToLeft)
diff - diffmergeRightToLeft - merge directionpublic Set<Diff> getAllResultingMerges(Diff diff, boolean mergeRightToLeft)
getAllResultingMerges in interface IDiffRelationshipComputerdiff - diffmergeRightToLeft - merge directionIMerger2.getDirectResultingMerges(Diff, boolean)public void invalidate(Diff diff)
diff - diff for which the cache should be invalidated.public void invalidate(Iterable<Diff> diffs)
diffs - diffs for which the cache should be invalidated.public void invalidate()
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.