Package ghidra.program.util
Class CommentFieldLocation
- java.lang.Object
- 
- ghidra.program.util.ProgramLocation
- 
- ghidra.program.util.CodeUnitLocation
- 
- ghidra.program.util.CommentFieldLocation
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Comparable<ProgramLocation>
 - Direct Known Subclasses:
- AutomaticCommentFieldLocation,- BlockStartLocation,- EolCommentFieldLocation,- MemoryBlockStartFieldLocation,- PlateFieldLocation,- PostCommentFieldLocation,- RefRepeatCommentFieldLocation,- RepeatableCommentFieldLocation
 
 public class CommentFieldLocation extends CodeUnitLocation TheCommentFieldLocationclass contains specific location information within the COMMENTS field of a CodeUnitLocation object.
- 
- 
Constructor SummaryConstructors Constructor Description CommentFieldLocation()Default constructor needed for restoring a comment field location from XML.CommentFieldLocation(Program program, Address addr, int[] componentPath, java.lang.String[] comment, int type, int row, int charOffset)Construct a new CommentFieldLocation.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.String[]getComment()Returns the array of strings that make up the comment.intgetCommentType()Returns the comment type.inthashCode()voidrestoreState(Program p, SaveState obj)Restore this program location using the given program and save state object.voidsaveState(SaveState obj)Save this program location to the given save state object.java.lang.StringtoString()Returns a String representation of this location.protected voidvalidateType()Checks that the type is a valid comment type.- 
Methods inherited from class ghidra.program.util.CodeUnitLocationisValid
 - 
Methods inherited from class ghidra.program.util.ProgramLocationcompareAddr, compareTo, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow
 
- 
 
- 
- 
- 
Constructor Detail- 
CommentFieldLocationpublic CommentFieldLocation(Program program, Address addr, int[] componentPath, java.lang.String[] comment, int type, int row, int charOffset) Construct a new CommentFieldLocation.- Parameters:
- 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. Can be either CodeUnit.PRE_COMMENT, CodeUnit.POST_COMMENT, CodeUnit.PLATE_COMMENT, CodeUnit.EOL_COMMENT, or CodeUnit.REPEATABLE_COMMENT.
- row- The index of the string that contains the exact location.
- charOffset- The position within the string that specifies the exact location.
- Throws:
- java.lang.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 Detail- 
validateTypeprotected void validateType() Checks that the type is a valid comment type.- Throws:
- java.lang.IllegalArgumentException- if this doesn't have a valid comment type.
 
 - 
getCommentpublic java.lang.String[] getComment() Returns the array of strings that make up the comment.
 - 
getCommentTypepublic int getCommentType() Returns the comment type. The type is either CodeUnit.EOL_COMMENT, CodeUnit.POST_COMMENT, CodeUnit.PLATE_COMMENT, CodeUnit.PRE_COMMENT, or CodeUnit.REPEATABLE_COMMENT.
 - 
toStringpublic java.lang.String toString() Returns a String representation of this location.- Overrides:
- toStringin class- ProgramLocation
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- ProgramLocation
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- ProgramLocation
 
 - 
saveStatepublic void saveState(SaveState obj) Description 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
 
 - 
restoreStatepublic void restoreState(Program p, SaveState obj) Description copied from class:ProgramLocationRestore this program location using the given program and save state object.- Overrides:
- restoreStatein class- ProgramLocation
 
 
- 
 
-