java.lang.Comparable<Node>MachineNode, RackNodepublic class Node extends java.lang.Object implements java.lang.Comparable<Node>
| Constructor | Description |
|---|---|
Node(java.lang.String name,
int level) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
addChild(Node child) |
Add a child node to this node.
|
int |
compareTo(Node o) |
|
boolean |
equals(java.lang.Object obj) |
|
java.util.Set<Node> |
getChildren() |
Get the children of this node.
|
int |
getLevel() |
Get the level of the node.
|
java.lang.String |
getName() |
Get the name of the node.
|
Node |
getParent() |
Get the parent node.
|
boolean |
hasChildren() |
Does this node have any children?
|
int |
hashCode() |
|
java.lang.String |
toString() |
public Node(java.lang.String name,
int level)
name - A unique name to identify a node in the cluster.level - The level of the node in the clusterpublic java.lang.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 java.util.Set<Node> getChildren()
public Node getParent()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.