Main Page | Packages | Class Hierarchy | Class List | File List | Class Members

treebuilder.TreeNode Class Reference

Inheritance diagram for treebuilder.TreeNode:

Inheritance graph
[legend]
Collaboration diagram for treebuilder.TreeNode:

Collaboration graph
[legend]
List of all members.

Detailed Description

treeNode

A light weight XML tree node


Public Member Functions

 TreeNode (TreeNodeType ty)
TreeNodeType getType ()
boolean isLeaf ()
void setParent (TreeNode parent)
TreeNode getParent ()
void setChild (TreeNode child)
TreeNode getChild ()
TreeNode getSecondChild ()
TreeNode getThirdChild ()
TreeNode getChildN (int n)
 Get child N, where N = {1, 2, ...
void setSibling (TreeNode sibling)
TreeNode getSibling ()
void setSibPred (TreeNode pred)
TreeNode getSibPred ()
abstract String toString ()

Private Attributes

TreeNodeType mType = null
 Node type: tag, attribute, text.
TreeNode mParent = null
 if (this) is a child, mParent points to the parent node
TreeNode mChild = null
 reference to a child node
TreeNode mSibling = null
 reference to the next sibling node
TreeNode mSibPred = null
 reference to the predecessor to (this) sibling


Constructor & Destructor Documentation

treebuilder.TreeNode.TreeNode TreeNodeType  ty  ) 
 

00034 { 00035 mType = ty; 00036 }


Member Function Documentation

TreeNode treebuilder.TreeNode.getChild  ) 
 

Reimplemented in treebuilder.Attribute.

00063 { 00064 return mChild; 00065 }

TreeNode treebuilder.TreeNode.getChildN int  n  ) 
 

Get child N, where N = {1, 2, ...

n}

00091 { 00092 TreeNode nthChild = getChild(); 00093 for (int i = 1; i < n && nthChild != null; i++) { 00094 nthChild = nthChild.getSibling(); 00095 } 00096 return nthChild; 00097 }

TreeNode treebuilder.TreeNode.getParent  ) 
 

00052 { 00053 return mParent; 00054 }

TreeNode treebuilder.TreeNode.getSecondChild  ) 
 

00067 { 00068 TreeNode child = null; 00069 if (getChild() != null) { 00070 child = getChild().getSibling(); 00071 } 00072 return child; 00073 }

TreeNode treebuilder.TreeNode.getSibling  ) 
 

00106 { 00107 return mSibling; 00108 }

TreeNode treebuilder.TreeNode.getSibPred  ) 
 

00116 { 00117 return mSibPred; 00118 }

TreeNode treebuilder.TreeNode.getThirdChild  ) 
 

00075 { 00076 TreeNode child = null; 00077 if (getChild() != null) { 00078 TreeNode tmp = getChild().getSibling(); 00079 if (tmp != null) { 00080 child = tmp.getSibling(); 00081 } 00082 } 00083 return child; 00084 }

TreeNodeType treebuilder.TreeNode.getType  ) 
 

00039 { 00040 return mType; 00041 }

boolean treebuilder.TreeNode.isLeaf  ) 
 

00044 { 00045 return (getChild() == null); 00046 }

void treebuilder.TreeNode.setChild TreeNode  child  ) 
 

Reimplemented in treebuilder.Attribute.

00056 { 00057 mChild = child; 00058 if (child != null) { 00059 child.setParent( this ); 00060 } 00061 }

void treebuilder.TreeNode.setParent TreeNode  parent  ) 
 

00048 { 00049 mParent = parent; 00050 }

void treebuilder.TreeNode.setSibling TreeNode  sibling  ) 
 

00099 { 00100 mSibling = sibling; 00101 if (sibling != null) { 00102 sibling.setSibPred( this ); 00103 } 00104 }

void treebuilder.TreeNode.setSibPred TreeNode  pred  ) 
 

00111 { 00112 mSibPred = pred; 00113 }

abstract String treebuilder.TreeNode.toString  )  [pure virtual]
 

Implemented in treebuilder.NamedEntity, and treebuilder.TextNode.


Member Data Documentation

TreeNode treebuilder.TreeNode.mChild = null [private]
 

reference to a child node

TreeNode treebuilder.TreeNode.mParent = null [private]
 

if (this) is a child, mParent points to the parent node

TreeNode treebuilder.TreeNode.mSibling = null [private]
 

reference to the next sibling node

TreeNode treebuilder.TreeNode.mSibPred = null [private]
 

reference to the predecessor to (this) sibling

TreeNodeType treebuilder.TreeNode.mType = null [private]
 

Node type: tag, attribute, text.

Reimplemented in treebuilder.Attribute.


The documentation for this class was generated from the following file:
Generated on Tue Sep 21 22:08:44 2004 for Building an in-memory tree using the XmlPullParser by doxygen 1.3.8