|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.alkacon.diff.rangedifferencer.RangeDifferencer
public final class RangeDifferencer
A RangeDifferencer finds the differences between two or three IRangeComparators.
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.
The algorithm used is an objectified version of one described in:
org.eclipse.jface.util.Assert
and org.eclipse.core.runtime.IProgressMonitor have been removed.
The progress monitor is not used anyway, and the assert method has been inlined.
The source code has been reformatted and checkstyle / findbugs warnings where removed (AK).
I_RangeComparator,
RangeDifference| Method Summary | |
|---|---|
static boolean |
assertIsTrue(boolean expression)
Asserts that the given boolean is true. |
static RangeDifference[] |
findDifferences(I_RangeComparator left,
I_RangeComparator right)
Finds the differences between two IRangeComparators. |
static RangeDifference[] |
findDifferences(I_RangeComparator ancestor,
I_RangeComparator left,
I_RangeComparator right)
Finds the differences among three IRangeComparators. |
static RangeDifference[] |
findRanges(I_RangeComparator left,
I_RangeComparator right)
Finds the differences among two IRangeComparators. |
static RangeDifference[] |
findRanges(I_RangeComparator ancestor,
I_RangeComparator left,
I_RangeComparator right)
Finds the differences among three IRangeComparators. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean assertIsTrue(boolean expression)
true. If this
is not the case, some kind of unchecked exception is thrown.
expression - the outcome of the check
true if the check passes (does not return
if the check fails)
public static RangeDifference[] findDifferences(I_RangeComparator left,
I_RangeComparator right)
IRangeComparators.
The differences are returned as an array of RangeDifferences.
If no differences are detected an empty array is returned.
left - the left range comparatorright - the right range comparator
public static RangeDifference[] findDifferences(I_RangeComparator ancestor,
I_RangeComparator left,
I_RangeComparator right)
IRangeComparators.
The differences are returned as a list of RangeDifferences.
If no differences are detected an empty list is returned.
If the ancestor range comparator is null, a two-way
comparison is performed.
ancestor - the ancestor range comparator or nullleft - the left range comparatorright - the right range comparator
public static RangeDifference[] findRanges(I_RangeComparator left,
I_RangeComparator right)
IRangeComparators.
In contrast to findDifferences, the result
contains RangeDifference elements for non-differing ranges too.
left - the left range comparatorright - the right range comparator
public static RangeDifference[] findRanges(I_RangeComparator ancestor,
I_RangeComparator left,
I_RangeComparator right)
IRangeComparators.
In contrast to findDifferences, the result
contains RangeDifference elements for non-differing ranges too.
If the ancestor range comparator is null, a two-way
comparison is performed.
ancestor - the ancestor range comparator or nullleft - the left range comparatorright - the right range comparator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||