Module jamal.api

Interface Input

  • All Superinterfaces:
    java.lang.CharSequence

    public interface Input
    extends java.lang.CharSequence
    An input has a string builder and also a file name from where the input is coming from. The string builder is used to fetch the characters. The reference file name is used to construct the name of the files in case a macro like import or include needs to open another file.
    • Method Detail

      • getSB

        java.lang.StringBuilder getSB()
        Get the StringBuilder that contains the characters of the input. The processing many times works directly on the StringBuilder deleting characters from the start of it as the processing progresses, thus essentially modifying/mutating the Input object.
        Returns:
        the StringBuilder containing the characters of the input.
      • getPosition

        Position getPosition()
        Returns:
        the line reference that contains the line number and also the filename
      • getReference

        java.lang.String getReference()
        Returns:
        the reference file name that the input was read from
      • getLine

        int getLine()
        Returns:
        the current line number of the file where the input currently is in
      • getColumn

        int getColumn()
        Returns:
        the current column of the the line where the input currently is in
      • stepLine

        void stepLine()
        Step the line number by one and reset the column number to 1.
      • stepColumn

        void stepColumn()
        Step the column number by one.
      • length

        default int length()
        Specified by:
        length in interface java.lang.CharSequence
      • charAt

        default char charAt​(int index)
        Specified by:
        charAt in interface java.lang.CharSequence
      • delete

        default Input delete​(int start,
                             int end)
      • subSequence

        default java.lang.CharSequence subSequence​(int start,
                                                   int end)
        Specified by:
        subSequence in interface java.lang.CharSequence
      • append

        default Input append​(java.lang.Object obj)
      • reset

        default void reset()
      • indexOf

        default int indexOf​(java.lang.String str)
      • substring

        default java.lang.String substring​(int start,
                                           int end)
      • substring

        default java.lang.String substring​(int start)