Back to index

wims  3.65+svn20090927
Public Member Functions | Package Attributes
rene.util.list.Tree Class Reference

A node with a list of children trees. More...

Inheritance diagram for rene.util.list.Tree:
Inheritance graph
[legend]
Collaboration diagram for rene.util.list.Tree:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Tree (Object o)
 initialize with an object and no children
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

ListClass Children
Object Content
ListElement Le
Tree Parent

Detailed Description

A node with a list of children trees.

Definition at line 7 of file Tree.java.


Constructor & Destructor Documentation

rene.util.list.Tree.Tree ( Object  o) [inline]

initialize with an object and no children

Definition at line 14 of file Tree.java.

       {      Content=o;
              Children=new ListClass();
              Le=null; Parent=null;
       }

Here is the caller graph for this function:


Member Function Documentation

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

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:

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]

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]

Definition at line 66 of file Tree.java.

{ Content=o; }

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:

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:

void rene.util.list.Tree.insertchild ( Tree  t) [inline]

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 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; }

Definition at line 63 of file Tree.java.

{ return Parent; }
void rene.util.list.Tree.remove ( Tree  t) [inline]

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]

remove all children

Definition at line 55 of file Tree.java.

Here is the call graph for this function:


Member Data Documentation

Definition at line 8 of file Tree.java.

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

Definition at line 9 of file Tree.java.

Definition at line 10 of file Tree.java.

Definition at line 11 of file Tree.java.


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