Class 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)
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TwoColumnDiff.Item  
    • Constructor Summary

      Constructors 
      Constructor Description
      TwoColumnDiff​(java.lang.Object[] reference, java.lang.Object... current)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void diff()  
      private void twoColumnDiffFromScript​(Diff.Change script, java.lang.Object[] a, java.lang.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait