Class: LineNumberInfo
next
package
Stores information about line number(s) of an original line of source
code from a Mapper report. Because continuation lines are treated as one
line by the report parser, a logical, parsed source code line may span
more than one line number in the original Mapper report.
Treat this class as "thread-compatible", since it is not designed out-of-the-box
for multi-threaded access.
public class com.arsi.mj.maprpt.parser.line.LineNumberInfo
extends java.lang.Object
implements java.lang.Cloneable
Inner Class CompositeLinePosition |
Nested class that represents the start and end position of a line
in a larger, composite line.
public static class com.arsi.mj.maprpt.parser.line.LineNumberInfo.CompositeLinePosition
extends java.lang.Object
implements java.lang.Cloneable
|
public LineNumberInfo.CompositeLinePosition(int aLineNum, int aStartPosition, int anEndPosition)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
|
Constructors |
Restricted ctor for initializing an instance of this class.
- Parameters:
aCompositeLinePos - line number and position of single, original line (not a line formed
by joining multiple, composite lines from original source, so positions
are not very useful in this case).
public LineNumberInfo(com.arsi.mj.maprpt.parser.line.LineNumberInfo.CompositeLinePosition aCompositeLinePos)
|
Ctor for initializing an instance of this class.
- Parameters:
someCompositeLinePos - line numbers and positions of original lines within joined composite line.
public LineNumberInfo(java.util.List someCompositeLinePos)
|
Methods |
Adjust line number(s) to account for pragmas or other filtered lines.
- Parameters:
anAdjustment - a positive or negative adjustment to add to line number(s).
public void adjust(int anAdjustment)
|
Clone this line number info instance.
- See Also:
- java.lang.Object#clone()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
|
Get the canonical, single line number of a possibly composite source code line.
- Returns:
- the canonical line number, which is the line number of the first line seen.
public int getCanonicalLineNum()
|
Given a character position in a possibly composite source code line, get the line number
in original Mapper report where this position is found.
- Parameters:
aPosition - character position in a possibly composite source code line, counting from 1.
- Returns:
- actual, non-composite line number in Mapper report where this position is found
or -1 if such a line number cannot be determined.
public int getLineNumAtPosition(int aPosition)
|
Get all line numbers in the original Mapper report that comprise a possibly composite
source code line.
- Returns:
- line numbers in original Mapper report, in the order encountered.
public int getLineNums()
|
Do the line numbers span continuation lines, i.e., is the source code line a
composite of two or more joined lines from the original Mapper report?
- Returns:
- true if line numbers span continuation lines, false if line number
correlates to a single line from the original Mapper report.
public boolean includesContinuationLines()
|
Class: LineNumberPushbackReader
previous
package
A push back reader that keeps track of Mapper line numbers.
public class com.arsi.mj.maprpt.parser.line.LineNumberPushbackReader
extends java.io.PushbackReader
Constructors |
public LineNumberPushbackReader(java.io.Reader aReader)
|
public LineNumberPushbackReader(java.io.Reader aReader, int aSize)
|
Methods |
public int getLineNumber()
|
public void incrementLineNumber()
|
public void incrementLineNumber(int anIncr)
|
public void setEOFIndicated(boolean anEOFIndicator)
|
public void setLineNumber(int aLineNum)
|
public boolean wasEOFIndicated()
|