Class CodeReplacement

java.lang.Object
com.google.javascript.refactoring.CodeReplacement
All Implemented Interfaces:
Comparable<CodeReplacement>

@Immutable public abstract class CodeReplacement extends Object implements Comparable<CodeReplacement>
Class that represents a set of changes to make to the code.
  • Constructor Details

    • CodeReplacement

      public CodeReplacement()
  • Method Details

    • getStartPosition

      public abstract int getStartPosition()
      Returns the start position within the file that the modification should be applied starting at.
    • getLength

      public abstract int getLength()
      Returns how many characters the new content should replace in the original content.
    • getEndPosition

      public int getEndPosition()
      Returns the end position within the file that the modification should be applied starting at.
    • getNewContent

      public abstract String getNewContent()
      Returns the new content that should be inserted into the file.
    • compareTo

      public final int compareTo(CodeReplacement x)
      Specified by:
      compareTo in interface Comparable<CodeReplacement>