public class Node extends Object implements Comparable<Node>
Modifier and Type | Method and Description |
---|---|
boolean |
addChild(Node child)
Add a child node to this node.
|
int |
compareTo(Node o) |
boolean |
equals(Object obj) |
Set<Node> |
getChildren()
Get the children of this node.
|
int |
getLevel()
Get the level of the node.
|
String |
getName()
Get the name of the node.
|
Node |
getParent()
Get the parent node.
|
boolean |
hasChildren()
Does this node have any children?
|
int |
hashCode() |
String |
toString() |
public Node(String name, int level)
name
- A unique name to identify a node in the cluster.level
- The level of the node in the clusterpublic String getName()
public int getLevel()
public boolean addChild(Node child)
child
- The child node to be added. The child node should currently not be belong to another cluster topology.public boolean hasChildren()
public Set<Node> getChildren()
public Node getParent()
public int compareTo(Node o)
compareTo
in interface Comparable<Node>
Copyright © 2013 Apache Software Foundation. All rights reserved.