Package ghidra.program.database.code
Class StringDiff
- java.lang.Object
-
- ghidra.program.database.code.StringDiff
-
public class StringDiff extends java.lang.ObjectContainer 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.StringtextString being inserted.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringDiffallTextReplaced(java.lang.String newText)Construct a new StringDiff with pos1 and pos2 are initialized to -1booleanequals(java.lang.Object obj)inthashCode()static StringDiffrestore(java.lang.String text, int start, int end)static StringDifftextDeleted(int start, int end)Construct a new StringDiff that indicates text was deleted from pos1 to pos2static StringDifftextInserted(java.lang.String newText, int start)Construct a new StringDiff that indicates that insertData was inserted at the given positionjava.lang.StringtoString()
-
-
-
Method Detail
-
allTextReplaced
public static StringDiff allTextReplaced(java.lang.String newText)
Construct a new StringDiff with pos1 and pos2 are initialized to -1- Parameters:
newText- string- Returns:
- the new diff
-
textDeleted
public static StringDiff textDeleted(int start, int end)
Construct a new StringDiff that indicates text was deleted from pos1 to pos2- Parameters:
start- position 1 for the diffend- position 2 for the diff- Returns:
- the new diff
-
textInserted
public static StringDiff textInserted(java.lang.String newText, int start)
Construct a new StringDiff that indicates that insertData was inserted at the given position- Parameters:
newText- inserted stringstart- position where the text was inserted- Returns:
- the new diff
-
restore
public static StringDiff restore(java.lang.String text, int start, int end)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-