|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object frysk.dom.DOMLine
public class DOMLine
DOMLine represents a line of code (not assembly instruction) in a file.
Field Summary | |
---|---|
static String |
EXECUTABLE_ATTR
Whether this line is executable or not |
static String |
HAS_BREAK_ATTR
Whether this line has inlined code or not |
static String |
LENGTH_ATTR
The length of the line including the \n |
static String |
LINE_NODE
The name of the Element node |
private Element |
myElement
|
static String |
NUMBER_ATTR
The number of this line |
static String |
OFFSET_ATTR
The offset in characters from the start of the file |
Constructor Summary | |
---|---|
DOMLine(Element data)
Creates a new DOMLine using the given data as it's element. |
|
DOMLine(int lineNo,
String lineText,
int offset,
boolean executable,
boolean hasBreakpoint,
long address)
Creates a new DOMLine |
Method Summary | |
---|---|
void |
addTag(DOMTag tag)
add a tag element to this line |
void |
addTag(String type,
String token,
int start)
adds a new tag to a source line |
long |
getAddress()
|
protected Element |
getElement()
get the JDOM Element of this line |
int |
getLength()
gets the length of this line in characters |
int |
getLineNum()
gets the lines niumber within the source file of this line |
int |
getOffset()
gets the offset in characters of this line from the start of the source file |
DOMTag |
getTag(int index)
Returns the tag at the given index of the line. |
Iterator |
getTags()
get an iterator to all of the tags contained on this line of code |
Iterator |
getTags(String type)
Tries to find all the tags on this line of a given type |
String |
getText()
get the text associated with this line |
boolean |
hasBreakPoint()
Check to see if this line has a breakpoint active |
boolean |
hasInlinedCode()
return a boolean indicating whether or not this line contains an inline function |
private static String |
insertCode(String line,
String code,
int pos)
insertCode inserts the code sent to it to replace the single char |
private static String |
insertXMLCode(String line)
inserXMLCode takes a special control character and inserts the XML code for that char. |
boolean |
isExecutable()
return a boolean indicating whether or not this line is executable |
void |
setBreakPoint(boolean hasbreak)
Set the hasBreak attribute(indicates that this line has a breakpoint set) |
void |
setExecutable(boolean executable)
sets the executable attribute for this line |
void |
setOffset(int offset)
sets the offset of the line from the beginning of the file |
void |
setText(String text)
set the text for this line to the incoming string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EXECUTABLE_ATTR
public static final String HAS_BREAK_ATTR
public static final String OFFSET_ATTR
public static final String LENGTH_ATTR
public static final String LINE_NODE
public static final String NUMBER_ATTR
private Element myElement
Constructor Detail |
---|
public DOMLine(int lineNo, String lineText, int offset, boolean executable, boolean hasBreakpoint, long address)
lineNo
- The line number of this linelineText
- The text on this lineoffset
- The offset in characters from the start of the fileexecutable
- Whether this line is executable or nothasBreakpoint
- Whether this line has any breakpoints on it or notaddress
- The program counter value.public DOMLine(Element data)
data
- is a JDOM element named "line"Method Detail |
---|
public int getLineNum()
public int getLength()
public int getOffset()
public void setOffset(int offset)
character
- offset from the beginning of the filepublic boolean hasInlinedCode()
public boolean isExecutable()
public void setExecutable(boolean executable)
executable
- is the boolean value to set the executable attribute topublic boolean hasBreakPoint()
public void setBreakPoint(boolean hasbreak)
hasbreak
- is the boolean value to set the hasbreak value topublic String getText()
public void setText(String text)
text
- is the text of the source linepublic Iterator getTags()
public void addTag(String type, String token, int start)
type
- - the type of tag(keyword, variable, function)token
- - token associated with this tagstart
- - the starting character within the linepublic Iterator getTags(String type)
type
- The type of tag to look for
public DOMTag getTag(int index)
index
- Offset to look for a tag at
public void addTag(DOMTag tag)
tag
- is the element to add to this linepublic long getAddress()
protected Element getElement()
private static String insertXMLCode(String line)
line
- ch
-
private static String insertCode(String line, String code, int pos)
line
- is the String to insert the characters intoXMLcode
- is the String to inserti
- is the location in the line String to insert the chars
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |