frysk.dom
Class DOMTag

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

public class DOMTag
extends Object

DOMTag represents a tagged area (i.e. function declaration, varaible use, comment, etc) in a source code file


Field Summary
static String LENGTH_ATTR
          The end of the tag
static String START_ATTR
          The start of the tag
static String TAG_NODE
          The name of the DOM Element
static String TOKEN_ATTR
          The actual token of this tag
static String TYPE_ATTR
          The type of the tag
 
Constructor Summary
DOMTag(Element data)
          Creates a new DOMTag using the given data as it's Element.
DOMTag(String type, String token, int start)
          Creates a new DOMTag
 
Method Summary
 int getLength()
          gets the length of the tag
 int getStart()
          get the character offset from the start of the file
 String getToken()
          get the token attribute for this tag
 String getType()
          get the type attribute for this tag instance
 boolean isInRange(int test)
          Tests to see if this tag encompasses the given index
 void setLength(int end)
          set the length of this tag on this line
 void setStart(int start)
          set the starting character offset of this tag
 void setType(String type)
          change the type attribue of this tag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LENGTH_ATTR

public static final String LENGTH_ATTR
The end of the tag

See Also:
Constant Field Values

START_ATTR

public static final String START_ATTR
The start of the tag

See Also:
Constant Field Values

TYPE_ATTR

public static final String TYPE_ATTR
The type of the tag

See Also:
Constant Field Values

TOKEN_ATTR

public static final String TOKEN_ATTR
The actual token of this tag

See Also:
Constant Field Values

TAG_NODE

public static final String TAG_NODE
The name of the DOM Element

See Also:
Constant Field Values
Constructor Detail

DOMTag

public DOMTag(String type,
              String token,
              int start)
Creates a new DOMTag

Parameters:
type - The type of the tag
token - The token
start - The start of the tag on the given line

DOMTag

public DOMTag(Element data)
Creates a new DOMTag using the given data as it's Element. Data must be of name "tag"

Parameters:
data - is the JDOM element
Method Detail

setType

public void setType(String type)
change the type attribue of this tag

Parameters:
type - is the tag type to set

getType

public String getType()
get the type attribute for this tag instance

Returns:
The type of the tag

setStart

public void setStart(int start)
set the starting character offset of this tag

Parameters:
start - is the character offset for this tag

getStart

public int getStart()
get the character offset from the start of the file

Returns:
The starting offset of the tag from the start of the file

setLength

public void setLength(int end)
set the length of this tag on this line

Parameters:
the - ending character of this tag

getLength

public int getLength()
gets the length of the tag

Returns:
The length of the tag

isInRange

public boolean isInRange(int test)
Tests to see if this tag encompasses the given index

Parameters:
test - The index, relative to the start of the file, to test
Returns:
true if the tag covers the index, false otherwise

getToken

public String getToken()
get the token attribute for this tag

Returns:
The token for this tag