org.openstreetmap.josm.gui.history
Class TwoColumnDiff
java.lang.Object
org.openstreetmap.josm.gui.history.TwoColumnDiff
class TwoColumnDiff
- extends java.lang.Object
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)
Constructor Summary |
TwoColumnDiff(java.lang.Object[] reference,
java.lang.Object[] current)
The arguments will _not_ be modified |
Method Summary |
private void |
diff()
|
private void |
twoColumnDiffFromScript(Diff.change script,
java.lang.Object[] a,
java.lang.Object[] b)
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
referenceDiff
public java.util.ArrayList<TwoColumnDiff.Item> referenceDiff
currentDiff
public java.util.ArrayList<TwoColumnDiff.Item> currentDiff
reference
java.lang.Object[] reference
current
java.lang.Object[] current
TwoColumnDiff
public TwoColumnDiff(java.lang.Object[] reference,
java.lang.Object[] current)
- The arguments will _not_ be modified
diff
private void diff()
twoColumnDiffFromScript
private void twoColumnDiffFromScript(Diff.change script,
java.lang.Object[] a,
java.lang.Object[] b)
- 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.
JOSM