|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.karaf.shell.dev.util.Node<T>
public class Node<T>
Represents a node in a Tree
Constructor Summary | |
---|---|
protected |
Node(T value)
Creates a new node. |
protected |
Node(T value,
Node<T> parent)
Creates a new node. |
Method Summary | |
---|---|
Node |
addChild(T value)
Adds a child to this node |
java.util.Set<T> |
flatten()
Give a set of values in the tree. |
java.util.List<Node<T>> |
getChildren()
Access the node's child nodes |
T |
getValue()
Access the node's value |
boolean |
hasAncestor(T value)
Check if the node has an ancestor that represents the given value |
protected void |
write(java.io.PrintWriter writer,
Tree.Converter<T> converter,
boolean... indents)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Node(T value)
addChild(Object)
method
value
- the node valueprotected Node(T value, Node<T> parent)
addChild(Object)
method
value
- the node valueMethod Detail |
---|
public T getValue()
public java.util.List<Node<T>> getChildren()
public Node addChild(T value)
value
- the child's value
public java.util.Set<T> flatten()
public boolean hasAncestor(T value)
value
- the node value
true
it there's an ancestor that represents the valueprotected void write(java.io.PrintWriter writer, Tree.Converter<T> converter, boolean... indents)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |