public final class ComparisonUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static Comparison |
getComparison(EObject object)
Returns the comparison associated with the given object.
|
static com.google.common.base.Function<Diff,Iterable<Diff>> |
getSubDiffs(boolean leftToRight)
When merging a
Diff, returns the sub diffs of this given diff, and all associated diffs (see
DiffUtil#getAssociatedDiffs(Iterable, boolean, Diff)) of these sub diffs. |
static boolean |
isAddOrSetDiff(Diff difference)
Checks if the given difference is either an addition or a "set" from the default value to a new
reference.
|
static boolean |
isDeleteOrUnsetDiff(Diff difference)
Checks if the given difference is either a deletion or a "unset" to the default value.
|
static boolean |
isFeatureMapContainment(Diff diff)
Checks whether the given diff corresponds to a feature map containment change.
|
static EObject |
moveElementGetExpectedContainer(Comparison comparison,
FeatureMapChange diff,
boolean rightToLeft)
Get the expected target container in case of a move.
|
public static com.google.common.base.Function<Diff,Iterable<Diff>> getSubDiffs(boolean leftToRight)
Diff, returns the sub diffs of this given diff, and all associated diffs (see
DiffUtil#getAssociatedDiffs(Iterable, boolean, Diff)) of these sub diffs.
If the diff is an AttributeChange, a
FeatureMapChange or a
ResourceAttachmentChange , this method will return an empty iterable.
If the diff is a ReferenceChange this method will return all differences contained in the match
that contains the value of the reference change, and all associated diffs of these differences.
leftToRight - the direction of merge.public static boolean isAddOrSetDiff(Diff difference)
difference - The given difference.true if this is an addition or "set" diff.public static boolean isDeleteOrUnsetDiff(Diff difference)
difference - The given difference.true if this is a deletion or "unset" diff.public static boolean isFeatureMapContainment(Diff diff)
diff - The diff to consider.true if the given diff is to be considered a containment change,
false otherwise.public static EObject moveElementGetExpectedContainer(Comparison comparison, FeatureMapChange diff, boolean rightToLeft)
comparison - The comparison object.diff - The diff we are currently merging.rightToLeft - Whether we should move the value in the left or right side.null otherwise.public static Comparison getComparison(EObject object)
object - the object from which the comparison should be retrieved.
Copyright (c) 2006, 2014 Obeo and others. All rights reserved.