|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object core.EventNotifier network.ChannelList
Contains a list of neighbors that can be channels to send a message through. FIFO replacement.
Constructor Summary | |
ChannelList(Neighbor neighbor,
java.lang.String virtualAddress,
java.util.Vector channelListeners)
Constructs a ChannelList with one neighbor and a display |
Method Summary | |
void |
add(Neighbor neighbor)
Add a reference of neighbor as one of the channels. |
void |
fireChannelAdded(java.lang.String virtualAddress,
Neighbor addedNeighbor)
|
void |
fireChannelRemoved(java.lang.String virtualAddress,
Neighbor removedNeighbor)
|
void |
fireSetChannelAdded(java.lang.String virtualAddress,
Neighbor addedNeighbor)
|
void |
fireSetChannelRemoved(java.lang.String virtualAddress,
Neighbor addedNeighbor)
|
Neighbor |
getChannel(Neighbor fromNeighbor)
Returns a random neighbor in the ChannelList. |
void |
print()
Print the channel list in a readable format. |
void |
remove(int index)
Removes the reference to a neighbor at the given index from the ChannelList. |
Methods inherited from class core.EventNotifier |
addListener, removeListener |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ChannelList(Neighbor neighbor, java.lang.String virtualAddress, java.util.Vector channelListeners)
neighbor
- The first neighbor in the ChannelList.Method Detail |
public void add(Neighbor neighbor)
neighbor
- The Neighbor to be added.public void remove(int index)
index
- The index of the neighbor to remove.public Neighbor getChannel(Neighbor fromNeighbor)
public void print()
public void fireChannelRemoved(java.lang.String virtualAddress, Neighbor removedNeighbor)
public void fireChannelAdded(java.lang.String virtualAddress, Neighbor addedNeighbor)
public void fireSetChannelRemoved(java.lang.String virtualAddress, Neighbor addedNeighbor)
public void fireSetChannelAdded(java.lang.String virtualAddress, Neighbor addedNeighbor)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |