Interface ITwoWayDiff
- All Superinterfaces:
IDiff
- All Known Subinterfaces:
IResourceDiff
- All Known Implementing Classes:
ResourceDiff
,TwoWayDiff
IResourceDelta
but is simplified.- Since:
- 3.2
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
Clients that need to create two-way diffs should instead use or
subclass
TwoWayDiff
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Change constant (bit mask) indicating that the content of the object has changed.static final int
Change constant (bit mask) indicating that the object was copied from another location.static final int
Change constant (bit mask) indicating that the object was moved from another location.static final int
Change constant (bit mask) indicating that the object was moved to another location.static final int
Change constant (bit mask) indicating that the object has been replaced by another at the same location (i.e., the object has been deleted and then added). -
Method Summary
Modifier and TypeMethodDescriptionint
getFlags()
Returns flags which describe in more detail how a object has been affected.Returns the full path (in the "before" state) from which this resource (in the "after" state) was moved.Returns the full path (in the "after" state) to which this resource (in the "before" state) was moved.Methods inherited from interface org.eclipse.team.core.diff.IDiff
getKind, getPath, toDiffString
-
Field Details
-
CONTENT
static final int CONTENTChange constant (bit mask) indicating that the content of the object has changed.- See Also:
-
MOVE_FROM
static final int MOVE_FROMChange constant (bit mask) indicating that the object was moved from another location. The location in the "before" state can be retrieved usinggetFromPath()
.- See Also:
-
MOVE_TO
static final int MOVE_TOChange constant (bit mask) indicating that the object was moved to another location. The location in the new state can be retrieved usinggetToPath()
.- See Also:
-
COPY_FROM
static final int COPY_FROMChange constant (bit mask) indicating that the object was copied from another location. The location in the "before" state can be retrieved usinggetFromPath()
.- See Also:
-
REPLACE
static final int REPLACEChange constant (bit mask) indicating that the object has been replaced by another at the same location (i.e., the object has been deleted and then added).- See Also:
-
-
Method Details
-
getFlags
int getFlags()Returns flags which describe in more detail how a object has been affected.The following codes (bit masks) are used when kind is
CHANGE
, and also when the object is involved in a move:CONTENT
- The bytes contained by the resource have been altered.REPLACE
- The object was deleted (either by a delete or move), and was subsequently re-created (either by a create, move, or copy).
REMOVE
(orCHANGE
in conjunction withREPLACE
):MOVE_TO
- The object has moved.getToPath
will return the path of where it was moved to.
ADD
(orCHANGE
in conjunction withREPLACE
):MOVE_FROM
- The object has moved.getFromPath
will return the path of where it was moved from.COPY_FROM
- The object has copied.getFromPath
will return the path of where it was copied from.
A simple move operation would result in the following diff information. If a object is moved from A to B (with no other changes to A or B), then A will have kind
REMOVE
, with flagMOVE_TO
, andgetToPath
on A will return the path for B. B will have kindADD
, with flagMOVE_FROM
, andgetFromPath
on B will return the path for A. B's other flags will describe any other changes to the resource, as compared to its previous location at A.Note that the move flags only describe the changes to a single object; they don't necessarily imply anything about the parent or children of the object. If the children were moved as a consequence of a subtree move operation, they will have corresponding move flags as well.
- Returns:
- the flags
- See Also:
-
getFromPath
IPath getFromPath()Returns the full path (in the "before" state) from which this resource (in the "after" state) was moved. This value is only valid if theMOVE_FROM
change flag is set; otherwise,null
is returned.Note: the returned path never has a trailing separator.
- Returns:
- a path, or
null
- See Also:
-
getToPath
IPath getToPath()Returns the full path (in the "after" state) to which this resource (in the "before" state) was moved. This value is only valid if theMOVE_TO
change flag is set; otherwise,null
is returned.Note: the returned path never has a trailing separator.
- Returns:
- a path, or
null
- See Also:
-