|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umd.cfar.lamp.viper.util.reader.VReader.TextLine
This class is used to represent a line of text or a sequence of lines connected by '\' characters. It supports various operations to treat lines and multilines in a consistent manner.
Constructor Summary | |
protected |
VReader.TextLine()
|
Method Summary | |
boolean |
add(java.lang.String nextLine)
Adds the next line to the current multiline, replacing it if the last one was done, appending to it if it wasn't, and returning true if it is now done. |
void |
clear()
This clears the current multiline. |
boolean |
done()
Returns true if the current line does not end in a continuation. |
boolean |
empty()
Returns true if the current line contains no data. |
int |
getColumn(int offset)
This returns what column in a multiline the specified character would be found. |
int |
getLineNum()
Returns the line number of this line or the last line if this is a multiline. |
int |
getLineNum(int start)
This finds the line number of a specific character. |
void |
insert(java.lang.String prefix)
This appends a string to the beginning of the current line. |
java.lang.String |
numbered()
This returns the current multiline with the line number appended to the front. |
java.lang.String |
numbered(int start,
int end)
This prints out only the lines containing character offsets between start and end , inclusive, using the
same format as numbered() . |
void |
setLineNum(int lineNumber)
Set the current line number. |
boolean |
startsWith(java.lang.String prefix)
Equivalent to toString.startsWith, but faster on lines that are not finished. |
java.lang.String |
toString()
Returns the String representation of the current line or mutliline as one whole line. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected VReader.TextLine()
Method Detail |
public void insert(java.lang.String prefix)
prefix
- the string to insert onto the current line.public java.lang.String numbered()
public java.lang.String numbered(int start, int end)
start
and end
, inclusive, using the
same format as numbered()
.
start
- The character offset of the beginning of the error.end
- The character offset of the end of the error.
public boolean empty()
true
if the current line contains no data.
true
if the current line is empty.public void setLineNum(int lineNumber)
lineNumber
- The new line number.public int getColumn(int offset)
offset
- the character
public int getLineNum()
public int getLineNum(int start)
start
- the line number of the character in the multiline segment
public java.lang.String toString()
public void clear()
public boolean done()
false
if the current line continuespublic boolean add(java.lang.String nextLine)
nextLine
- puts the next line into the multiline
isDone()
public boolean startsWith(java.lang.String prefix)
prefix
- the prefix to check for
toString().startsWith(prefix)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |