public final class SimpleSourceFile extends java.lang.Object implements StaticSourceFile
StaticSourceFile for testing.| Constructor and Description |
|---|
SimpleSourceFile(java.lang.String name,
boolean extern) |
| Modifier and Type | Method and Description |
|---|---|
int |
getColumnOfOffset(int offset)
Gets the 0-based column number of the given source offset.
|
int |
getLineOffset(int line)
Returns the offset of the given line number relative to the file start.
|
int |
getLineOfOffset(int offset)
Gets the 1-based line number of the given source offset.
|
java.lang.String |
getName()
The name of the file.
|
boolean |
isExtern()
Returns whether this is an externs file.
|
java.lang.String |
toString() |
public java.lang.String getName()
StaticSourceFilegetName in interface StaticSourceFilepublic boolean isExtern()
StaticSourceFileisExtern in interface StaticSourceFilepublic int getColumnOfOffset(int offset)
StaticSourceFilegetColumnOfOffset in interface StaticSourceFileoffset - An absolute file offset.public int getLineOfOffset(int offset)
StaticSourceFilegetLineOfOffset in interface StaticSourceFileoffset - An absolute file offset.public int getLineOffset(int line)
StaticSourceFilegetLineOffset in interface StaticSourceFileline - the line of the input to get the absolute offset of.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2009-2017 Google. All Rights Reserved.