Package ghidra.util

Class StringDiff


  • public class StringDiff
    extends java.lang.Object
    Container object that holds a start and end position within a string. A list of StringDiffs is used to keep track of changes made to a string.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String insertData
      String being inserted.
      int pos1
      Start position of the string.
      int pos2
      End position of the string used when part of the string is replaced.
    • Constructor Summary

      Constructors 
      Constructor Description
      StringDiff​(int pos1, int pos2)
      Construct a new StringDiff that indicates text was deleted from pos1 to pos2.
      StringDiff​(int pos1, int pos2, java.lang.String data)
      Construct a new StringDiff that indicates given data is inserted from pos1 to pos2.
      StringDiff​(int pos, java.lang.String insertData)
      Construct a new StringDiff that indicates that insertData was inserted at pos.
      StringDiff​(java.lang.String replaceData)
      Construct a new StringDiff with pos1 and pos2 are initialized to -1.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • pos1

        public int pos1
        Start position of the string.
      • pos2

        public int pos2
        End position of the string used when part of the string is replaced.
      • insertData

        public java.lang.String insertData
        String being inserted.
    • Constructor Detail

      • StringDiff

        public StringDiff​(java.lang.String replaceData)
        Construct a new StringDiff with pos1 and pos2 are initialized to -1.
        Parameters:
        replaceData - string
      • StringDiff

        public StringDiff​(int pos1,
                          int pos2)
        Construct a new StringDiff that indicates text was deleted from pos1 to pos2.
        Parameters:
        pos1 - position 1 for the diff
        pos2 - position 2 for the diff
      • StringDiff

        public StringDiff​(int pos,
                          java.lang.String insertData)
        Construct a new StringDiff that indicates that insertData was inserted at pos.
        Parameters:
        pos - position where the insertData was inserted
        insertData - inserted string
      • StringDiff

        public StringDiff​(int pos1,
                          int pos2,
                          java.lang.String data)
        Construct a new StringDiff that indicates given data is inserted from pos1 to pos2.
        Parameters:
        pos1 - position 1
        pos2 - position 2
        data - data the replaces string data
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object