[all packages] [package net.sf.pizzacompiler.contrib] [class hierarchy] [index]

public class net.sf.pizzacompiler.contrib.SortedMultiTree<A>

(source file: /home/enno/source/tmp/pizza/main/src/net/sf/pizzacompiler/contrib/SortedMultiTree.pizza)
java.lang.Object
   |
   +----net.sf.pizzacompiler.contrib.SortedMultiTree<A>

The pure class interface.
public class SortedMultiTree<A>
Tree with sorted multiple childs. Each branch stores a value and can have several subbranches.

See also:
MultiTree, SortedVector

Constuctor Index

O SortedMultiTree((SortedMultiTree<A>, SortedMultiTree<A>) -> int, A)
Creates a root with a content.
O SortedMultiTree((SortedMultiTree<A>, SortedMultiTree<A>) -> int)
Creates an empty root

Methods

O childAt(int)
Returns the subbranch at position i.
O children()
Returns the number of subbranches.
O getContent()
Returns the content of a branch.
O insert(A)
Inserts a new branch with a content to this branch and returns the new branch object.
O print(PrintStream, String)
Prints the tree to the stream p and indents the elements of subbranches with
O setContent(A)
Sets a new content for this branch.

Constructors

O SortedMultiTree
public SortedMultiTree((SortedMultiTree<A>, SortedMultiTree<A>) -> int compareIt);
Creates an empty root. This tree will use the comparison of compareIt.

 int compareString(String s1, String s2)
 {
     return s1.compareTo(s2);
 }
 ...
   SortedMultiTree tree = new SortedMultiTree(compareString);

O SortedMultiTree

public SortedMultiTree((SortedMultiTree<A>, SortedMultiTree<A>) -> int compareIt,
                       A content);
Creates a root with a content.

Methods

O insert
public SortedMultiTree<A> insert(A content);
Inserts a new branch with a content to this branch and returns the new branch object.

Returns:
the new branch

O setContent

public void setContent(A content);
Sets a new content for this branch.

O children

public int children();
Returns the number of subbranches.

O childAt

public SortedMultiTree<A> childAt(int i);
Returns the subbranch at position i.

O getContent

public A getContent();
Returns the content of a branch.

O print

public void print(PrintStream p,
                  String header);
Prints the tree to the stream p and indents the elements of subbranches with header


[all packages] [package net.sf.pizzacompiler.contrib] [class hierarchy] [index]
net.sf.pizzacompiler.contrib.SortedMultiTree.html