public class Tree<T> extends Node<T>
root +- child1 | +- grandchild +- child2
| Modifier and Type | Class and Description |
|---|---|
static interface |
Tree.Converter<T>
Interface to convert node values to string
|
| Constructor and Description |
|---|
Tree(T root)
Creates a new tree with the given root node
|
| Modifier and Type | Method and Description |
|---|---|
void |
write(PrintStream stream)
Write the tree to a PrintStream, using the default toString() method to output the node values
|
void |
write(PrintStream stream,
Tree.Converter<T> converter)
Write the tree to a PrintStream, using the provided converter to output the node values
|
void |
write(PrintWriter writer)
Write the tree to a PrintWriter, using the default toString() method to output the node values
|
void |
write(PrintWriter writer,
Tree.Converter<T> converter)
Write the tree to a PrintWriter, using the provided converter to output the node values
|
addChild, flatten, getChildren, getValue, hasAncestor, writepublic Tree(T root)
root - the root nodepublic void write(PrintStream stream)
stream - public void write(PrintStream stream, Tree.Converter<T> converter)
stream - converter - public void write(PrintWriter writer)
writer - public void write(PrintWriter writer, Tree.Converter<T> converter)
writer - converter - Copyright © 2007-2014 FuseSource, Corp.. All Rights Reserved.