public class CodedTree extends Object
This class is not synchronized. If synchronization is required, it must be applied externally.
Modifier and Type | Class and Description |
---|---|
static class |
CodedTree.Node
This inner class represents a node in a coded tree.
|
Constructor and Description |
---|
CodedTree()
Constructs an empty coded tree.
|
CodedTree(CodedTree.Node... nodes)
Constructs a coded tree with the specified root nodes.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
List<CodedTree.Node> |
getNodes()
Returns a reference to the list of "root" nodes in this tree.
|
int |
hashCode() |
int |
nodeCount()
Returns the number of "root" nodes for this tree.
|
String |
toString() |
static CodedTree |
valueOf(String s)
Creates a coded tree from a string representation.
|
public CodedTree()
public CodedTree(CodedTree.Node... nodes)
nodes
- the root nodespublic int nodeCount()
public List<CodedTree.Node> getNodes()
public static CodedTree valueOf(String s)
CodedTree tree = ... ; String s = tree.toString(); CodedTree copy = CodedTree.valueOf(s); assert(copy.equals(tree));
s
- the string representationCopyright © 2016. All Rights Reserved.