[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
- SortedMultiTree((SortedMultiTree<A>, SortedMultiTree<A>) -> int, A)
-
Creates a root with a content.
- SortedMultiTree((SortedMultiTree<A>, SortedMultiTree<A>) -> int)
-
Creates an empty root
- childAt(int)
-
Returns the subbranch at position
i
.
- children()
-
Returns the number of subbranches.
- getContent()
-
Returns the content of a branch.
- insert(A)
-
Inserts a new branch with a content to this branch and
returns the new branch object.
- print(PrintStream, String)
-
Prints the tree to the stream
p
and
indents the elements of subbranches with
- setContent(A)
-
Sets a new content for this branch.
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);
SortedMultiTree
public SortedMultiTree((SortedMultiTree<A>, SortedMultiTree<A>) -> int compareIt,
A content);
-
Creates a root with a content.
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
setContent
public void setContent(A content);
-
Sets a new content for this branch.
children
public int children();
-
Returns the number of subbranches.
childAt
public SortedMultiTree<A> childAt(int i);
-
Returns the subbranch at position
i
.
getContent
public A getContent();
-
Returns the content of a branch.
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