LibreOffice Module xmerge (master)
1
|
This is the. More...
Public Member Functions | |
Difference (int operation, int orgPosition, int modPosition) | |
Constructor. More... | |
int | getOperation () |
Get the operation of the. More... | |
int | getOrgPosition () |
Get the original. More... | |
int | getModPosition () |
Get the modified. More... | |
boolean | equals (Object obj) |
Two. More... | |
int | hashCode () |
String | debug () |
Display debug information. More... | |
String | toString () |
Returns position and operation values as a single string. More... | |
Static Public Attributes | |
static final int | ADD = 1 |
Add operation. More... | |
static final int | DELETE = 2 |
Delete operation. More... | |
static final int | CHANGE = 3 |
Change operation. More... | |
static final int | UNCHANGE = 4 |
Unchange operation (i.e. More... | |
Private Attributes | |
final int | operation |
The action of the diff - either ADD or DELETE. More... | |
final int | orgPosition |
The position of the content that should be operated on (original. More... | |
final int | modPosition |
The position of the content that should be operated (modified iterator). More... | |
This is the.
basic unit.
Used by the
as a set of difference between two
(the original and modified
).
Definition at line 27 of file Difference.java.
|
inline |
Constructor.
This is the standard way to create a
object.
operation | Either ADD or DELETE. |
orgPosition | The position in the original (first) Iterator
|
modPosition | The position in the modified (second) Iterator
|
Definition at line 120 of file Difference.java.
References org.openoffice.xmerge.merger.Difference.modPosition, org.openoffice.xmerge.merger.Difference.operation, and org.openoffice.xmerge.merger.Difference.orgPosition.
Referenced by org.openoffice.xmerge.merger.Difference.equals().
|
inline |
Display debug information.
Definition at line 188 of file Difference.java.
References String.
Referenced by org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.merge(), org.openoffice.xmerge.converter.xml.xslt.DocumentMergerImpl.merge(), and org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.merge().
|
inline |
Two.
objects will equal if and only if all
,
,
and
are equal.
obj |
Definition at line 165 of file Difference.java.
References org.openoffice.xmerge.merger.Difference.Difference(), org.openoffice.xmerge.merger.Difference.modPosition, org.openoffice.xmerge.merger.Difference.operation, and org.openoffice.xmerge.merger.Difference.orgPosition.
|
inline |
Get the modified.
position.
Definition at line 151 of file Difference.java.
References org.openoffice.xmerge.merger.Difference.modPosition.
Referenced by org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.coreMerge().
|
inline |
Get the operation of the.
.
Definition at line 133 of file Difference.java.
References org.openoffice.xmerge.merger.Difference.operation.
|
inline |
Get the original.
position.
Definition at line 142 of file Difference.java.
References org.openoffice.xmerge.merger.Difference.orgPosition.
Referenced by org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.applyDifference(), and org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.coreMerge().
|
inline |
Definition at line 179 of file Difference.java.
|
inline |
Returns position and operation values as a single string.
Definition at line 219 of file Difference.java.
References org.openoffice.xmerge.merger.Difference.operation, and String.
|
static |
Add operation.
Definition at line 30 of file Difference.java.
Referenced by org.openoffice.xmerge.merger.merge.DocumentMerge.applyDifference(), org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.applyDifference(), org.openoffice.xmerge.merger.diff.IteratorRowCompare.computeDiffs(), org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.coreMerge(), org.openoffice.xmerge.merger.diff.CharArrayLCSAlgorithm.generateResult(), and org.openoffice.xmerge.merger.diff.IteratorLCSAlgorithm.generateResult().
|
static |
Change operation.
Definition at line 36 of file Difference.java.
Referenced by org.openoffice.xmerge.merger.merge.DocumentMerge.applyDifference(), org.openoffice.xmerge.merger.diff.IteratorRowCompare.computeDiffs(), org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.coreMerge(), org.openoffice.xmerge.merger.diff.CharArrayLCSAlgorithm.generateResult(), and org.openoffice.xmerge.merger.diff.IteratorLCSAlgorithm.generateResult().
|
static |
Delete operation.
Definition at line 33 of file Difference.java.
Referenced by org.openoffice.xmerge.merger.merge.DocumentMerge.applyDifference(), org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.applyDifference(), org.openoffice.xmerge.merger.diff.IteratorRowCompare.computeDiffs(), org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.coreMerge(), org.openoffice.xmerge.merger.diff.CharArrayLCSAlgorithm.generateResult(), and org.openoffice.xmerge.merger.diff.IteratorLCSAlgorithm.generateResult().
|
private |
The position of the content that should be operated (modified iterator).
For explanation and examples, see orgPosition
.
Definition at line 109 of file Difference.java.
Referenced by org.openoffice.xmerge.merger.Difference.Difference(), org.openoffice.xmerge.merger.Difference.equals(), and org.openoffice.xmerge.merger.Difference.getModPosition().
|
private |
The action of the diff - either ADD or DELETE.
Definition at line 42 of file Difference.java.
Referenced by org.openoffice.xmerge.merger.Difference.Difference(), org.openoffice.xmerge.merger.Difference.equals(), org.openoffice.xmerge.merger.Difference.getOperation(), and org.openoffice.xmerge.merger.Difference.toString().
|
private |
The position of the content that should be operated on (original.
).
For
, the
is the position of the original sequence where the diff will insert (the element count is starting from 0, and always insert before the element). The
is the position of the diff in the modified sequence (also starting from 0).
{ example:diff - and note: is original sequence and is the modified one.and here is the position of those sequence: 0 1 0 1 2 3 4 5result: <diff orgpos="0" modpos="0" operation="ADD"> <-- element A <diff orgpos="1" modpos="2" operation="ADD"> <-- element C <diff orgpos="2" modpos="4" operation="ADD"> <-- element E <diff orgpos="2" modpos="5" operation="ADD"> <-- element F}
One can notice the add operation is inserted before the position. Hence, in order to append an element, we will have a position of original sequence length + 1 to denote an append.
For,
is the position that the element will be deleted (starting from 0) and
is the position where the deleted element should be (consider as an
).
Theis less useful and it is difficult to understand how the position is calculated. One can just skip this piece of information. It is useful if one wants to reverse the role of original sequence and modified sequence and find out the diff easily (just change add to delete and delete to add for operation and swap the
and
).
{ example:diff - and note: is original sequence and is the modified one.and here is the position of those sequence: 0 1 2 3 4 5 0 1result: <diff orgpos="0" modpos="0" operation="DELETE"> <-- element A <diff orgpos="2" modpos="1" operation="DELETE"> <-- element C <diff orgpos="4" modpos="2" operation="DELETE"> <-- element E <diff orgpos="5" modpos="2" operation="DELETE"> <-- element F}
Definition at line 102 of file Difference.java.
Referenced by org.openoffice.xmerge.merger.Difference.Difference(), org.openoffice.xmerge.merger.Difference.equals(), and org.openoffice.xmerge.merger.Difference.getOrgPosition().
|
static |
Unchange operation (i.e.
no change).
Definition at line 39 of file Difference.java.
Referenced by org.openoffice.xmerge.merger.merge.CharacterBaseParagraphMerge.coreMerge().