|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object example.newscast.SimpleNewscast
public class SimpleNewscast
This class represents the information stored by a node in the simplified newscast system (i.e., used just as a topology manager)
Parameter Summary | |
---|---|
cache
Cache size. |
Constructor Summary | |
---|---|
SimpleNewscast(java.lang.String n)
|
Method Summary | |
---|---|
boolean |
addNeighbor(Node node)
Add a neighbor to the current set of neighbors. |
java.lang.Object |
clone()
Returns a clone of the protocol. |
boolean |
contains(Node n)
Returns true if the given node is a member of the neighbor set. |
int |
degree()
Might be less than cache size. |
Node |
getNeighbor(int i)
Does not check if the index is out of bound (larger than degree() ) |
void |
nextCycle(Node n,
int protocolID)
A protocol which is defined by performing an algorithm in more or less regular periodic intervals. |
void |
onKill()
Performs cleanup when removed from the network. |
void |
pack()
A possibility for optimization. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Parameter Detail |
---|
cache
Constructor Detail |
---|
public SimpleNewscast(java.lang.String n)
Method Detail |
---|
public java.lang.Object clone()
Protocol
Control
s.
clone
in interface Protocol
clone
in class java.lang.Object
public Node getNeighbor(int i)
degree()
)
getNeighbor
in interface Linkable
public int degree()
degree
in interface Linkable
public boolean addNeighbor(Node node)
Linkable
addNeighbor
in interface Linkable
public void pack()
Linkable
pack
in interface Linkable
public boolean contains(Node n)
Linkable
contains
in interface Linkable
public void onKill()
Cleanable
Fallible.DEAD
.
It is very important that after calling this method, NONE of the methods
of the implementing object are guaranteed to work any longer.
They might throw arbitrary exceptions, etc. The idea is that after
calling this, typically no one should access this object.
However, as a recommendation, at least toString should be guaranteed to
execute normally, to aid debugging.
onKill
in interface Cleanable
public void nextCycle(Node n, int protocolID)
CDProtocol
nextCycle
in interface CDProtocol
n
- the node on which this component is runprotocolID
- the id of this protocol in the protocol arraypublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |