|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.DTNHost
test.TestDTNHost
public class TestDTNHost
A test stub of DTNHost for testing. All fields are public so they can be easily read from test cases.
Field Summary | |
---|---|
int |
abortedBytesRemaining
|
DTNHost |
abortedFrom
|
java.lang.String |
abortedId
|
double |
lastUpdate
|
int |
nrofConnect
|
int |
nrofUpdate
|
DTNHost |
recvFrom
|
Message |
recvMessage
|
DTNHost |
transferredFrom
|
java.lang.String |
transferredId
|
Constructor Summary | |
---|---|
TestDTNHost()
|
Method Summary | |
---|---|
void |
connect(DTNHost anotherHost)
Creates a connection to another host (if it is within range) |
void |
messageAborted(java.lang.String id,
DTNHost from,
int bytesRemaining)
Informs the host that a message transfer was aborted. |
void |
messageTransferred(java.lang.String id,
DTNHost from)
Informs the host that a message was successfully transferred. |
int |
receiveMessage(Message m,
DTNHost from)
Start receiving a message from another host |
void |
update()
Updates node's network layer and router. |
Methods inherited from class core.DTNHost |
---|
changedConnection, compareTo, createNewMessage, deleteMessage, equals, forceConnection, getAddress, getBufferOccupancy, getConnections, getCurCell, getLocation, getMessageCollection, getNrofMessages, getPath, getRouter, getRoutingInfo, getTransmitRange, getTransmitSpeed, isActive, move, requestDeliverableMessages, sendMessage, setCurCell, setLocation, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double lastUpdate
public int nrofConnect
public int nrofUpdate
public Message recvMessage
public DTNHost recvFrom
public java.lang.String abortedId
public DTNHost abortedFrom
public int abortedBytesRemaining
public java.lang.String transferredId
public DTNHost transferredFrom
Constructor Detail |
---|
public TestDTNHost()
Method Detail |
---|
public void connect(DTNHost anotherHost)
DTNHost
connect
in class DTNHost
public void update()
DTNHost
update
in class DTNHost
public int receiveMessage(Message m, DTNHost from)
DTNHost
receiveMessage
in class DTNHost
m
- The messagefrom
- Who the message is from
MessageRouter.receiveMessage(Message, DTNHost)
public void messageAborted(java.lang.String id, DTNHost from, int bytesRemaining)
DTNHost
messageAborted
in class DTNHost
id
- Identifier of the messagefrom
- From who the message was frombytesRemaining
- Nrof bytes that were left before the transfer
would have been ready; or -1 if the number of bytes is not knownpublic void messageTransferred(java.lang.String id, DTNHost from)
DTNHost
messageTransferred
in class DTNHost
id
- Identifier of the messagefrom
- From who the message was from
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |