|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcore.NetworkLayer
public class NetworkLayer
Network layer of a DTNHost. Takes care of connectivity among hosts.
| Constructor Summary | |
|---|---|
NetworkLayer(DTNHost host,
java.util.List<ConnectionListener> cListeners,
double transmitRange,
int transmitSpeed)
Constructor. |
|
| Method Summary | |
|---|---|
void |
connect(DTNHost anotherHost)
Tries to connect this host to another host. |
void |
createConnection(DTNHost anotherHost)
Creates a connection to another host. |
void |
destroyConnection(DTNHost anotherHost)
Disconnect a connection between this and another host. |
int |
getAddress()
Returns the network layer address. |
java.util.List<Connection> |
getConnections()
Returns a list of currently connected connections |
double |
getTransmitRange()
Returns the transmit range of this network layer |
int |
getTransmitSpeed()
Returns the transmit speed of this network layer |
static void |
reset()
Resets the static fields of the class |
java.lang.String |
toString()
Returns a string representation of the object. |
void |
update()
Updates the state of current connections (i.e. tears down connections that are out of range). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NetworkLayer(DTNHost host,
java.util.List<ConnectionListener> cListeners,
double transmitRange,
int transmitSpeed)
host - The host where this network layer iscListeners - ConnectionListenerstransmitRange - Transmit range of the radiotransmitSpeed - Transmit speed of the radio| Method Detail |
|---|
public int getAddress()
public double getTransmitRange()
public int getTransmitSpeed()
public java.util.List<Connection> getConnections()
public void connect(DTNHost anotherHost)
anotherHost - The host to try to connect topublic void createConnection(DTNHost anotherHost)
connect(DTNHost)).
anotherHost - The host to create the connection topublic void destroyConnection(DTNHost anotherHost)
anotherHost - The host to disconnect from this hostpublic void update()
public java.lang.String toString()
toString in class java.lang.Objectpublic static void reset()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||