Package ghidra.program.util
Class CommentFieldLocation
java.lang.Object
ghidra.program.util.ProgramLocation
ghidra.program.util.CodeUnitLocation
ghidra.program.util.CommentFieldLocation
- All Implemented Interfaces:
- Cloneable,- Comparable<ProgramLocation>
- Direct Known Subclasses:
- AutomaticCommentFieldLocation,- BlockStartLocation,- EolCommentFieldLocation,- MemoryBlockStartFieldLocation,- PlateFieldLocation,- PostCommentFieldLocation,- RefRepeatCommentFieldLocation,- RepeatableCommentFieldLocation
The 
CommentFieldLocation class contains specific location information
 within the COMMENTS field of a CodeUnitLocation object.- 
Field SummaryFieldsFields inherited from class ghidra.program.util.ProgramLocationaddr, program, refAddr
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor needed for restoring a comment field location from XML.CommentFieldLocation(Program program, Address addr, int[] componentPath, String[] comment, CommentType type, int row, int charOffset) Construct a new CommentFieldLocation.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanString[]Returns the array of strings that make up the comment.Returns the comment type or null if no-comment..inthashCode()voidrestoreState(Program p, SaveState obj) Restore this program location using the given program and save state object.voidSave this program location to the given save state object.toString()Returns a String representation of this location.Methods inherited from class ghidra.program.util.CodeUnitLocationisValidMethods inherited from class ghidra.program.util.ProgramLocationclone, compareAddr, compareTo, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow, getTranslatedCopy
- 
Field Details- 
comment
- 
type
 
- 
- 
Constructor Details- 
CommentFieldLocationpublic CommentFieldLocation(Program program, Address addr, int[] componentPath, String[] comment, CommentType type, int row, int charOffset) Construct a new CommentFieldLocation.- Parameters:
- program- the program of the location
- addr- address of the location; should not be null hierarchy names; this parameter may be null
- componentPath- if not null, it is the array of indexes that point to a specific data type inside of another data type
- comment- The array of strings that make up the comment
- type- The type of this comment (null for no-comment type)
- row- The index of the string that contains the exact location.
- charOffset- The position within the string that specifies the exact location.
- Throws:
- IllegalArgumentException- Thrown if type is not one of the comment values given in- CodeUnit
 
- 
CommentFieldLocationpublic CommentFieldLocation()Default constructor needed for restoring a comment field location from XML.
 
- 
- 
Method Details- 
getCommentReturns the array of strings that make up the comment.- Returns:
- the comment
 
- 
getCommentTypeReturns the comment type or null if no-comment..- Returns:
- the comment type or null if no-comment.
 
- 
toStringReturns a String representation of this location.- Overrides:
- toStringin class- ProgramLocation
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- ProgramLocation
 
- 
equals- Overrides:
- equalsin class- ProgramLocation
 
- 
saveStateDescription copied from class:ProgramLocationSave this program location to the given save state object.- Overrides:
- saveStatein class- ProgramLocation
- Parameters:
- obj- the save state object for saving the location
 
- 
restoreStateDescription copied from class:ProgramLocationRestore this program location using the given program and save state object.- Overrides:
- restoreStatein class- ProgramLocation
- Parameters:
- p- program to restore from
- obj- the save state to restore from
 
 
-