[Java] Class SourceBuffer
- org.codehaus.groovy.antlr.SourceBuffer
A simple buffer that provides line/col access to chunks of source code held within itself.
- Authors:
- Jeremy Rayner
Constructor Summary
| Constructor and description | 
|---|
| SourceBuffer
                                () | 
Methods Summary
| Type Params | Return Type | Name and description | 
|---|---|---|
| String | getSnippet(LineColumn start, LineColumn end)Obtains a snippet of the source code within the bounds specified | |
| void | write(int c)Writes the specified character into the buffer | 
Inherited Methods Summary
| Methods inherited from class | Name | 
|---|---|
| class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll | 
Constructor Detail
public SourceBuffer()
Method Detail
public String getSnippet(LineColumn start, LineColumn end)
Obtains a snippet of the source code within the bounds specified
- Parameters:
- 
start- (inclusive line/ inclusive column)
- 
end- (inclusive line / exclusive column)
- Returns:
- specified snippet of source code as a String, or null if no source available
public void write(int c)
Writes the specified character into the buffer
- Parameters:
- c
    © 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
    https://docs.groovy-lang.org/2.4.21/html/gapi/org/codehaus/groovy/antlr/SourceBuffer.html