Class ImmutableInputBuffer

java.lang.Object
org.sonar.sslr.internal.matchers.ImmutableInputBuffer
All Implemented Interfaces:
InputBuffer

public class ImmutableInputBuffer extends Object implements InputBuffer
  • Constructor Details

    • ImmutableInputBuffer

      public ImmutableInputBuffer(char[] buffer)
  • Method Details

    • length

      public int length()
      Specified by:
      length in interface InputBuffer
    • charAt

      public char charAt(int i)
      Specified by:
      charAt in interface InputBuffer
    • extractLine

      public String extractLine(int lineNumber)
      Description copied from interface: InputBuffer
      Returns content of a line for a given line number. Numbering of lines starts from 1.
      Specified by:
      extractLine in interface InputBuffer
    • getLineCount

      public int getLineCount()
      Description copied from interface: InputBuffer
      Returns number of lines, which is always equal to number of line terminators plus 1.
      Specified by:
      getLineCount in interface InputBuffer
    • getPosition

      public InputBuffer.Position getPosition(int index)
      Specified by:
      getPosition in interface InputBuffer