Package org.eclipse.compare

## Interface ICompareFilter

    public interface ICompareFilter

A filter that can be applied during the comparison of documents that can be used to customize the detection of text differences via the compareFilter extension point. Filters are exposed as toggle actions in the compare viewer.

Since:
  3.6
Restriction:
  This interface is not intended to be referenced by clients

### Field Summary

Fields
`static String` `OTHER_CONTRIBUTOR` Key for the `Character` representing contributor of the other line.
`static String` `OTHER_LINE` Key for the `String` of the line of text this line is being compared to.
`static String` `THIS_CONTRIBUTOR` Key for the `Character` representing contributor of this line.
`static String` `THIS_LINE` Key for the `String` of the line of text being compared.

### Method Summary

All Methods Instance Methods Abstract Methods
`boolean` `canCacheFilteredRegions()` Because the comparison routine may compare each line multiple times to other lines, the ignored regions may need to be calculated multiple times for the same line during a comparison.
`IRegion[]` `getFilteredRegions​(HashMap lineComparison)` Identifies the regions of a line of text in a comparison that should be ignored for comparison purposes.
`boolean` `isEnabledInitially()` Returns whether the filter should be enabled when first initialized
`void` `setInput​(Object input, Object ancestor, Object left, Object right)` Forwards the current input objects of the compare

### Field Detail

#### THIS_LINE

    static final String THIS_LINE

Key for the `String` of the line of text being compared.

See Also:
  Constant Field Values

#### THIS_CONTRIBUTOR

    static final String THIS_CONTRIBUTOR

Key for the `Character` representing contributor of this line. Value is either 'A' for ancestor, 'L' for left, or 'R' for right.

See Also:
  Constant Field Values

#### OTHER_LINE

    static final String OTHER_LINE

Key for the `String` of the line of text this line is being compared to.

See Also:
  Constant Field Values

#### OTHER_CONTRIBUTOR

    static final String OTHER_CONTRIBUTOR

Key for the `Character` representing contributor of the other line. Value is either 'A' for ancestor, 'L' for left, or 'R' for right.

See Also:
  Constant Field Values

### Method Detail

#### setInput

    void setInput​(Object input,
                  Object ancestor,
                  Object left,
                  Object right)

Forwards the current input objects of the compare

Parameters:
  `input` - the merge viewer input
  `ancestor` - input into ancestor viewer
  `left` - input into left viewer
  `right` - input into right viewer

#### getFilteredRegions

    IRegion[] getFilteredRegions​(HashMap lineComparison)

Identifies the regions of a line of text in a comparison that should be ignored for comparison purposes.

Parameters:
  `lineComparison` - contains values for the keys `THIS_LINE`, `THIS_CONTRIBUTOR`, `OTHER_LINE` and `OTHER_CONTRIBUTOR`
Returns:
  Regions of `THIS_LINE` to be ignored for comparison purposes.

#### isEnabledInitially

    boolean isEnabledInitially()

Returns whether the filter should be enabled when first initialized

Returns:
  default enablement

#### canCacheFilteredRegions

    boolean canCacheFilteredRegions()

Because the comparison routine may compare each line multiple times to other lines, the ignored regions may need to be calculated multiple times for the same line during a comparison. If the ignored regions for each line will be the same regardless of what line it is being compared to, returning `true` to this method will cause the ignored region calculations to be re-used and improve the performance of the comparison.

Returns:
  ignored region results can be cached