Interface IElementDelta
public interface IElementDelta
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Difference constant (value 1) indicating one side was added.static final int
Difference constant (value 3) indicating side changed.static final int
Bit mask (value 3) for extracting the kind of difference.static final int
Three-way change constant (value 12) indicating a change on left and right sides.static final int
Difference constant (value 2) indicating one side was removed.static final int
Bit mask (value 12) for extracting the direction of a three-way change.static final int
Three-way change constant (value 4) indicating a change on left side.static final int
Difference constant (value 0) indicating no difference.static final int
Constant (value 16) indicating a change on left and right side (with respect to ancestor) but left and right are identical.static final int
Three-way change constant (value 8) indicating a change on right side. -
Method Summary
Modifier and TypeMethodDescriptionboolean
accept
(IDeltaVisitor visitor) Returns a handle for the affected masterelement.Returns the children of this container.getId()
int
getKind()
Returns the kind of difference as defined inDifferencer
.Returns the parent of this element.getType()
boolean
Returns whether this container has at least one child.boolean
traverseChildren
(IDeltaVisitor visitor, boolean includePhantoms)
-
Field Details
-
NO_CHANGE
static final int NO_CHANGEDifference constant (value 0) indicating no difference.- See Also:
-
ADDITION
static final int ADDITIONDifference constant (value 1) indicating one side was added.- See Also:
-
DELETION
static final int DELETIONDifference constant (value 2) indicating one side was removed.- See Also:
-
CHANGE
static final int CHANGEDifference constant (value 3) indicating side changed.- See Also:
-
CHANGE_TYPE_MASK
static final int CHANGE_TYPE_MASKBit mask (value 3) for extracting the kind of difference.- See Also:
-
LEFT
static final int LEFTThree-way change constant (value 4) indicating a change on left side.- See Also:
-
RIGHT
static final int RIGHTThree-way change constant (value 8) indicating a change on right side.- See Also:
-
CONFLICTING
static final int CONFLICTINGThree-way change constant (value 12) indicating a change on left and right sides.- See Also:
-
DIRECTION_MASK
static final int DIRECTION_MASKBit mask (value 12) for extracting the direction of a three-way change.- See Also:
-
PSEUDO_CONFLICT
static final int PSEUDO_CONFLICTConstant (value 16) indicating a change on left and right side (with respect to ancestor) but left and right are identical.- See Also:
-
-
Method Details
-
getKind
int getKind()Returns the kind of difference as defined inDifferencer
.- Returns:
- the kind of difference as defined in
Differencer
-
getParent
IElementDelta getParent()Returns the parent of this element. If the object is the root of a hierarchynull
is returned.- Returns:
- the parent of this element, or
null
if the element has no parent
-
getChildren
IElementDelta[] getChildren()Returns the children of this container. If this container has no children an empty array is returned (notnull
).- Returns:
- the children of this container as an array
-
hasChildren
boolean hasChildren()Returns whether this container has at least one child. In some cases this methods avoids having to call the potential more costlygetChildren
method.- Returns:
true
if this container has at least one child
-
getBaseElement
IBaseElement getBaseElement()Returns a handle for the affected masterelement.For additions (
ADDED
), this handle describes the newly-added masterelement; i.e., the one in the "after" state.For changes (
CHANGED
), this handle also describes the masterelement in the "after" state.For removals (
REMOVED
), this handle describes the masterelement in the "before" state. Even though this resource would not normally exist in the current workspace, the type of resource that was removed can be determined from the handle.For phantom additions and removals (
ADDED_PHANTOM
andREMOVED_PHANTOM
), this is the handle of the phantom resource.- Returns:
- the affected masterelement (handle)
-
getType
String getType() -
getId
String getId() -
accept
-
traverseChildren
-