Package ghidra.util
Class StringDiff
- java.lang.Object
-
- ghidra.util.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()
-
-
-
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 diffpos2
- 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 insertedinsertData
- 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 1pos2
- position 2data
- data the replaces string data
-
-