Interface Document

  • All Known Implementing Classes:
    DocumentFile

    public interface Document
    Represents a file which contains programming code that will be fixed.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void delete​(RegionByLine regionByOffset)
      Delete a region in the document, removing all text which contains it.
      void insert​(int beginLine, int beginColumn, String textToInsert)
      Insert a text at a line at the position/column specified.
      void replace​(RegionByLine regionByOffset, String textToReplace)
      Replace a specific region in the document which contains text by another text, which not necessarily is the same length as the region's one.
    • Method Detail

      • insert

        void insert​(int beginLine,
                    int beginColumn,
                    String textToInsert)
        Insert a text at a line at the position/column specified. If there is any text to the right of the insertion, that text is shifted by the length of the text to insert, which means that it is not replaced.
        Parameters:
        beginLine - the line in which to insert the text
        beginColumn - the position in the line in which to insert the text
        textToInsert - the text to be added
      • replace

        void replace​(RegionByLine regionByOffset,
                     String textToReplace)
        Replace a specific region in the document which contains text by another text, which not necessarily is the same length as the region's one.
        Parameters:
        regionByOffset - the region in which a text will be inserted to replace the current document's contents
        textToReplace - the text to insert
      • delete

        void delete​(RegionByLine regionByOffset)
        Delete a region in the document, removing all text which contains it. If there is any text to the right of this region, it will be shifted to the left by the length of the region to delete.
        Parameters:
        regionByOffset - the region in which to erase all the text