Class Diff.Change

java.lang.Object
org.openstreetmap.josm.tools.Diff.Change
Enclosing class:
Diff

public static class Diff.Change extends Object
The result of comparison is an "edit script": a chain of change objects. Each change represents one place where some lines are deleted and some are inserted. LINE0 and LINE1 are the first affected lines in the two files (origin 0). DELETED is the number of lines deleted here from file 0. INSERTED is the number of lines inserted here in file 1. If DELETED is 0 then LINE0 is the number of the line before which the insertion was done; vice versa for INSERTED and LINE1.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    # lines of file 0 changed here.
    final int
    # lines of file 1 changed here.
    final int
    Line number of 1st deleted line.
    final int
    Line number of 1st inserted line.
    Previous or next edit command.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Change(int line0, int line1, int deleted, int inserted, Diff.Change old)
    Cons an additional entry onto the front of an edit script OLD.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the number of insertions and deletions of this change as well as (recursively) the changes linked via link.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • inserted

      public final int inserted
      # lines of file 1 changed here.
    • deleted

      public final int deleted
      # lines of file 0 changed here.
    • line0

      public final int line0
      Line number of 1st deleted line.
    • line1

      public final int line1
      Line number of 1st inserted line.
  • Constructor Details

    • Change

      public Change(int line0, int line1, int deleted, int inserted, Diff.Change old)
      Cons an additional entry onto the front of an edit script OLD. LINE0 and LINE1 are the first affected lines in the two files (origin 0). DELETED is the number of lines deleted here from file 0. INSERTED is the number of lines inserted here in file 1.

      If DELETED is 0 then LINE0 is the number of the line before which the insertion was done; vice versa for INSERTED and LINE1.

      Parameters:
      line0 - first affected lines in the two files (origin 0)
      line1 - first affected lines in the two files (origin 0)
      deleted - the number of lines deleted here from file 0
      inserted - the number of lines inserted here in file 1
      old - edit script
  • Method Details

    • getTotalNumberOfChanges

      Returns the number of insertions and deletions of this change as well as (recursively) the changes linked via link.
      Returns:
      recursive number of insertions and deletions
    • toString

      public String toString()
      Overrides:
      toString in class Object