com.google.dart.compiler.common
Class SourceInfoImpl

java.lang.Object
  extended by com.google.dart.compiler.common.SourceInfoImpl
All Implemented Interfaces:
SourceInfo, java.io.Serializable

public class SourceInfoImpl
extends java.lang.Object
implements SourceInfo

See Also:
Serialized Form

Field Summary
protected  int column
           
protected  int length
           
protected  int line
           
protected  Source source
           
protected  int start
           
 
Constructor Summary
SourceInfoImpl(Source source, int line, int column, int start, int length)
           
 
Method Summary
 int getColumn()
           
 int getLength()
          Returns the length in characters of the original source file indicating where the source fragment corresponding to this node ends.
 int getLine()
           
 Source getSource()
          The source code provider.
 int getStart()
          Returns the character index into the original source file indicating where the source fragment corresponding to this node begins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected Source source

line

protected int line

column

protected int column

start

protected int start

length

protected int length
Constructor Detail

SourceInfoImpl

public SourceInfoImpl(Source source,
                      int line,
                      int column,
                      int start,
                      int length)
Method Detail

getSource

public Source getSource()
Description copied from interface: SourceInfo
The source code provider.

Specified by:
getSource in interface SourceInfo

getLine

public int getLine()
Specified by:
getLine in interface SourceInfo
Returns:
A 1-based line number into the original source file indicating where the source fragment begins.

getColumn

public int getColumn()
Specified by:
getColumn in interface SourceInfo
Returns:
A 1-based column number into the original source file indicating where the source fragment begins.

getStart

public int getStart()
Description copied from interface: SourceInfo
Returns the character index into the original source file indicating where the source fragment corresponding to this node begins.

The parser supplies useful well-defined source ranges to the nodes it creates.

Specified by:
getStart in interface SourceInfo
Returns:
the 0-based character index, or -1 if no source startPosition information is recorded for this node
See Also:
SourceInfo.getLength(), HasSourceInfo#setSourceLocation(Source, int, int, int, int)

getLength

public int getLength()
Description copied from interface: SourceInfo
Returns the length in characters of the original source file indicating where the source fragment corresponding to this node ends.

The parser supplies useful well-defined source ranges to the nodes it creates.

Specified by:
getLength in interface SourceInfo
Returns:
a (possibly 0) length, or 0 if no source source position information is recorded for this node
See Also:
SourceInfo.getStart(), HasSourceInfo#setSourceLocation(Source, int, int, int, int)