net.sourceforge.jeuclid.biparser
Class BiTreeCreationHelper

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

public class BiTreeCreationHelper
extends Object

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

Version:
$Revision: 0b66106c7ff7 $

Constructor Summary
BiTreeCreationHelper()
          create a new BiTreeHelper. get result (tree of ABiNodes) with getRoot()
 
Method Summary
 boolean allowNewTextNode()
          check if current position in BiTree allows a TextNode as child.
 void closeBiNode(int length)
          close BiNode (set length of node).
 void createBiNode(int totalOffset, int childOffset, String namespaceURI, String eName, Attributes attrs)
          create and append a new BiNode at current position in BiTree.
 void createEmtpyNode(int length)
          create a new EmptyNode at current position in BiTree.
 void createTextNode(int length, String t)
          create a new TextNode at current position.
 IBiNode getRoot()
          get root of BiTree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BiTreeCreationHelper

public BiTreeCreationHelper()
create a new BiTreeHelper. get result (tree of ABiNodes) with getRoot()

Method Detail

getRoot

public final IBiNode getRoot()
get root of BiTree.

Returns:
root of BiTree

createBiNode

public final void createBiNode(int totalOffset,
                               int childOffset,
                               String namespaceURI,
                               String eName,
                               Attributes attrs)
                        throws SAXParseException
create and append a new BiNode at current position in BiTree.

Parameters:
totalOffset - of node in text
childOffset - position of first child (length of open tag)
namespaceURI - namespace
eName - name of node
attrs - attributes of node
Throws:
SAXParseException - if the element cannot be recognized by JEuclid.

closeBiNode

public final void closeBiNode(int length)
close BiNode (set length of node).

Parameters:
length - length of node

allowNewTextNode

public final boolean allowNewTextNode()
check if current position in BiTree allows a TextNode as child.

Returns:
true if a TextNode is allowed

createTextNode

public final void createTextNode(int length,
                                 String t)
create a new TextNode at current position.

Parameters:
length - length of TextNode
t - text of TextNode

createEmtpyNode

public final void createEmtpyNode(int length)
create a new EmptyNode at current position in BiTree.

Parameters:
length - length of EmtpyNode


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