|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpeersim.core.GeneralNode
public class GeneralNode
This is the default Node class that is used to compose the
Network.
| Parameter Summary |
|---|
| Parameters inherited from interface peersim.core.Node |
|---|
protocol |
| Field Summary | |
|---|---|
protected int |
failstate
The fail state of the node. |
protected Protocol[] |
protocol
The protocols on this node. |
| Fields inherited from interface peersim.core.Fallible |
|---|
DEAD, DOWN, OK |
| Constructor Summary | |
|---|---|
GeneralNode(java.lang.String prefix)
Used to construct the prototype node. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clones the node. |
int |
getFailState()
Returns the state of this object. |
long |
getID()
Returns the ID of this node. |
int |
getIndex()
Returns the index of this node. |
Protocol |
getProtocol(int i)
Returns the i-th protocol in this node. |
int |
hashCode()
Implemented as (int)getID(). |
boolean |
isUp()
Convenience method to check if the node is up and running |
int |
protocolSize()
Returns the number of protocols included in this node. |
void |
setFailState(int failState)
Sets the fails state of this object. |
void |
setIndex(int index)
Sets the index of this node in the internal representation of the node list. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Protocol[] protocol
protected int failstate
| Constructor Detail |
|---|
public GeneralNode(java.lang.String prefix)
prefix is not used. It reads the protocol components
(components that have type "protocol") from
the configuration.
| Method Detail |
|---|
public java.lang.Object clone()
Nodethrows clause.
clone in interface Nodeclone in class java.lang.Objectpublic void setFailState(int failState)
FallibleFallible.
setFailState in interface Falliblepublic int getFailState()
FallibleFallible.
getFailState in interface Falliblepublic boolean isUp()
Fallible
isUp in interface FalliblegetFailState()==OKpublic Protocol getProtocol(int i)
Nodei-th protocol in this node. If i
is not a valid protocol id
(negative or larger than or equal to the number of protocols), then it throws
IndexOutOfBoundsException.
getProtocol in interface Nodepublic int protocolSize()
Node
protocolSize in interface Nodepublic int getIndex()
NodeNetwork.get(n.getIndex()) returns n. This index can
change during a simulation, it is not a fixed id. If you need that, use
Node.getID().
getIndex in interface NodeNetwork.get(int)public void setIndex(int index)
Node
setIndex in interface Nodepublic long getID()
getID in interface Nodepublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
(int)getID().
hashCode in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||