Package org.eclipse.team.core.mapping.provider

## Class ResourceDiffTree

- java.lang.Object
- - org.eclipse.team.core.diff.provider.DiffTree
  - - org.eclipse.team.core.mapping.provider.ResourceDiffTree

All Implemented Interfaces:
  `IDiffTree`, `IResourceDiffTree`

    public class ResourceDiffTree
    extends DiffTree
    implements IResourceDiffTree

Implementation of `IResourceDiffTree`.

Since:
  3.2
Restriction:
  This class is not intended to be subclassed by clients.

### Field Summary

### Fields inherited from class org.eclipse.team.core.diff.provider.DiffTree

`START_CLIENT_PROPERTY_RANGE`

### Fields inherited from interface org.eclipse.team.core.diff.IDiffTree

`P_BUSY_HINT, P_HAS_DESCENDANT_CONFLICTS`

### Constructor Summary

Constructors
`ResourceDiffTree()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `accept​(ResourceTraversal[] traversals, IDiffVisitor visitor)` Visit all diffs in this tree that are covered by the given traversals.
`void` `add​(IDiff delta)` Add the given `IDiff` to the tree.
`IResource[]` `getAffectedResources()` Return all resources that contain diffs in this diff tree.
`IDiff` `getDiff​(IResource resource)` Return the diff for the given resource.
`IDiff[]` `getDiffs​(IResource resource, int depth)` Return all the diffs in the tree that are found for the given resource when traversed to the given depth.
`IDiff[]` `getDiffs​(ResourceTraversal[] traversals)` Return all the diffs in the tree that are contained in the given traversals.
`IResource` `getResource​(IDiff diff)` Return the resource associated with the given diff.
`static IResource` `getResourceFor​(IDiff node)` Get the resource for the diff node that was obtained from an `IResourceDiffTree`.
`boolean` `hasMatchingDiffs​(ResourceTraversal[] traversals, FastDiffFilter filter)` Return whether the this diff tree contains any diffs that match the given filter within the given traversals.
`IResource[]` `members​(IResource resource)` Return the members of the given resource that either have diffs in this tree of contain descendants that have diffs in this tree.
`void` `remove​(IResource resource)` Remove the diff associated with the given resource from the tree.

### Methods inherited from class org.eclipse.team.core.diff.provider.DiffTree

`accept, addDiffChangeListener, beginInput, clear, clearBusy, countFor, endInput, getChildren, getDiff, getDiffs, getPaths, getProperty, hasMatchingDiffs, isEmpty, remove, removeDiffChangeListener, reportError, setBusy, setPropertyToRoot, size`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.team.core.diff.IDiffTree

`accept, addDiffChangeListener, clearBusy, countFor, getChildren, getDiff, getProperty, hasMatchingDiffs, isEmpty, removeDiffChangeListener, setBusy, size`

### Constructor Detail

#### ResourceDiffTree

    public ResourceDiffTree()

### Method Detail

#### getResourceFor

    public static IResource getResourceFor​(IDiff node)

Get the resource for the diff node that was obtained from an `IResourceDiffTree`.

Parameters:
  `node` - the diff node.
Returns:
  the resource for the diff node

#### getDiff

    public IDiff getDiff​(IResource resource)

Description copied from interface: `IResourceDiffTree`
Return the diff for the given resource. This method is a convenience method that uses the path of the resource to access the diff.

Specified by:
  `getDiff` in interface `IResourceDiffTree`
Parameters:
  `resource` - a resource
Returns:
  the diff associated with the resource or `null` if the resource does not have any changes.

#### getResource

    public IResource getResource​(IDiff diff)

Description copied from interface: `IResourceDiffTree`
Return the resource associated with the given diff. This method will only return meaningful results for diffs which were obtained from this tree.

Specified by:
  `getResource` in interface `IResourceDiffTree`
Parameters:
  `diff` - a diff
Returns:
  the resource associated with the given diff

#### accept

    public void accept​(ResourceTraversal[] traversals,
                       IDiffVisitor visitor)

Description copied from interface: `IResourceDiffTree`
Visit all diffs in this tree that are covered by the given traversals.

Specified by:
  `accept` in interface `IResourceDiffTree`
Parameters:
  `traversals` - the set of traversals whose diffs are to be visited
  `visitor` - a diff visitor

#### getDiffs

    public IDiff[] getDiffs​(ResourceTraversal[] traversals)

Description copied from interface: `IResourceDiffTree`
Return all the diffs in the tree that are contained in the given traversals.

Specified by:
  `getDiffs` in interface `IResourceDiffTree`
Parameters:
  `traversals` - the traversals
Returns:
  all the diffs in the tree that are contained in the given traversals

#### getDiffs

    public IDiff[] getDiffs​(IResource resource,
                            int depth)

Description copied from interface: `IResourceDiffTree`
Return all the diffs in the tree that are found for the given resource when traversed to the given depth.

Specified by:
  `getDiffs` in interface `IResourceDiffTree`
Parameters:
  `resource` - the resource
  `depth` - the depth
Returns:
  all the diffs in the tree that are found for the given resource when traversed to the given depth

#### members

    public IResource[] members​(IResource resource)

Description copied from interface: `IResourceDiffTree`
Return the members of the given resource that either have diffs in this tree of contain descendants that have diffs in this tree.

Specified by:
  `members` in interface `IResourceDiffTree`
Parameters:
  `resource` - a resource
Returns:
  the members of the given resource that either have diffs in this tree of contain descendants that have diffs in this tree

#### getAffectedResources

    public IResource[] getAffectedResources()

Description copied from interface: `IResourceDiffTree`
Return all resources that contain diffs in this diff tree.

Specified by:
  `getAffectedResources` in interface `IResourceDiffTree`
Returns:
  all resources that contain diffs in this diff tree

#### add

    public void add​(IDiff delta)

Description copied from class: `DiffTree`
Add the given `IDiff` to the tree. A change event will be generated unless the call to this method is nested in between calls to `beginInput()` and `endInput(IProgressMonitor)` in which case the event for this addition and any other sync set change will be fired in a batched event when `endInput` is invoked.

Invoking this method outside of the above mentioned block will result in the `endInput(IProgressMonitor)` being invoked with a null progress monitor. If responsiveness is required, the client should always nest sync set modifications within `beginInput/endInput`.

Overrides:
  `add` in class `DiffTree`
Parameters:
  `delta` - the delta to be added to this set.

#### remove

    public void remove​(IResource resource)

Remove the diff associated with the given resource from the tree.

Parameters:
  `resource` - the resource

#### hasMatchingDiffs

    public boolean hasMatchingDiffs​(ResourceTraversal[] traversals,
                                    FastDiffFilter filter)

Description copied from interface: `IResourceDiffTree`
Return whether the this diff tree contains any diffs that match the given filter within the given traversals.

Specified by:
  `hasMatchingDiffs` in interface `IResourceDiffTree`
Parameters:
  `traversals` - the traversals
  `filter` - the diff node filter
Returns:
  whether the given diff tree contains any deltas that match the given filter