Class CommentFieldLocation

    • Field Detail

      • comment

        protected java.lang.String[] comment
      • type

        protected int type
    • Constructor Detail

      • CommentFieldLocation

        public CommentFieldLocation​(Program program,
                                    Address addr,
                                    int[] componentPath,
                                    java.lang.String[] comment,
                                    int 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. 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
      • CommentFieldLocation

        public CommentFieldLocation()
        Default constructor needed for restoring a comment field location from XML.
    • Method Detail

      • validateType

        protected void validateType()
        Checks that the type is a valid comment type.
        Throws:
        java.lang.IllegalArgumentException - if this doesn't have a valid comment type.
      • getComment

        public java.lang.String[] getComment()
        Returns the array of strings that make up the comment.
      • getCommentType

        public 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.
      • toString

        public java.lang.String toString()
        Returns a String representation of this location.
        Overrides:
        toString in class ProgramLocation
      • saveState

        public void saveState​(SaveState obj)
        Description copied from class: ProgramLocation
        Save this program location to the given save state object.
        Overrides:
        saveState in class ProgramLocation
        Parameters:
        obj - the save state object for saving the location
      • restoreState

        public void restoreState​(Program p,
                                 SaveState obj)
        Description copied from class: ProgramLocation
        Restore this program location using the given program and save state object.
        Overrides:
        restoreState in class ProgramLocation
        Parameters:
        p - program to restore from
        obj - the save state to restore from