public class NetworkNode extends Object implements IOReadableWritable
| Modifier | Constructor and Description |
|---|---|
protected |
NetworkNode(String name,
NetworkNode parentNode,
NetworkTopology networkTopology) |
| Modifier and Type | Method and Description |
|---|---|
NetworkNode |
getChildNode(int index) |
int |
getDepth() |
int |
getDistance(NetworkNode networkNode)
Determines the distance to the given network node.
|
int |
getDistance(String nodeName) |
int |
getHeight() |
String |
getName() |
NetworkTopology |
getNetworkTopology()
Returns the network topology that is associated with this network node.
|
int |
getNumberOfChildNodes() |
NetworkNode |
getParentNode() |
boolean |
isLeafNode() |
boolean |
isRootNode() |
void |
read(DataInputView in) |
void |
remove() |
String |
toString() |
void |
write(DataOutputView out) |
protected NetworkNode(String name, NetworkNode parentNode, NetworkTopology networkTopology)
public void remove()
public boolean isRootNode()
public boolean isLeafNode()
public String getName()
public int getDepth()
public int getHeight()
public int getNumberOfChildNodes()
public NetworkNode getChildNode(int index)
public NetworkNode getParentNode()
public NetworkTopology getNetworkTopology()
public int getDistance(NetworkNode networkNode)
networkNode - the node to determine the distance forInteger.MAX_VALUE if the given node is not part of
this node's network topologypublic int getDistance(String nodeName)
public void read(DataInputView in) throws IOException
read in interface IOReadableWritableIOExceptionpublic void write(DataOutputView out) throws IOException
write in interface IOReadableWritableIOExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.