Package org.eclipse.emf.compare.rcp.ui.internal.contentmergeviewer.accessor.impl

## Class AbstractStructuralFeatureAccessor

- java.lang.Object
- - org.eclipse.emf.compare.rcp.ui.contentmergeviewer.accessor.legacy.impl.AbstractTypedElementAdapter
  - - org.eclipse.emf.compare.rcp.ui.internal.contentmergeviewer.accessor.impl.AbstractStructuralFeatureAccessor

All Implemented Interfaces:
  `ICompareAccessor`, `IStructuralFeatureAccessor`, `ITypedElement`

Direct Known Subclasses:
  `ContainmentReferenceChangeAccessorImpl`, `FeatureMapKeyChangeAccessorImpl`, `ManyStructuralFeatureAccessorImpl`, `SingleStructuralFeatureAccessorImpl`

    public abstract class AbstractStructuralFeatureAccessor
    extends AbstractTypedElementAdapter
    implements IStructuralFeatureAccessor

An abstract implementation of `IStructuralFeatureAccessor`.

Since:
  4.0

### Field Summary

### Fields inherited from interface org.eclipse.emf.compare.rcp.ui.contentmergeviewer.accessor.legacy.ITypedElement

`FOLDER_TYPE, TEXT_TYPE, UNKNOWN_TYPE`

### Constructor Summary

Constructors
`AbstractStructuralFeatureAccessor​(AdapterFactory adapterFactory, Diff diff, IMergeViewer.MergeViewerSide side)` Default constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected com.google.common.collect.ImmutableList<Diff>` `computeDifferences()` Compute the differences that apply on the structural feature.
`protected EStructuralFeature` `getAffectedFeature​(Diff diff)` Returns the structural feature affected by the given diff, if any.
`Comparison` `getComparison()` Returns the comparison object used by this accessor.
`protected com.google.common.collect.ImmutableList<Diff>` `getDifferences()` Returns the list of diff that apply on the structural feature.
`EObject` `getEObject​(IMergeViewer.MergeViewerSide side)` Returns the EObject associated with the structural feature.
`org.eclipse.swt.graphics.Image` `getImage()` Returns an image for this object.
`protected Diff` `getInitialDiff()` Returns the initial diff associated with this accessor.
`IMergeViewerItem` `getInitialItem()` Returns the initial item of this accessor.
`String` `getName()` Returns the name of this object.
`protected IMergeViewer.MergeViewerSide` `getSide()` Returns the side of the accessor.
`EStructuralFeature` `getStructuralFeature()` Returns the structural feature for which an accessor is needed.
`String` `getType()` Returns the type of this object.

### Methods inherited from class org.eclipse.emf.compare.rcp.ui.contentmergeviewer.accessor.legacy.impl.AbstractTypedElementAdapter

`getAdapterFactory, getItemDelegator, getRootAdapterFactory`

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

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

### Methods inherited from interface org.eclipse.emf.compare.rcp.ui.contentmergeviewer.accessor.ICompareAccessor

`getItems`

### Constructor Detail

#### AbstractStructuralFeatureAccessor

    public AbstractStructuralFeatureAccessor​(AdapterFactory adapterFactory,
                                             Diff diff,
                                             IMergeViewer.MergeViewerSide side)

Default constructor.

Parameters:
  `adapterFactory` - the adapater factory used to create the accessor.
  `diff` - the diff associated with this accessor.
  `side` - the side of the accessor.

### Method Detail

#### getComparison

    public Comparison getComparison()

Returns the comparison object used by this accessor.

Specified by:
  `getComparison` in interface `ICompareAccessor`
Returns:
  the comparison object used by this accessor.
See Also:
  `ICompareAccessor.getComparison()`

#### getInitialItem

    public IMergeViewerItem getInitialItem()

Returns the initial item of this accessor.

Specified by:
  `getInitialItem` in interface `ICompareAccessor`
Returns:
  the initial item of this accessor.
See Also:
  `ICompareAccessor.getInitialItem()`

#### getEObject

    public EObject getEObject​(IMergeViewer.MergeViewerSide side)

Returns the EObject associated with the structural feature.

Specified by:
  `getEObject` in interface `IStructuralFeatureAccessor`
Parameters:
  `side` - the side of the content merge viewer for which we want the EObject associated with the structural feature.
Returns:
  the EObject associated with the structural feature.
See Also:
  `ICompareAccessor.getInitialItem()`

#### getStructuralFeature

    public EStructuralFeature getStructuralFeature()

Returns the structural feature for which an accessor is needed.

Specified by:
  `getStructuralFeature` in interface `IStructuralFeatureAccessor`
Returns:
  the structural feature for which an accessor is needed.
See Also:
  `IStructuralFeatureAccessor.getStructuralFeature()`

#### getSide

    protected final IMergeViewer.MergeViewerSide getSide()

Returns the side of the accessor.

Returns:
  the side of the accessor.

#### getDifferences

    protected final com.google.common.collect.ImmutableList<Diff> getDifferences()

Returns the list of diff that apply on the structural feature.

Returns:
  the list of diff that apply on the structural feature.

#### computeDifferences

    protected com.google.common.collect.ImmutableList<Diff> computeDifferences()

Compute the differences that apply on the structural feature.

Returns:
  the list of diff that apply on the structural feature.

#### getAffectedFeature

    protected EStructuralFeature getAffectedFeature​(Diff diff)

Returns the structural feature affected by the given diff, if any.

Parameters:
  `diff` - The diff from which we need to retrieve a feature.
Returns:
  The feature affected by this `diff`, if any. `null` if none.

#### getInitialDiff

    protected final Diff getInitialDiff()

Returns the initial diff associated with this accessor.

Returns:
  the initial diff.

#### getName

    public String getName()

Returns the name of this object. The name is used when displaying this object in the UI.

Specified by:
  `getName` in interface `ITypedElement`
Returns:
  the name of this object
See Also:
  `ITypedElement.getName()`

#### getImage

    public org.eclipse.swt.graphics.Image getImage()

Returns an image for this object. This image is used when displaying this object in the UI.

Specified by:
  `getImage` in interface `ITypedElement`
Returns:
  the image of this object or `null` if this type of input has no image
See Also:
  `ITypedElement.getImage()`

#### getType

    public String getType()

Returns the type of this object. For objects with a file name this is typically the file extension. For folders its the constant `FOLDER_TYPE`. The type is used for determining a suitable viewer for this object.

Specified by:
  `getType` in interface `ITypedElement`
Returns:
  the type of this object
See Also:
  `ITypedElement.getType()`