|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.byu.deg.ontos.DOMString
Wraps a dom tree so it can be matched with regular expressions like a string. Still needs to implement getXPathFor() method.
| Field Summary | |
(package private) int |
baseOffset
|
(package private) int |
lastIndex
|
(package private) String |
lastString
|
(package private) int |
length
|
(package private) ArrayList |
nodes
|
(package private) int |
nodesIndexed
|
(package private) int[] |
offsets
|
(package private) int |
remainder
|
(package private) ArrayList |
strings
|
| Constructor Summary | |
DOMString(Node rootNode)
Creates a new instance of DOMString |
|
| Method Summary | |
char |
charAt(int offset)
Method to retrieve a character from the virtual string |
int |
getEndOf(Node node)
Returns the ending character offset of the given DOM node. |
Node |
getFirstText()
Returns the earliest DOM node in the document, or null if the
document is empty. |
int |
getLastRemainder()
Returns the index of the offset within the String or Node
returned by the last getNodeFor(int) or getStringAt(int) method
call. |
Node |
getNodeFor(int offset)
Returns the Node which contains the text at the given offset. |
int |
getRelativeStartOfLastString()
|
int |
getStartOf(Node node)
Returns the starting character offset of the given DOM node. |
String |
getStringAt(int offset)
Returns the String which contains the text at the given offset. |
String |
getXPathFor(int offset)
Calculates the XPath of the node at the given offset. |
int |
length()
Method to return the length of the virtual string |
CharSequence |
subSequence(int start,
int end)
Returns a DOMString representing the given subsequence. |
DOMString |
subString(int start)
Returns a DOMString beginning at the given offset and continuing to
the end of this DOMString |
DOMString |
subString(int start,
int end)
Returns a DOMString representing the given subsequence. |
String |
toString()
Returns a string representation of the contents of the DOMString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
int[] offsets
ArrayList nodes
ArrayList strings
int length
int nodesIndexed
int remainder
int lastIndex
int baseOffset
String lastString
| Constructor Detail |
public DOMString(Node rootNode)
rootNode - The DOM tree root to wrap| Method Detail |
public int getStartOf(Node node)
node - A node in the DOM tree.
public int getEndOf(Node node)
node - A node in the DOM tree.
public char charAt(int offset)
charAt in interface CharSequenceoffset - offset of the char to return
public int length()
length in interface CharSequenceDOMString
public CharSequence subSequence(int start,
int end)
subSequence in interface CharSequencestart - starting offset of the new DOMStringend - ending offset of the new DOMString
DOMString containing the given subsequence
public DOMString subString(int start,
int end)
start - starting offset of the new DOMStringend - ending offset of the new DOMString
DOMString containing the given subsequencepublic DOMString subString(int start)
DOMString beginning at the given offset and continuing to
the end of this DOMString
start - starting offset of the new DOMString
DOMString containing the given subsequencepublic Node getNodeFor(int offset)
Node which contains the text at the given offset.
offset - the offset
Nodepublic String getXPathFor(int offset)
offset - the offset
public int getLastRemainder()
String or Node
returned by the last getNodeFor(int) or getStringAt(int) method
call.
public String getStringAt(int offset)
String which contains the text at the given offset.
offset - the offset
public String toString()
DOMString
toString in interface CharSequencepublic Node getFirstText()
null if the
document is empty.
public int getRelativeStartOfLastString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||