<!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 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> |