Class RangeDifferencer
java.lang.Object
org.eclipse.compare.rangedifferencer.RangeDifferencer
A
RangeDifferencer
finds the differences between two or three IRangeComparator
s.
To use the differencer, clients provide an IRangeComparator
that breaks their input data into a sequence of comparable entities. The differencer
returns the differences among these sequences as an array of RangeDifference
objects
(findDifferences
methods).
Every RangeDifference
represents a single kind of difference
and the corresponding ranges of the underlying comparable entities in the
left, right, and optionally ancestor sides.
Alternatively, the findRanges
methods not only return objects for
the differing ranges but for non-differing ranges too.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic RangeDifference[]
findDifferences
(AbstractRangeDifferenceFactory factory, IProgressMonitor pm, IRangeComparator left, IRangeComparator right) Finds the differences between twoIRangeComparator
s.static RangeDifference[]
findDifferences
(AbstractRangeDifferenceFactory factory, IProgressMonitor pm, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s.static RangeDifference[]
findDifferences
(IRangeComparator left, IRangeComparator right) Finds the differences between twoIRangeComparator
s.static RangeDifference[]
findDifferences
(IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s.static RangeDifference[]
findDifferences
(IProgressMonitor pm, IRangeComparator left, IRangeComparator right) Finds the differences between twoIRangeComparator
s.static RangeDifference[]
findDifferences
(IProgressMonitor pm, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s.static RangeDifference[]
findRanges
(AbstractRangeDifferenceFactory factory, IProgressMonitor pm, IRangeComparator left, IRangeComparator right) Finds the differences among twoIRangeComparator
s.static RangeDifference[]
findRanges
(AbstractRangeDifferenceFactory factory, IProgressMonitor pm, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s.static RangeDifference[]
findRanges
(IRangeComparator left, IRangeComparator right) Finds the differences among twoIRangeComparator
s.static RangeDifference[]
findRanges
(IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s.static RangeDifference[]
findRanges
(IProgressMonitor pm, IRangeComparator left, IRangeComparator right) Finds the differences among twoIRangeComparator
s.static RangeDifference[]
findRanges
(IProgressMonitor pm, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s.
-
Method Details
-
findDifferences
Finds the differences between twoIRangeComparator
s. The differences are returned as an array ofRangeDifference
s. If no differences are detected an empty array is returned.- Parameters:
left
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences, or an empty array if no differences were found
-
findDifferences
public static RangeDifference[] findDifferences(IProgressMonitor pm, IRangeComparator left, IRangeComparator right) Finds the differences between twoIRangeComparator
s. The differences are returned as an array ofRangeDifference
s. If no differences are detected an empty array is returned.- Parameters:
pm
- if notnull
used to report progressleft
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences, or an empty array if no differences were found
- Since:
- 2.0
-
findDifferences
public static RangeDifference[] findDifferences(AbstractRangeDifferenceFactory factory, IProgressMonitor pm, IRangeComparator left, IRangeComparator right) Finds the differences between twoIRangeComparator
s. The differences are returned as an array ofRangeDifference
s. If no differences are detected an empty array is returned.- Parameters:
factory
- factory to instantiate newRangeDifference
spm
- if notnull
used to report progressleft
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences, or an empty array if no differences were found
- Since:
- org.eclipse.compare.core 3.5
-
findDifferences
public static RangeDifference[] findDifferences(IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s. The differences are returned as a list ofRangeDifference
s. If no differences are detected an empty list is returned. If the ancestor range comparator isnull
, a two-way comparison is performed.- Parameters:
ancestor
- the ancestor range comparator ornull
left
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences, or an empty array if no differences were found
-
findDifferences
public static RangeDifference[] findDifferences(IProgressMonitor pm, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s. The differences are returned as a list ofRangeDifference
s. If no differences are detected an empty list is returned. If the ancestor range comparator isnull
, a two-way comparison is performed.- Parameters:
pm
- if notnull
used to report progressancestor
- the ancestor range comparator ornull
left
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences, or an empty array if no differences were found
- Since:
- 2.0
-
findDifferences
public static RangeDifference[] findDifferences(AbstractRangeDifferenceFactory factory, IProgressMonitor pm, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s. The differences are returned as a list ofRangeDifference
s. If no differences are detected an empty list is returned. If the ancestor range comparator isnull
, a two-way comparison is performed.- Parameters:
factory
- factory to instantiate newRangeDifference
spm
- if notnull
used to report progressancestor
- the ancestor range comparator ornull
left
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences, or an empty array if no differences were found
- Since:
- org.eclipse.compare.core 3.5
-
findRanges
Finds the differences among twoIRangeComparator
s. In contrast tofindDifferences
, the result containsRangeDifference
elements for non-differing ranges too.- Parameters:
left
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences
-
findRanges
public static RangeDifference[] findRanges(IProgressMonitor pm, IRangeComparator left, IRangeComparator right) Finds the differences among twoIRangeComparator
s. In contrast tofindDifferences
, the result containsRangeDifference
elements for non-differing ranges too.- Parameters:
pm
- if notnull
used to report progressleft
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences
- Since:
- 2.0
-
findRanges
public static RangeDifference[] findRanges(AbstractRangeDifferenceFactory factory, IProgressMonitor pm, IRangeComparator left, IRangeComparator right) Finds the differences among twoIRangeComparator
s. In contrast tofindDifferences
, the result containsRangeDifference
elements for non-differing ranges too.- Parameters:
factory
- factory to instantiate newRangeDifference
spm
- if notnull
used to report progressleft
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences
- Since:
- org.eclipse.compare.core 3.5
-
findRanges
public static RangeDifference[] findRanges(IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s. In contrast tofindDifferences
, the result containsRangeDifference
elements for non-differing ranges too. If the ancestor range comparator isnull
, a two-way comparison is performed.- Parameters:
ancestor
- the ancestor range comparator ornull
left
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences
-
findRanges
public static RangeDifference[] findRanges(IProgressMonitor pm, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s. In contrast tofindDifferences
, the result containsRangeDifference
elements for non-differing ranges too. If the ancestor range comparator isnull
, a two-way comparison is performed.- Parameters:
pm
- if notnull
used to report progressancestor
- the ancestor range comparator ornull
left
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences
- Since:
- 2.0
-
findRanges
public static RangeDifference[] findRanges(AbstractRangeDifferenceFactory factory, IProgressMonitor pm, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) Finds the differences among threeIRangeComparator
s. In contrast tofindDifferences
, the result containsRangeDifference
elements for non-differing ranges too. If the ancestor range comparator isnull
, a two-way comparison is performed.- Parameters:
factory
- factory to instantiate newRangeDifference
spm
- if notnull
used to report progressancestor
- the ancestor range comparator ornull
left
- the left range comparatorright
- the right range comparator- Returns:
- an array of range differences
- Since:
- org.eclipse.compare.core 3.5
-