|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.ba.SourceFile
public class SourceFile
Cached data for a source file. Contains a map of line numbers to byte offsets, for quick searching of source lines.
SourceFinder
Nested Class Summary | |
---|---|
private static class |
SourceFile.LineNumberMapBuilder
Helper object to build map of line number to byte offset for a source file. |
Field Summary | |
---|---|
private byte[] |
data
|
private SourceFileDataSource |
dataSource
|
private static int |
DEFAULT_SIZE
|
private int[] |
lineNumberMap
|
private int |
numLines
|
Constructor Summary | |
---|---|
SourceFile(SourceFileDataSource dataSource)
Constructor. |
Method Summary | |
---|---|
void |
addLineOffset(int offset)
Add a source line byte offset. |
java.lang.String |
getFullFileName()
Get the full path name of the source file (with directory). |
java.io.InputStream |
getInputStream()
Get an InputStream on data. |
java.io.InputStream |
getInputStreamFromOffset(int offset)
Get an InputStream on data starting at given offset. |
int |
getLineOffset(int line)
Get the byte offset in the data for a source line. |
private static int |
intValueOf(byte b)
|
private void |
loadFileData()
|
private void |
setData(byte[] data)
Set the source file data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int DEFAULT_SIZE
private SourceFileDataSource dataSource
private byte[] data
private int[] lineNumberMap
private int numLines
Constructor Detail |
---|
public SourceFile(SourceFileDataSource dataSource)
dataSource
- the SourceFileDataSource object which will
provide the data of the source fileMethod Detail |
---|
private static int intValueOf(byte b)
public java.lang.String getFullFileName()
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
public java.io.InputStream getInputStreamFromOffset(int offset) throws java.io.IOException
offset
- the start offset
java.io.IOException
public void addLineOffset(int offset)
offset
- the byte offset of the next source linepublic int getLineOffset(int line)
line
- the line number
private void loadFileData() throws java.io.IOException
java.io.IOException
private void setData(byte[] data)
data
- the data
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |