|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeer2me.node.Node
public class Node
A simple class for storing information
about a node, based on a NetworkNode
.
Contains also statistics regarding ping/eche detection
Constructor Summary | |
---|---|
Node(NetworkNode networkNode)
Intanciates a new Node based on a NetworkNode |
Method Summary | |
---|---|
java.lang.String |
getAddress()
Gets the address of the node |
int |
getEcho()
Gets the number of pings the node has responded to; number of echoes. |
NetworkNode |
getNetworkNode()
Gets the NetworkNode the node
is based on. |
java.lang.String |
getNodename()
Gets the name of the node |
int |
getPing()
Gets the number of ping-messages sent by the node |
void |
incrementEcho()
Increments the echo-counter by 1 |
void |
incrementPing()
Increments the ping-counter by 1 |
boolean |
isNodeAbscent()
Compares the number of pings sent and echoes received, comparing to see if the difference is larger than MAX_DIFF . |
java.lang.String |
toString()
Returns the name of the node and its address |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Node(NetworkNode networkNode)
NetworkNode
networkNode
- the object node is based onMethod Detail |
---|
public java.lang.String getAddress()
public java.lang.String getNodename()
public NetworkNode getNetworkNode()
NetworkNode
the node
is based on.
public java.lang.String toString()
toString
in class java.lang.Object
public int getEcho()
public void incrementEcho()
public int getPing()
public void incrementPing()
public boolean isNodeAbscent()
MAX_DIFF
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |