Class TwoColumnDiff
java.lang.Object
org.openstreetmap.josm.gui.history.TwoColumnDiff
Produces a "two column diff" of two lists. (same as diff -y)
Each list is annotated with the changes relative to the other, and "empty" cells are inserted so the lists are comparable item by item.
diff on [1 2 3 4] [1 a 4 5] yields:
item(SAME, 1) item(SAME, 1)
item(CHANGED, 2) item(CHANGED, 2)
item(DELETED, 3) item(EMPTY)
item(SAME, 4) item(SAME, 4)
item(EMPTY) item(INSERTED, 5)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voiddiff()private voidtwoColumnDiffFromScript(Diff.Change script, Object[] a, Object[] b, boolean reversed) The result from the diff algorithm is a "script" (a compressed description of the changes) This method expands this script into a full two column description.
-
Field Details
-
referenceDiff
-
currentDiff
-
reference
-
current
-
referenceReversed
boolean referenceReversed
-
-
Constructor Details
-
TwoColumnDiff
TwoColumnDiff(Object[] reference, Object... current)
-
-
Method Details
-
diff
-
twoColumnDiffFromScript
The result from the diff algorithm is a "script" (a compressed description of the changes) This method expands this script into a full two column description.- Parameters:
script- diff scripta- reference versionb- current versionreversed- iftrueuseTwoColumnDiff.Item.DiffItemType.REVERSEDinstead ofTwoColumnDiff.Item.DiffItemType.SAME
-