Class DiffRelationshipComputer
- All Implemented Interfaces:
IDiffRelationshipComputer
- Direct Known Subclasses:
CachingDiffRelationshipComputer
- Since:
- 3.5
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IMergeCriterionMerge criterion used to retrieve the correct merger.protected IMerger.RegistryMerger registry used to retrieve the correct merger. -
Constructor Summary
ConstructorsConstructorDescriptionDiffRelationshipComputer(IMerger.Registry registry) Creates a new relationship computer.DiffRelationshipComputer(IMerger.Registry registry, IMergeCriterion criterion) Creates a new relationship computer. -
Method Summary
Modifier and TypeMethodDescriptiongetAllResultingMerges(Diff diff, boolean rightToLeft) Retrieves the set of all diffs related to the givendiffwhen merging in the given direction.getAllResultingMerges(Diff diff, boolean rightToLeft, com.google.common.base.Predicate<? super Diff> filter) Retrieves the set of all diffs related to the givendiffwhen merging in the given direction.getAllResultingRejections(Diff diff, boolean mergeRightToLeft) Retrieves the set of all diffs that will be rejected if the givendiffis merged, either because of unresolveable conflicts or because of unreachable requirements.getAllResultingRejections(Diff diff, boolean mergeRightToLeft, com.google.common.base.Predicate<? super Diff> filter) Retrieves the set of all diffs that will be rejected if the givendiffis merged, either because of unresolveable conflicts or because of unreachable requirements.getDirectMergeDependencies(Diff diff, boolean mergeRightToLeft) Retrieves the set of directly required diffs needed in order to merge the givendiff.getDirectResultingMerges(Diff diff, boolean mergeRightToLeft) Returns all differences that will be merged because of our merging the givendiff.getDirectResultingRejections(Diff diff, boolean mergeRightToLeft) Returns the set of all differences that need to be rejected ifdiffis merged in the given direction.Returns the merge criterion considered for calculating the diff relationships.Returns the best-fitting merger for the given diff according to themerger registryand themerge criterion.Returns the merger registry used for calculating the diff relationships.protected IMerger.Registry2Returns themerger registryasIMerger.Registry2, if possible.booleanIndicates whether a best-fitting merger for the given diff is available.internalGetAllResultingMerges(Diff diff, boolean rightToLeft) Returns the set of all differences directly related to the given one, either as dependencies or as implications.voidsetMergeCriterion(IMergeCriterion mergeCriterion) Sets the merge criterion considered for calculating the diff relationships.voidsetMergerRegistry(IMerger.Registry mergerRegistry) Sets the merger registry used for calculating the diff relationships.
-
Field Details
-
registry
Merger registry used to retrieve the correct merger. -
criterion
Merge criterion used to retrieve the correct merger.
-
-
Constructor Details
-
DiffRelationshipComputer
Creates a new relationship computer.- Parameters:
registry- merger registry
-
DiffRelationshipComputer
Creates a new relationship computer.- Parameters:
registry- merger registrycriterion- merge criterion used to get the merger from the registry, useIMergeCriterion.NONEif no special criterion should be set.
-
-
Method Details
-
getMergerRegistry
Description copied from interface:IDiffRelationshipComputerReturns the merger registry used for calculating the diff relationships.- Specified by:
getMergerRegistryin interfaceIDiffRelationshipComputer- Returns:
- The merger registry.
-
setMergerRegistry
Description copied from interface:IDiffRelationshipComputerSets the merger registry used for calculating the diff relationships.- Specified by:
setMergerRegistryin interfaceIDiffRelationshipComputer- Parameters:
mergerRegistry- The merger registry.
-
getMergeCriterion
Description copied from interface:IDiffRelationshipComputerReturns the merge criterion considered for calculating the diff relationships.- Specified by:
getMergeCriterionin interfaceIDiffRelationshipComputer- Returns:
- The merge criterion.
-
setMergeCriterion
Description copied from interface:IDiffRelationshipComputerSets the merge criterion considered for calculating the diff relationships.- Specified by:
setMergeCriterionin interfaceIDiffRelationshipComputer- Parameters:
mergeCriterion- The merger criterion.
-
getMergerRegistry2
Returns themerger registryasIMerger.Registry2, if possible. If the merger registry is not an instance ofIMerger.Registry2, null is returned.- Returns:
IMerger.Registry2instance or null.
-
getMerger
Description copied from interface:IDiffRelationshipComputerReturns the best-fitting merger for the given diff according to themerger registryand themerge criterion.- Specified by:
getMergerin interfaceIDiffRelationshipComputer- Parameters:
diff- The difference for which we seek the merger.- Returns:
- The best-fitting merger for the given diff or null if no merger fits.
-
hasMerger
Description copied from interface:IDiffRelationshipComputerIndicates whether a best-fitting merger for the given diff is available.- Specified by:
hasMergerin interfaceIDiffRelationshipComputer- Parameters:
diff- The difference for which we seek the merger.- Returns:
- Returns true if a best-fitting merger is available, false otherwise.
-
getDirectMergeDependencies
Description copied from interface:IDiffRelationshipComputerRetrieves the set of directly required diffs needed in order to merge the givendiff. This may includes the diff's requirements or any other diff that we need to merge before the given one.- Specified by:
getDirectMergeDependenciesin interfaceIDiffRelationshipComputer- Parameters:
diff- The difference for which we seek the direct merge dependencies.mergeRightToLeft- The direction in which we're considering a merge.- Returns:
- A non-null set of direct merge dependencies.
- See Also:
-
getDirectResultingMerges
Description copied from interface:IDiffRelationshipComputerReturns all differences that will be merged because of our merging the givendiff. This may include the diff's implications, the diff's equivalences, the diff's refinements or any other diff that we need to merge together with the given diff.- Specified by:
getDirectResultingMergesin interfaceIDiffRelationshipComputer- Parameters:
diff- The difference for which we seek the direct merge dependencies.mergeRightToLeft- The direction in which we're considering a merge.- Returns:
- A non-null set of direct resulting merges.
- See Also:
-
getDirectResultingRejections
Description copied from interface:IDiffRelationshipComputerReturns the set of all differences that need to be rejected ifdiffis merged in the given direction.- Specified by:
getDirectResultingRejectionsin interfaceIDiffRelationshipComputer- Parameters:
diff- The difference for which we seek the direct resulting rejections.mergeRightToLeft- The direction in which we're considering a merge.- Returns:
- A non-null set of direct resulting rejections.
- See Also:
-
getAllResultingMerges
Description copied from interface:IDiffRelationshipComputerRetrieves the set of all diffs related to the givendiffwhen merging in the given direction.This is expected to return the set of all differences that will be need to merged along when a user wishes to merge
diff, either because they are required by it or because they are implied by it one way or another.Note that
diffwill be included in the returned set.Also note that the resulting merges will contain the resulting rejections (diffs from the other side that will be rejected)
- Specified by:
getAllResultingMergesin interfaceIDiffRelationshipComputer- Parameters:
diff- The difference for which we seek all related ones.rightToLeft- The direction in which we're considering a merge.- Returns:
- A non-null set of all diffs related to the given
diffwhen merging in the given direction.
-
getAllResultingMerges
public Set<Diff> getAllResultingMerges(Diff diff, boolean rightToLeft, com.google.common.base.Predicate<? super Diff> filter) Description copied from interface:IDiffRelationshipComputerRetrieves the set of all diffs related to the givendiffwhen merging in the given direction.This is expected to return the set of all differences that will be need to merged along when a user wishes to merge
diff, either because they are required by it or because they are implied by it one way or another.Note that
diffwill be included in the returned set.Also note that the resulting merges will contain the resulting rejections (diffs from the other side that will be rejected)
- Specified by:
getAllResultingMergesin interfaceIDiffRelationshipComputer- Parameters:
diff- The difference for which we seek all related ones.rightToLeft- The direction in which we're considering a merge.filter- The filter to control which diffs are visted when collecting the result.- Returns:
- A non-null set of all diffs related to the given
diffwhen merging in the given direction.
-
internalGetAllResultingMerges
Returns the set of all differences directly related to the given one, either as dependencies or as implications.- Parameters:
diff- The difference for which we seek all directly related others.rightToLeft- The direction in which we're considering a merge.- Returns:
- The set of all differences directly related to the given one.
-
getAllResultingRejections
Description copied from interface:IDiffRelationshipComputerRetrieves the set of all diffs that will be rejected if the givendiffis merged, either because of unresolveable conflicts or because of unreachable requirements.- Specified by:
getAllResultingRejectionsin interfaceIDiffRelationshipComputer- Parameters:
diff- The difference for which we seek all opposite ones.mergeRightToLeft- The direction in which we're considering a merge.- Returns:
- A non-null set of all diffs that will be rejected if the given
diffis merged in the given direction.
-
getAllResultingRejections
public Set<Diff> getAllResultingRejections(Diff diff, boolean mergeRightToLeft, com.google.common.base.Predicate<? super Diff> filter) Description copied from interface:IDiffRelationshipComputerRetrieves the set of all diffs that will be rejected if the givendiffis merged, either because of unresolveable conflicts or because of unreachable requirements.- Specified by:
getAllResultingRejectionsin interfaceIDiffRelationshipComputer- Parameters:
diff- The difference for which we seek all opposite ones.mergeRightToLeft- The direction in which we're considering a merge.filter- The filter to control which diffs are visted when collecting the result.- Returns:
- A non-null set of all diffs that will be rejected if the given
diffis merged in the given direction.
-