|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSim.Packet
public class Packet
Packet contains data that will be sent at the network layer.
Constructor Summary | |
---|---|
Packet(int source,
int dest,
int dataSize)
Constructs a new Packet, without a listener. |
|
Packet(int source,
int dest,
int dataSize,
PacketListener listener)
Constructs a new Packet. |
Method Summary | |
---|---|
int |
getDataSize()
|
int |
getDest()
|
int |
getSize()
Returns the size of the serialized form of this Packet in number of bytes. |
int |
getSource()
|
boolean |
hasArrived()
Reports true if this Packet has arrived at its destination at least once. |
void |
reportArrival(double time)
Tells a Packet that it has arrived at its destination at the given time. |
void |
reportHop(double d)
reports when this packet has gone a hop; |
void |
reportSent(double time)
Tells a Packet that it has been introduced to a Node for sending. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Packet(int source, int dest, int dataSize, PacketListener listener)
source
- source Node addressdest
- destination Node addressdataSize
- size of the user data segment of this packetlistener
- nullable listener to receive events.public Packet(int source, int dest, int dataSize)
source
- source Node addressdest
- destination Node addressdataSize
- size of the user data segment of this packetMethod Detail |
---|
public void reportSent(double time)
time
- Time of originationpublic void reportArrival(double time)
time
- Time of arrival, must be greater than or equal to time reported in
reportSent(double)
.public void reportHop(double d)
public boolean hasArrived()
public int getSource()
public int getDest()
public int getSize()
public int getDataSize()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |