interfaces
Class SimpleBroadcastInterface

java.lang.Object
  extended by core.NetworkInterface
      extended by interfaces.SimpleBroadcastInterface
All Implemented Interfaces:
ModuleCommunicationListener

public class SimpleBroadcastInterface
extends NetworkInterface

A simple Network Interface that provides a constant bit-rate service, where one transmission can be on at a time.


Field Summary
 
Fields inherited from class core.NetworkInterface
connections, host, interfacetype, optimizer, RANGE_ID, SCAN_INTERVAL_ID, SCAN_INTERVAL_S, SPEED_ID, TRANSMIT_RANGE_S, TRANSMIT_SPEED_S, transmitRange, transmitSpeed
 
Constructor Summary
SimpleBroadcastInterface(Settings s)
          Reads the interface settings from the Settings file
SimpleBroadcastInterface(SimpleBroadcastInterface ni)
          Copy constructor
 
Method Summary
 void connect(NetworkInterface anotherInterface)
          Tries to connect this host to another host.
 void createConnection(NetworkInterface anotherInterface)
          Creates a connection to another host.
 NetworkInterface replicate()
          Replication function
 java.lang.String toString()
          Returns a string representation of the object.
 void update()
          Updates the state of current connections (ie tears down connections that are out of range).
 
Methods inherited from class core.NetworkInterface
connect, destroyConnection, disconnect, ensurePositiveValue, getAddress, getConnections, getHost, getInterfaceType, getLocation, getTransmitRange, getTransmitSpeed, isConnected, isScanning, isWithinRange, moduleValueChanged, reset, setClisteners, setHost
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleBroadcastInterface

public SimpleBroadcastInterface(Settings s)
Reads the interface settings from the Settings file


SimpleBroadcastInterface

public SimpleBroadcastInterface(SimpleBroadcastInterface ni)
Copy constructor

Parameters:
ni - the copied network interface object
Method Detail

replicate

public NetworkInterface replicate()
Description copied from class: NetworkInterface
Replication function

Specified by:
replicate in class NetworkInterface

connect

public void connect(NetworkInterface anotherInterface)
Tries to connect this host to another host. The other host must be active and within range of this host for the connection to succeed.

Specified by:
connect in class NetworkInterface
Parameters:
anotherInterface - The interface to connect to

update

public void update()
Updates the state of current connections (ie tears down connections that are out of range).

Specified by:
update in class NetworkInterface

createConnection

public void createConnection(NetworkInterface anotherInterface)
Creates a connection to another host. This method does not do any checks on whether the other node is in range or active

Specified by:
createConnection in class NetworkInterface
Parameters:
anotherInterface - The interface to create the connection to

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class NetworkInterface
Returns:
a string representation of the object.