public class Node extends Object implements Comparable<Node>
限定符和类型 | 方法和说明 |
---|---|
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
在接口中 Comparable<Node>
Copyright © 2009 The Apache Software Foundation