Skip to main content
summaryrefslogtreecommitdiffstats
blob: b0cc1b33d83fe7dec83db268fbed00984ac7010a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="Author" content="IBM">
   <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
   <title>Package-level Javadoc</title>
</head>
<body>
Provides support for finding and displaying the differences
between hierarchically structured data.
<h2>
Package Specification</h2>
The class <tt>Differencer</tt> is a differencing engine for hierarchically
structured data. It takes two or three inputs and performs a two-way or
three-way compare on them.
<p>If the input elements to the differencing engine implement the <tt>IStructureComparator</tt>
interface the engine recursively applies itself&nbsp; to the children of
the input element. Leaf elements must implement the <tt>IStreamContentAccessor</tt>
interface (see package <tt>org.eclipse.compare</tt>) so that the
differencer can perform a bytewise comparison on them.
<p>By default the differencing engine returns the result of the compare
as a tree of <tt>DiffNode</tt> objects. Every <tt>DiffNode</tt> describes
the changes among the two or three inputs.
<p>A tree of <tt>DiffNodes</tt> can be displayed in a <tt>DiffTreeViewer</tt>.
The <tt>DiffTreeViewer</tt> requires that inner nodes of the tree implement
the <tt>IDiffContainer</tt> interface and leafs the <tt>IDiffElement</tt>
interface.
<p>The typical steps to compare hierarchically structured data and to display
the differences would be to:
<ul>
<li>
map the input data into a tree of <tt>IStructureComparator</tt> and <tt>IStreamContentAccessor</tt>s,</li>

<li>
perform the compare operation by means of the <tt>Differencer</tt>, and</li>

<li>
feed the differencing result into the <tt>DiffTreeViewer</tt>.</li>

</ul>
The <tt>StructureDiffViewer</tt> is a specialized <tt>DiffTreeViewer</tt>
that automates the three steps from above. It takes a single input object
of type <tt>ICompareInput</tt> from which it retrieves the two or three
input elements to compare. Then it uses a <tt>IStructureCreator</tt> to
extract a tree of <tt>IStructureComparator</tt> and <tt>IStreamContentAccessor</tt>
from them. These trees are then compared with the differencing engine and
the result is displayed in the tree viewer.
</body>
</html>

Back to the top