Package org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.item.impl

## Class MergeViewerItem

- java.lang.Object
- - org.eclipse.emf.common.notify.impl.AdapterImpl
  - - org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.item.impl.MergeViewerItem

All Implemented Interfaces:
  `Adapter`, `Adapter.Internal`, `IMergeViewerItem`

Direct Known Subclasses:
  `MergeViewerItem.Container`

    public class MergeViewerItem
    extends AdapterImpl
    implements IMergeViewerItem

### Nested Class Summary

Nested Classes
`static class` `MergeViewerItem.Container` Deprecated.

### Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter

`Adapter.Internal`

### Field Summary

### Fields inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl

`target`

### Fields inherited from interface org.eclipse.emf.compare.rcp.ui.mergeviewer.item.IMergeViewerItem

`IS_INSERTION_POINT`

### Constructor Summary

Constructors
`MergeViewerItem​(Comparison comparison, Diff diff, Object left, Object right, Object ancestor, IMergeViewer.MergeViewerSide side, AdapterFactory adapterFactory)`
`MergeViewerItem​(Comparison comparison, Diff diff, Match match, IMergeViewer.MergeViewerSide side, AdapterFactory adapterFactory)`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`IMergeViewerItem` `cloneAsOpposite()`
`protected IMergeViewerItem.Container` `createBasicContainer​(ResourceAttachmentChange diff)` Deprecated.
`protected IMergeViewerItem.Container` `createBasicContainer​(EObject eObject)` Deprecated.
`protected List<IMergeViewerItem>` `createInsertionPoints​(Comparison comparison, EStructuralFeature eStructuralFeature, List<? extends IMergeViewerItem> values, List<? extends Diff> differences)` Deprecated.
`protected List<IMergeViewerItem>` `createMergeViewerItemFrom​(Collection<?> values)` Deprecated.
`protected IMergeViewerItem` `createMergeViewerItemFrom​(EObject eObject)` Deprecated.
`protected List<? extends Diff>` `filteredDiffs​(Iterable<? extends Diff> unfilteredDiffs, com.google.common.base.Predicate<? super EObject> predicate, IDifferenceGroupProvider groupProvider)` Deprecated.
`protected AdapterFactory` `getAdapterFactory()`
`Object` `getAncestor()` Returns the ancestor side value of the Diff.
`protected Object` `getBestSideValue()`
`Comparison` `getComparison()`
`Diff` `getDiff()` The Diff associated with the Item.
`Object` `getLeft()` Returns the left side value of the Diff.
`IMergeViewerItem.Container` `getParent()` Returns the parent of this element.
`Object` `getRight()` Returns the right side value of the Diff.
`IMergeViewer.MergeViewerSide` `getSide()` Returns the side of the Diff.
`Object` `getSideValue​(IMergeViewer.MergeViewerSide side)` Returns the appropriate value according to the given side.
`boolean` `isInsertionPoint()` Returns true if the Item is an insertion point, false otherwise.
`String` `toString()`
`protected com.google.common.base.Predicate<Diff>` `visibleInMergeViewer​(com.google.common.base.Predicate<? super EObject> predicate, IDifferenceGroupProvider groupProvider)` Deprecated.
`protected boolean` `yieldsInsertionPoint​(Iterable<Diff> diffs)` Deprecated.
`protected boolean` `yieldsMergeViewerItem​(Collection<?> values)` Deprecated.

### Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl

`getTarget, isAdapterForType, notifyChanged, setTarget, unsetTarget`

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

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

### Methods inherited from interface org.eclipse.emf.common.notify.Adapter

`getTarget, isAdapterForType, notifyChanged, setTarget`

### Constructor Detail

#### MergeViewerItem

    public MergeViewerItem​(Comparison comparison,
                           Diff diff,
                           Object left,
                           Object right,
                           Object ancestor,
                           IMergeViewer.MergeViewerSide side,
                           AdapterFactory adapterFactory)

#### MergeViewerItem

    public MergeViewerItem​(Comparison comparison,
                           Diff diff,
                           Match match,
                           IMergeViewer.MergeViewerSide side,
                           AdapterFactory adapterFactory)

Parameters:
  `comparison` -
  `diff` -
  `match` -
  `side` -
  `adapterFactory` -

### Method Detail

#### getDiff

    public final Diff getDiff()

Description copied from interface: `IMergeViewerItem`
The Diff associated with the Item.

Specified by:
  `getDiff` in interface `IMergeViewerItem`
Returns:

#### getAncestor

    public final Object getAncestor()

Returns the ancestor side value of the Diff.

Specified by:
  `getAncestor` in interface `IMergeViewerItem`
Returns:
  the ancestor side value of the Diff.
See Also:
  `org.eclipse.emf.compare.rcp.ui.mergeviewer.item.ide.ui.internal.contentmergeviewer.IMergeViewerItem#getAncestor()`

#### getLeft

    public final Object getLeft()

Returns the left side value of the Diff.

Specified by:
  `getLeft` in interface `IMergeViewerItem`
Returns:
  the left side value of the Diff.
See Also:
  `org.eclipse.emf.compare.rcp.ui.mergeviewer.item.ide.ui.internal.contentmergeviewer.IMergeViewerItem#getLeft()`

#### getRight

    public final Object getRight()

Returns the right side value of the Diff.

Specified by:
  `getRight` in interface `IMergeViewerItem`
Returns:
  the right side value of the Diff.
See Also:
  `org.eclipse.emf.compare.rcp.ui.mergeviewer.item.ide.ui.internal.contentmergeviewer.IMergeViewerItem#getRight()`

#### getSide

    public final IMergeViewer.MergeViewerSide getSide()

Description copied from interface: `IMergeViewerItem`
Returns the side of the Diff.

Specified by:
  `getSide` in interface `IMergeViewerItem`
Returns:
  the fSide

#### getSideValue

    public final Object getSideValue​(IMergeViewer.MergeViewerSide side)

Returns the appropriate value according to the given side.

Specified by:
  `getSideValue` in interface `IMergeViewerItem`
Parameters:
  `side` - the given side.
Returns:
  the appropriate value according to the given side.
See Also:
  `org.eclipse.emf.compare.rcp.ui.mergeviewer.item.ide.ui.internal.contentmergeviewer.IMergeViewerItem#getSideValue(org.eclipse.emf.compare.rcp.ui.mergeviewer.ide.ui.internal.contentmergeviewer.IMergeViewer.MergeViewerSide)`

#### getParent

    public IMergeViewerItem.Container getParent()

Returns the parent of this element. If the object is the root of a hierarchy `null` is returned.

Specified by:
  `getParent` in interface `IMergeViewerItem`
Returns:
  the parent of this element, or `null` if the element has no parent
See Also:
  `IMergeViewerItem.getParent()`

#### cloneAsOpposite

    public IMergeViewerItem cloneAsOpposite()

#### getBestSideValue

    protected final Object getBestSideValue()

#### isInsertionPoint

    public boolean isInsertionPoint()

Returns true if the Item is an insertion point, false otherwise.

Specified by:
  `isInsertionPoint` in interface `IMergeViewerItem`
Returns:
  true if the Item is an insertion point, false otherwise.
See Also:
  `IMergeViewerItem.isInsertionPoint()`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`
See Also:
  `Object.toString()`

#### getComparison

    public final Comparison getComparison()

Returns:
  the fComparison

#### getAdapterFactory

    protected final AdapterFactory getAdapterFactory()

Returns:
  the fAdapterFactory

#### createBasicContainer

    @Deprecated
    protected final IMergeViewerItem.Container createBasicContainer​(EObject eObject)

Deprecated.

#### createBasicContainer

    @Deprecated
    protected final IMergeViewerItem.Container createBasicContainer​(ResourceAttachmentChange diff)

Deprecated.
Create an IMergeViewerItem for the parent of the given `ResourceAttachmentChange`.

Parameters:
  `diff` - the given `ResourceAttachmentChange`.
Returns:
  an IMergeViewerItem.

#### createInsertionPoints

    @Deprecated
    protected final List<IMergeViewerItem> createInsertionPoints​(Comparison comparison,
                                                                 EStructuralFeature eStructuralFeature,
                                                                 List<? extends IMergeViewerItem> values,
                                                                 List<? extends Diff> differences)

Deprecated.

#### createMergeViewerItemFrom

    @Deprecated
    protected final List<IMergeViewerItem> createMergeViewerItemFrom​(Collection<?> values)

Deprecated.

#### yieldsMergeViewerItem

    @Deprecated
    protected boolean yieldsMergeViewerItem​(Collection<?> values)

Deprecated.

#### yieldsInsertionPoint

    @Deprecated
    protected boolean yieldsInsertionPoint​(Iterable<Diff> diffs)

Deprecated.

#### createMergeViewerItemFrom

    @Deprecated
    protected IMergeViewerItem createMergeViewerItemFrom​(EObject eObject)

Deprecated.
Creates an IMergeViewerItem from an EObject.

Parameters:
  `eObject` - the given eObject.
Returns:
  an IMergeViewerItem.

#### filteredDiffs

    @Deprecated
    protected List<? extends Diff> filteredDiffs​(Iterable<? extends Diff> unfilteredDiffs,
                                                 com.google.common.base.Predicate<? super EObject> predicate,
                                                 IDifferenceGroupProvider groupProvider)

Deprecated.
Returns a list of those of the given diffs that are displayed in a group as provided by the given group provider and satisfy the given predicate.

Parameters:
  `unfilteredDiffs` - the unfiltered diffs
  `predicate` - a filter predicate; a `null` predicate will be satisfied by any diff
  `groupProvider` - the active group provider
Returns:
  a list of the filtered diffs

#### visibleInMergeViewer

    @Deprecated
    protected com.google.common.base.Predicate<Diff> visibleInMergeViewer​(com.google.common.base.Predicate<? super EObject> predicate,
                                                                          IDifferenceGroupProvider groupProvider)

Deprecated.