net.sourceforge.jeuclid.biparser
Class BiTree

java.lang.Object
  extended by net.sourceforge.jeuclid.biparser.BiTree

public class BiTree
extends Object

this class if for creating a BiTree with ABiNodes while parsing a text.

Version:
$Revision: 0b66106c7ff7 $

Constructor Summary
BiTree()
          create a new instance of BiTree.
 
Method Summary
 void createDOMTree()
          create a new DOM tree from bitree and save it.
 Node getDocument()
          get document of DOM Tree.
 Node getDOMTree(Document d)
          create a dom tree from bitree and return root.
 IBiNode getRoot()
          get root of BiTree.
 String getText()
          get text of BiTree.
 void insert(int offset, int length, String t)
          insert characters into BiTree.
 void remove(int offset, int length, String t)
          remove characters from BiTree.
 TextPosition searchNode(Node node)
          search a DOM node in BiTree and return position of node. if node is not found return null
 void setRoot(IBiNode r)
          set a new root in BiTree.
 String toString()
          get a formatted output of BiTree.
 String toStringDOM()
          get formatted output of DOM Tree (for debugging).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BiTree

public BiTree()
create a new instance of BiTree.

Method Detail

createDOMTree

public final void createDOMTree()
create a new DOM tree from bitree and save it.


getDOMTree

public final Node getDOMTree(Document d)
create a dom tree from bitree and return root.

Parameters:
d - document to create DOM tree
Returns:
root of DOM tree

getRoot

public final IBiNode getRoot()
get root of BiTree.

Returns:
root of BiTree

insert

public final void insert(int offset,
                         int length,
                         String t)
                  throws ReparseException,
                         NonIncrementalElementException
insert characters into BiTree.

Parameters:
offset - insert position in text
length - number of characters to insert
t - text where characters were inserted
Throws:
ReparseException - if a sax parse exception occurs
NonIncrementalElementException - if the subtree contains an element which cannot be incrementally updated.

remove

public final void remove(int offset,
                         int length,
                         String t)
                  throws ReparseException,
                         NonIncrementalElementException
remove characters from BiTree.

Parameters:
offset - remove position in text
length - number of characters to remove
t - text where characters were removed
Throws:
ReparseException - if a sax parse exception occurs
NonIncrementalElementException - if the subtree contains an element which cannot be incrementally updated.

setRoot

public final void setRoot(IBiNode r)
set a new root in BiTree.

Parameters:
r - new root of BiTree

getText

public String getText()
get text of BiTree.

Returns:
text of BiTree

getDocument

public Node getDocument()
get document of DOM Tree.

Returns:
document of DOM Tree

searchNode

public TextPosition searchNode(Node node)
search a DOM node in BiTree and return position of node. if node is not found return null

Parameters:
node - DOM node to search for
Returns:
search result of node in inputtext

toString

public String toString()
get a formatted output of BiTree.

Overrides:
toString in class Object
Returns:
formatted output of BiTree

toStringDOM

public String toStringDOM()
get formatted output of DOM Tree (for debugging).

Returns:
formatted ouput of DOM Tree


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