|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.compare.structuremergeviewer.Differencer
A generic two-way or three-way differencing engine.
The engine is used by calling one of the findDifferences methods and passing in the objects to compare. The engine calls the following methods on the input objects to perform the compare:
Field Summary | |
static int | ADDITION
Difference constant (value 1) indicating one side was added. |
static int | CHANGE
Difference constant (value 3) indicating side changed. |
static int | CHANGE_TYPE_MASK
Bit mask (value 3) for extracting the kind of difference. |
static int | CONFLICTING
Three-way change constant (value 12) indicating a change on left and right sides. |
static int | DELETION
Difference constant (value 2) indicating one side was removed. |
static int | DIRECTION_MASK
Bit mask (value 12) for extracting the direction of a three-way change. |
static int | LEFT
Three-way change constant (value 4) indicating a change on left side. |
static int | NO_CHANGE
Difference constant (value 0) indicating no difference. |
static int | PSEUDO_CONFLICT
Constant (value 16) indicating a change on left and right side (with respect to ancestor) but left and right are identical. |
static int | RIGHT
Three-way change constant (value 8) indicating a change on right side. |
Constructor Summary | |
Differencer()
Creates a new differencing engine. |
Method Summary | |
protected boolean | contentsEqual(Object input1,
Object input2)
Performs a content compare on the two given inputs. |
Object | findDifferences(boolean threeWay,
IProgressMonitor pm,
Object data,
Object ancestor,
Object left,
Object right)
Starts the differencing engine on the three input objects. |
protected Object[] | getChildren(Object input)
Returns the children of the given input or null if there are no children. |
protected void | updateProgress(IProgressMonitor progressMonitor,
Object node)
Called for every leaf or node compare to update progress information. |
protected Object | visit(Object data,
int result,
Object ancestor,
Object left,
Object right)
Called for every node or leaf comparison. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NO_CHANGE
public static final int ADDITION
public static final int DELETION
public static final int CHANGE
public static final int CHANGE_TYPE_MASK
public static final int LEFT
public static final int RIGHT
public static final int CONFLICTING
public static final int DIRECTION_MASK
public static final int PSEUDO_CONFLICT
Constructor Detail |
public Differencer()
Method Detail |
public Object findDifferences(boolean threeWay, IProgressMonitor pm, Object data, Object ancestor, Object left, Object right)
protected Object visit(Object data, int result, Object ancestor, Object left, Object right)
The Differencer implementation returns a new DiffNode which is initialized with the corresponding values. Subclasses may override.
protected boolean contentsEqual(Object input1, Object input2)
The Differencer implementation returns true if both inputs implement IStreamContentAccessor and their byte contents is identical. Subclasses may override to implement a different content compare on the given inputs.
protected Object[] getChildren(Object input)
The Differencer implementation checks whether the input implements the IStructureComparator interface. If yes it is used to return an array containing all children. Otherwise null is returned. Subclasses may override to implement a different strategy to enumerate children.
protected void updateProgress(IProgressMonitor progressMonitor, Object node)
The Differencer implementation shows the name of the input object as a subtask. Subclasses may override.
|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.