frysk.dom
Class DOMFunction

java.lang.Object
  extended by frysk.dom.DOMFunction

public class DOMFunction
extends Object

DOMFunction represents a function element to the DOM for any functions found within a particular source file.


Field Summary
static String END_ATTR
           
static String FUNCTION_CALL
           
static String FUNCTION_NAME_ATTR
           
static String FUNCTION_NODE
           
static String LINE_END_ATTR
           
static String LINE_START_ATTR
           
private  Element myElement
           
private  DOMSource parent
           
static String SOURCE_NAME_ATTR
           
static String START_ATTR
           
 
Constructor Summary
DOMFunction(Element data)
          assign a JDOM element to this function name
 
Method Summary
static DOMFunction createDOMFunction(DOMSource parent, String name, String source, int lineStart, int lineEnd, int start, int end, String func_call)
          creates a DOMFunction element to a source file in the DOM
static DOMFunction createDOMFunction(String name, String source, int lineStart, int lineEnd, int start, int end, String func_call)
          creates a DOMFunction
protected  Element getElement()
          returns the JDOM Element associated with this Function
 int getEnd()
          gets the char offset from the start of the file of the last char of the function
 int getEndingLine()
          gets the ending line number in the source file for this function
 String getFunctionCall()
           
 int getLineCount()
          gets the length in lines of the code block that will be inlined
 String[] getLines()
          gets the lines associated with this function
 String getName()
          gets the name of the inlined code
 DOMSource getSource()
          Since all functions are contained in source files, just return the parent source file.
 int getStart()
          gets the char offset from the start of the file of the first char of the function
 int getStartingLine()
          gets the starting line number in the source file for this function
 void setEnd(int endingchar)
          gets the char offset from the start of the file of the last char of the function
 void setEndingLine(int linenum)
          sets the ending line number in the source file for this function
 void setParent(DOMSource parent)
          Set the parent Element for this DOMFunction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FUNCTION_NODE

public static final String FUNCTION_NODE
See Also:
Constant Field Values

END_ATTR

public static final String END_ATTR
See Also:
Constant Field Values

START_ATTR

public static final String START_ATTR
See Also:
Constant Field Values

FUNCTION_NAME_ATTR

public static final String FUNCTION_NAME_ATTR
See Also:
Constant Field Values

SOURCE_NAME_ATTR

public static final String SOURCE_NAME_ATTR
See Also:
Constant Field Values

LINE_START_ATTR

public static final String LINE_START_ATTR
See Also:
Constant Field Values

LINE_END_ATTR

public static final String LINE_END_ATTR
See Also:
Constant Field Values

FUNCTION_CALL

public static final String FUNCTION_CALL
See Also:
Constant Field Values

parent

private DOMSource parent

myElement

private Element myElement
Constructor Detail

DOMFunction

public DOMFunction(Element data)
assign a JDOM element to this function name

Parameters:
data - is a JDOM element
Method Detail

createDOMFunction

public static DOMFunction createDOMFunction(String name,
                                            String source,
                                            int lineStart,
                                            int lineEnd,
                                            int start,
                                            int end,
                                            String func_call)
creates a DOMFunction

Parameters:
name - is the name of this DOMFunction
source - is the source this function was found in
lineStart - is the starting line number in the source file of this function
lineEnd - is the ending line number in the source file of this function
start - is the starting character of the function from the start of the file
end - is the ending character of the function from the start of the file
Returns:
the created DOMFunction

createDOMFunction

public static DOMFunction createDOMFunction(DOMSource parent,
                                            String name,
                                            String source,
                                            int lineStart,
                                            int lineEnd,
                                            int start,
                                            int end,
                                            String func_call)
creates a DOMFunction element to a source file in the DOM

Parameters:
parent - is the image element to attach this DOMFunction to
name - is the name of this DOMFunction
source - is the source this function was found in
lineStart - is the starting line number in the source file of this function
lineEnd - is the ending line number in the source file of this function
start - is the starting character of the function from the start of the file
end - is the ending character of the function from the start of the file
Returns:
the created DOMFunction

setParent

public void setParent(DOMSource parent)
Set the parent Element for this DOMFunction

Parameters:
parent - The DOM parent of this Object

getName

public String getName()
gets the name of the inlined code

Returns:
The name of the inlined code

getLineCount

public int getLineCount()
gets the length in lines of the code block that will be inlined

Returns:
The length in lines of the code block that will be inlined

getStart

public int getStart()
gets the char offset from the start of the file of the first char of the function

Returns:
The start of the inlined code as a char offset from the start of the file

getEnd

public int getEnd()
gets the char offset from the start of the file of the last char of the function

Returns:
The end of the inlined code as a char offset from the start of the file

setEnd

public void setEnd(int endingchar)
gets the char offset from the start of the file of the last char of the function

Parameters:
The - end of the function/inlined code as a char offset from the start of the file

getSource

public DOMSource getSource()
Since all functions are contained in source files, just return the parent source file.

Returns:
the source that this function came from, null if cannot find

getStartingLine

public int getStartingLine()
gets the starting line number in the source file for this function

Returns:
the starting line number in the source file

setEndingLine

public void setEndingLine(int linenum)
sets the ending line number in the source file for this function

Parameters:
an - integer with the starting line number in the source file to set it to

getEndingLine

public int getEndingLine()
gets the ending line number in the source file for this function

Returns:
the ending line number in the source file

getLines

public String[] getLines()
gets the lines associated with this function

Returns:
a String array containing the source lines for this function

getFunctionCall

public String getFunctionCall()

getElement

protected Element getElement()
returns the JDOM Element associated with this Function

Returns:
JDOM Element