public final class SimpleSourceFile extends java.lang.Object implements StaticSourceFile, java.io.Serializable
StaticSourceFile
for testing.StaticSourceFile.SourceKind
Constructor and Description |
---|
SimpleSourceFile(java.lang.String name,
StaticSourceFile.SourceKind kind) |
Modifier and Type | Method and Description |
---|---|
int |
getColumnOfOffset(int offset)
Gets the 0-based column number of the given source offset.
|
StaticSourceFile.SourceKind |
getKind()
The source kind.
|
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.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isExtern, isStrong, isWeak
public SimpleSourceFile(java.lang.String name, StaticSourceFile.SourceKind kind)
public java.lang.String getName()
StaticSourceFile
getName
in interface StaticSourceFile
public StaticSourceFile.SourceKind getKind()
StaticSourceFile
getKind
in interface StaticSourceFile
public int getColumnOfOffset(int offset)
StaticSourceFile
getColumnOfOffset
in interface StaticSourceFile
offset
- An absolute file offset.public int getLineOfOffset(int offset)
StaticSourceFile
getLineOfOffset
in interface StaticSourceFile
offset
- An absolute file offset.public int getLineOffset(int line)
StaticSourceFile
getLineOffset
in interface StaticSourceFile
line
- the line of the input to get the absolute offset of.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2009-2019 Google. All Rights Reserved.