Class ResourceDiff
- java.lang.Object
-
- org.eclipse.team.core.diff.provider.Diff
-
- org.eclipse.team.core.diff.provider.TwoWayDiff
-
- org.eclipse.team.core.mapping.provider.ResourceDiff
-
- All Implemented Interfaces:
IDiff,ITwoWayDiff,IResourceDiff
public class ResourceDiff extends TwoWayDiff implements IResourceDiff
Implementation ofIResourceDiff.This class may be subclassed by clients.
- Since:
- 3.2
-
-
Field Summary
-
Fields inherited from class org.eclipse.team.core.diff.provider.TwoWayDiff
FLAG_MASK
-
Fields inherited from interface org.eclipse.team.core.mapping.IResourceDiff
DESCRIPTION, OPEN
-
-
Constructor Summary
Constructors Constructor Description ResourceDiff(IResource resource, int kind)Convenience constructor for creating a simple folder diff that consists of a resource and a kind only.ResourceDiff(IResource resource, int kind, int flags, IFileRevision before, IFileRevision after)Create a two-way resource diff
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)IFileRevisiongetAfterState()Return a handle to the file state representing the "after" state of the file used to calculate this diff.IFileRevisiongetBeforeState()Return a handle to the file state representing the "before" state of the file used to calculate this diff.IResourcegetResource()Return the local resource to which this diff applies.-
Methods inherited from class org.eclipse.team.core.diff.provider.TwoWayDiff
getFlags, getFromPath, getToPath
-
Methods inherited from class org.eclipse.team.core.diff.provider.Diff
getKind, getPath, getStatus, hashCode, toDiffString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.team.core.diff.IDiff
getKind, getPath, toDiffString
-
Methods inherited from interface org.eclipse.team.core.diff.ITwoWayDiff
getFlags, getFromPath, getToPath
-
-
-
-
Constructor Detail
-
ResourceDiff
public ResourceDiff(IResource resource, int kind, int flags, IFileRevision before, IFileRevision after)
Create a two-way resource diff- Parameters:
resource- the resourcekind- the kind of change (ADDED, REMOVED or CHANGED)flags- additional flags that describe the changebefore- the before state of the model objectafter- the after state of the model object
-
ResourceDiff
public ResourceDiff(IResource resource, int kind)
Convenience constructor for creating a simple folder diff that consists of a resource and a kind only. It is equivalent toResourceDiff(resource, kind, 0, null, null)- Parameters:
resource- a resourcekind- the kind of change (ADDED, REMOVED or CHANGED)
-
-
Method Detail
-
getBeforeState
public IFileRevision getBeforeState()
Description copied from interface:IResourceDiffReturn a handle to the file state representing the "before" state of the file used to calculate this diff. Anullis returned if the resource is not a file or if the file does not exist in the before state. If a file state is returned, clients should still check theIFileState.exists()method to see if the file existed in the before state.- Specified by:
getBeforeStatein interfaceIResourceDiff- Returns:
- a handle to the file state representing the "before" state used to calculate this diff
-
getAfterState
public IFileRevision getAfterState()
Description copied from interface:IResourceDiffReturn a handle to the file state representing the "after" state of the file used to calculate this diff. Anullis returned if the resource is not a file or if the file does not exist in the after state. If a file state is returned, clients should still check theIFileState.exists()method to see if the file existed in the after state.- Specified by:
getAfterStatein interfaceIResourceDiff- Returns:
- a handle to the file state representing the "before" state used to calculate this diff
-
getResource
public IResource getResource()
Description copied from interface:IResourceDiffReturn the local resource to which this diff applies.- Specified by:
getResourcein interfaceIResourceDiff- Returns:
- the local resource to which this diff applies
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classTwoWayDiff
-
-