Back to index

wims  3.65+svn20090927
Public Member Functions | Package Attributes
rene.util.xml.XmlTree Class Reference
Inheritance diagram for rene.util.xml.XmlTree:
Inheritance graph
[legend]
Collaboration diagram for rene.util.xml.XmlTree:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 XmlTree (XmlTag t)
XmlTag getTag ()
XmlTree xmlFirstContent ()
boolean isText ()
String getText ()
Enumeration getContent ()
boolean hasMoreElements ()
Object nextElement ()
String parseComment () throws XmlReaderException
void addchild (Tree t)
 add a child tree
void insertchild (Tree t)
 insert a child tree
void remove (Tree t)
 remove the specific child tree (must be in the tree!!!)
void removeall ()
 remove all children
boolean haschildren ()
Tree firstchild ()
Tree lastchild ()
Tree parent ()
ListClass children ()
Object content ()
void content (Object o)
ListElement listelement ()

Package Attributes

ListElement Current
ListClass Children
Object Content
ListElement Le
Tree Parent

Detailed Description

Definition at line 10 of file XmlTree.java.


Constructor & Destructor Documentation

Definition at line 12 of file XmlTree.java.

{      public XmlTree (XmlTag t)
       {      super(t);
       }

Here is the caller graph for this function:


Member Function Documentation

void rene.util.list.Tree.addchild ( Tree  t) [inline, inherited]

add a child tree

Definition at line 21 of file Tree.java.

       {      ListElement p=new ListElement(t);
              Children.append(p);
              t.Le=p; t.Parent=this;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

ListClass rene.util.list.Tree.children ( ) [inline, inherited]

Definition at line 64 of file Tree.java.

{ return Children; }

Here is the caller graph for this function:

Object rene.util.list.Tree.content ( ) [inline, inherited]

Definition at line 65 of file Tree.java.

{ return Content; }

Here is the caller graph for this function:

void rene.util.list.Tree.content ( Object  o) [inline, inherited]

Definition at line 66 of file Tree.java.

{ Content=o; }
Tree rene.util.list.Tree.firstchild ( ) [inline, inherited]

Definition at line 61 of file Tree.java.

{ return (Tree)Children.first().content(); }

Here is the call graph for this function:

Here is the caller graph for this function:

Enumeration rene.util.xml.XmlTree.getContent ( ) [inline]

Definition at line 37 of file XmlTree.java.

       {      Current=children().first();
              return this;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 15 of file XmlTree.java.

       {      return (XmlTag)content();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

String rene.util.xml.XmlTree.getText ( ) [inline]

Definition at line 30 of file XmlTree.java.

       {      if (!haschildren()) return "";
              XmlTree t=(XmlTree)firstchild();
              XmlTag tag=t.getTag();
              return ((XmlTagText)tag).getContent();
       }

Here is the call graph for this function:

boolean rene.util.list.Tree.haschildren ( ) [inline, inherited]

Definition at line 60 of file Tree.java.

{ return Children.first()!=null; }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 41 of file XmlTree.java.

       {      return Current!=null;
       }
void rene.util.list.Tree.insertchild ( Tree  t) [inline, inherited]

insert a child tree

Definition at line 28 of file Tree.java.

       {      if (!haschildren()) // simple case
              {      addchild(t); return;
              }
              // give t my children
              t.Children=Children;
              // make t my only child
              Children=new ListClass();
              ListElement p=new ListElement(t);
              Children.append(p);
              t.Le=p; t.Parent=this;
              // fix the parents of all grandchildren
              ListElement le=t.Children.first();
              while (le!=null)
              {      Tree h=(Tree)(le.content());
                     h.Parent=t;
                     le=le.next();
              }
       }

Here is the call graph for this function:

Definition at line 22 of file XmlTree.java.

       {      if (!haschildren()) return true;
              if (firstchild()!=lastchild()) return false;
              XmlTree t=(XmlTree)firstchild();
              XmlTag tag=t.getTag();
              if (!(tag instanceof XmlTagText)) return false;
              return true;
       }

Here is the call graph for this function:

Tree rene.util.list.Tree.lastchild ( ) [inline, inherited]

Definition at line 62 of file Tree.java.

{ return (Tree)Children.last().content(); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 67 of file Tree.java.

{ return Le; }
Object rene.util.xml.XmlTree.nextElement ( ) [inline]

Definition at line 44 of file XmlTree.java.

       {      if (Current==null) return null;
              XmlTree c=(XmlTree)(Current.content());
              Current=Current.next();
              return c;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Tree rene.util.list.Tree.parent ( ) [inline, inherited]

Definition at line 63 of file Tree.java.

{ return Parent; }

Definition at line 50 of file XmlTree.java.

       {      StringBuffer s=new StringBuffer();
              Enumeration e=getContent();
              while (e.hasMoreElements())
              {      XmlTree tree=(XmlTree)e.nextElement();
                     XmlTag tag=tree.getTag();
                     if (tag.name().equals("P"))
                     {      if (!tree.haschildren()) s.append("\n");
                            else
                            {      XmlTree h=tree.xmlFirstContent();
                                   String k=((XmlTagText)h.getTag()).getContent();
                                   k=k.replace('\n',' ');
                                   StringParser p=new StringParser(k);
                                   Vector v=p.wraplines(1000);
                                   for (int i=0; i<v.size(); i++)
                                   {      s.append((String)v.elementAt(i));
                                          s.append("\n");
                                   }
                            }
                     }
                     else if (tag instanceof XmlTagText)
                     {      String k=((XmlTagText)tag).getContent();
                            StringParser p=new StringParser(k);
                            Vector v=p.wraplines(1000);
                            for (int i=0; i<v.size(); i++)
                            {      s.append((String)v.elementAt(i));
                                   s.append("\n");
                            }                    
                     }
                     else
                            throw new XmlReaderException("<"+tag.name()+"> not proper here.");
              }
              return s.toString();
       }      

Here is the call graph for this function:

void rene.util.list.Tree.remove ( Tree  t) [inline, inherited]

remove the specific child tree (must be in the tree!!!)

Definition at line 49 of file Tree.java.

       {      if (t.parent()!=this) return;
              Children.remove(t.Le);
       }

Here is the call graph for this function:

void rene.util.list.Tree.removeall ( ) [inline, inherited]

remove all children

Definition at line 55 of file Tree.java.

Here is the call graph for this function:

Definition at line 18 of file XmlTree.java.

       {      if (firstchild()!=null) return (XmlTree)firstchild();
              else return null;
       }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

ListClass rene.util.list.Tree.Children [package, inherited]

Definition at line 8 of file Tree.java.

Object rene.util.list.Tree.Content [package, inherited]

Definition at line 9 of file Tree.java.

Definition at line 36 of file XmlTree.java.

ListElement rene.util.list.Tree.Le [package, inherited]

Definition at line 10 of file Tree.java.

Tree rene.util.list.Tree.Parent [package, inherited]

Definition at line 11 of file Tree.java.


The documentation for this class was generated from the following file: