Top Description Fields Constructors Methods
org.codehaus.groovy.antlr

public Class SourceBuffer

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List

A simple buffer that provides line/col access to chunks of source code held within itself.

Field Summary

Modifier and TypeField and Description
private StringBuilder
private final List<StringBuilder>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

specified snippet of source code as a String, or null if no source available
getSnippet
(LineColumn
(inclusive line / inclusive column)
start
,
LineColumn
(inclusive line / exclusive column)
end
)

Obtains a snippet of the source code within the bounds specified.

public void
write(int c)

Writes the specified character into the buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentback to summary
private StringBuilder current
linesback to summary
private final List<StringBuilder> lines

Constructor Detail

SourceBufferback to summary
public SourceBuffer()

Method Detail

getSnippetback to summary
public String getSnippet(LineColumn start, LineColumn end)

Obtains a snippet of the source code within the bounds specified.

Parameters
start:LineColumn

(inclusive line / inclusive column)

end:LineColumn

(inclusive line / exclusive column)

Returns:String

specified snippet of source code as a String, or null if no source available

writeback to summary
public void write(int c)

Writes the specified character into the buffer.