org.sonar.sslr.internal.matchers
Class ImmutableInputBuffer

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

public class ImmutableInputBuffer
extends Object
implements InputBuffer


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.sonar.sslr.internal.matchers.InputBuffer
InputBuffer.Position
 
Constructor Summary
ImmutableInputBuffer(char[] buffer)
           
 
Method Summary
 char charAt(int i)
           
 String extractLine(int lineNumber)
          Returns content of a line for a given line number.
 int getLineCount()
          Returns number of lines, which is always equal to number of line terminators plus 1.
 InputBuffer.Position getPosition(int index)
           
 int length()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImmutableInputBuffer

public ImmutableInputBuffer(char[] buffer)
Method Detail

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


Copyright © 2009-2014 SonarSource. All Rights Reserved.