|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.tum.cs.commons.tree.SimpleTreeNode<K>
K
- key used to identify children, e.g. String.public class SimpleTreeNode<K>
A simple node class that can be used with TreeUtils
. See
TreeUtilsTest
for an application of this class that uses strings as
keys.
Constructor Summary | |
---|---|
SimpleTreeNode(K key)
Create new node with specified key. |
Method Summary | |
---|---|
void |
addChild(SimpleTreeNode<K> child)
Add child. |
SimpleTreeNode<K> |
getChild(K key)
Get child with specified key. |
UnmodifiableCollection<SimpleTreeNode<K>> |
getChildren()
Get children of this node. |
K |
getKey()
Get key of this node. |
java.lang.String |
toString()
This returns a nicely indented representation of the whole tree below this node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleTreeNode(K key)
Method Detail |
---|
public SimpleTreeNode<K> getChild(K key)
null
if child
with provided key does not exist.
public void addChild(SimpleTreeNode<K> child)
public K getKey()
public UnmodifiableCollection<SimpleTreeNode<K>> getChildren()
public java.lang.String toString()
toString
in class java.lang.Object
|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |