|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jeuclid.biparser.AbstractBiNode net.sourceforge.jeuclid.biparser.BiNode
public final class BiNode
this class is used to store specific information about a composite xml-node. the node can have one child, many attributes and can be invalid
Constructor Summary | |
---|---|
BiNode(int co,
String ns,
String n,
Attributes a)
creates a new BiNode, length must be set afterwards. constructor does not create a DOM-node |
Method Summary | |
---|---|
void |
addChild(IBiNode c)
add a child to this node, if node has already a child, forward to child. |
Node |
createDOMSubtree(Document doc)
create a DOM-tree from node and all children (recursive). |
IBiNode |
getChild()
get the child of the node. |
int |
getLengthOfChildren()
calculate the length of all children. |
String |
getNodeName()
get the name of the node (tagname). |
BiType |
getType()
get the type of node. |
void |
insert(BiTree biTree,
int offset,
int length,
int totalOffset)
insert characters to node. |
void |
remove(BiTree biTree,
int offset,
int length,
int totalOffset)
remove characters from node. |
TextPosition |
searchNode(Node node,
int totalOffset)
search a DOM node in this node. if nodes are equal return offset to begin of inputtext, else null |
void |
setChild(IBiNode c)
set child for this node. |
String |
toString()
|
String |
toString(int level)
print biNode. |
Methods inherited from class net.sourceforge.jeuclid.biparser.AbstractBiNode |
---|
addSibling, changeLengthRec, formatLength, forwardToSibling, getLength, getNode, getParent, getPrevious, getSibling, setLength, setNode, setPrevious, setSibling |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BiNode(int co, String ns, String n, Attributes a)
co
- offset to child from node begin (length of open tag)ns
- DOM-infon
- DOM-infoa
- DOM-infoMethod Detail |
---|
public String getNodeName()
public void addChild(IBiNode c)
c
- new child for this nodepublic IBiNode getChild()
public void setChild(IBiNode c)
c
- new child for this nodepublic BiType getType()
public void insert(BiTree biTree, int offset, int length, int totalOffset) throws ReparseException, NonIncrementalElementException
biTree
- reference to BiTree to which this node containsoffset
- position to insert characterslength
- number of characters to inserttotalOffset
- offset of node to begin of text
ReparseException
- if a reparse at upper level is needed
NonIncrementalElementException
- if the subtree contains an element which cannot be
incrementally updated.public void remove(BiTree biTree, int offset, int length, int totalOffset) throws ReparseException, NonIncrementalElementException
biTree
- reference to BiTree to which this node containsoffset
- position to remove characterslength
- number of characters to removetotalOffset
- offset of node to begin of text
ReparseException
- if a reparse at upper level is needed
NonIncrementalElementException
- if the subtree contains an element which cannot be
incrementally updated.public int getLengthOfChildren()
public Node createDOMSubtree(Document doc)
doc
- Document to create DOM-tree
public TextPosition searchNode(Node node, int totalOffset)
searchNode
in interface IBiNode
searchNode
in class AbstractBiNode
node
- DOM node to search fortotalOffset
- offset of node to begin of inputtext
public String toString()
toString
in class Object
public String toString(int level)
level
- level of recursion tree
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |