net.sourceforge.jeuclid.biparser
Class EmptyNode

java.lang.Object
  extended by net.sourceforge.jeuclid.biparser.AbstractBiNode
      extended by net.sourceforge.jeuclid.biparser.EmptyNode
All Implemented Interfaces:
IBiNode

public final class EmptyNode
extends AbstractBiNode

this class is used to store specific information about a empty node. the node cannot have children, but a sibling

Version:
$Revision: 0b66106c7ff7 $

Constructor Summary
EmptyNode(int length)
          create a new EmptyNode.
 
Method Summary
 Node createDOMSubtree(Document doc)
          don't create a DOM-tree from EmptyNode (EmptyNode has no DOM node).
 BiType getType()
          get the type of node.
 void insert(BiTree biTree, int offset, int length, int totalOffset)
          insert characters in EmptyNode, reparse if characters contain '<' or '>'.
 void remove(BiTree biTree, int offset, int length, int totalOffset)
          remove characters from EmptyNode, reparse if length gets 0.
 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
 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

EmptyNode

public EmptyNode(int length)
create a new EmptyNode.

Parameters:
length - of EmptyNode
Method Detail

getType

public BiType getType()
get the type of node.

Returns:
EMPTY

insert

public void insert(BiTree biTree,
                   int offset,
                   int length,
                   int totalOffset)
            throws ReparseException,
                   NonIncrementalElementException
insert characters in EmptyNode, reparse if characters contain '<' or '>'. else change length of EmptyNode insert characters to node.

Parameters:
biTree - reference to BiTree to which this node contains
offset - position to insert characters
length - number of characters to insert
totalOffset - offset of node to begin of text
Throws:
ReparseException - if a reparse at upper level is needed
NonIncrementalElementException - if the subtree contains an element which cannot be incrementally updated.

remove

public void remove(BiTree biTree,
                   int offset,
                   int length,
                   int totalOffset)
            throws ReparseException,
                   NonIncrementalElementException
remove characters from EmptyNode, reparse if length gets 0. remove characters from node.

Parameters:
biTree - reference to BiTree to which this node contains
offset - position to remove characters
length - number of characters to remove
totalOffset - offset of node to begin of text
Throws:
ReparseException - if a reparse at upper level is needed
NonIncrementalElementException - if the subtree contains an element which cannot be incrementally updated.

createDOMSubtree

public Node createDOMSubtree(Document doc)
don't create a DOM-tree from EmptyNode (EmptyNode has no DOM node).

Parameters:
doc - Document to create DOM-tree
Returns:
null

searchNode

public 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

Specified by:
searchNode in interface IBiNode
Overrides:
searchNode in class AbstractBiNode
Parameters:
node - DOM node to search for
totalOffset - offset of node to begin of inputtext
Returns:
position of node in inputtext

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(int level)
print biNode.

Parameters:
level - level of recursion tree
Returns:
biNode


Copyright © 2002-2010 The JEuclid project. All Rights Reserved.