neosim.implementation
Class SourceMethodImpl

java.lang.Object
  |
  +--neosim.implementation.SourceMethodImpl

public class SourceMethodImpl
extends java.lang.Object
implements SourceMethod

Connect from a specified output port to (potentially) all entities in destination population. This is the superclass for user source methods.

See Also:
Serialized Form

Field Summary
protected  PortID srcPort
           
 
Constructor Summary
SourceMethodImpl(PortID srcPort)
           
 
Method Summary
 void bcastRequest(Entity srce, Population destPop, ConnectionRequest cr)
          THIS METHOD CAN BE CALLED FROM WITHIN sendRequests() ABOVE.
 void sendRequest(Entity srce, EntityID deste, ConnectionRequest cr)
          THIS METHOD CAN BE CALLED FROM WITHIN sendRequests() ABOVE.
 void sendRequests(Entity srce, Population destPop, DestMethod dm)
          THIS METHOD SHOULD BE OVERRIDDEN BY DIFFERENT SOURCE METHODS.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

srcPort

protected PortID srcPort
Constructor Detail

SourceMethodImpl

public SourceMethodImpl(PortID srcPort)
Method Detail

sendRequests

public void sendRequests(Entity srce,
                         Population destPop,
                         DestMethod dm)
Description copied from interface: SourceMethod
THIS METHOD SHOULD BE OVERRIDDEN BY DIFFERENT SOURCE METHODS. The sendRequests method checks the source entity's details and sends connection requests to individual destination entities (using sendRequest) or to all members of a population (using bcastRequest).
Specified by:
sendRequests in interface SourceMethod
Tags copied from interface: SourceMethod
Parameters:
srce - the source entity
destPop - the destination Population
dm - the destination method to handle requests at the far end

sendRequest

public final void sendRequest(Entity srce,
                              EntityID deste,
                              ConnectionRequest cr)
Description copied from interface: SourceMethod
THIS METHOD CAN BE CALLED FROM WITHIN sendRequests() ABOVE. The sendRequest method sends an individual connection request to a destination entity
Specified by:
sendRequest in interface SourceMethod
Tags copied from interface: SourceMethod
Parameters:
srce - the source entity
deste - the handle of the destination entity
cr - the connection request

bcastRequest

public final void bcastRequest(Entity srce,
                               Population destPop,
                               ConnectionRequest cr)
Description copied from interface: SourceMethod
THIS METHOD CAN BE CALLED FROM WITHIN sendRequests() ABOVE. The bcastRequest method sends an identical request to all members of a destination population
Specified by:
bcastRequest in interface SourceMethod
Tags copied from interface: SourceMethod
Parameters:
srce - the source entity
destpop - the population to connect to
cr - the connection request