|
From: <dir...@us...> - 2010-05-10 09:29:55
|
Revision: 2112
http://shox.svn.sourceforge.net/shox/?rev=2112&view=rev
Author: dirk_held
Date: 2010-05-10 09:29:49 +0000 (Mon, 10 May 2010)
Log Message:
-----------
Add two new default constructors, which add also a supplied link to the packet.
Modified Paths:
--------------
trunk/src/net/sf/shox/simulator/event/LogLinkPacket.java
Modified: trunk/src/net/sf/shox/simulator/event/LogLinkPacket.java
===================================================================
--- trunk/src/net/sf/shox/simulator/event/LogLinkPacket.java 2010-05-10 09:22:05 UTC (rev 2111)
+++ trunk/src/net/sf/shox/simulator/event/LogLinkPacket.java 2010-05-10 09:29:49 UTC (rev 2112)
@@ -52,7 +52,35 @@
}
/**
+ * Overloaded constructor to create non-terminal packets by
+ * specifying a packet to enclose and a link to use.
+ * ReceiverID of the new packet taken from enclosedPacket.
+ *
+ * @param sender Sender address of the packet
+ * @param packet The packet to enclose inside the new packet.
+ * @param link The link, containing also the ReceiverId of the packet.
+ */
+ public LogLinkPacket(Address sender, Packet packet, Link link) {
+ super(sender, packet);
+
+ addLink(link);
+ }
+
+ /**
* Default constructor of class Packet to create a terminal packet
+ * with no enclosed packet, but with a specified link.
+ *
+ * @param sender The sender address of the packet
+ * @param link The link, containing also the ReceiverId of the packet.
+ */
+ public LogLinkPacket(Address sender, Link link) {
+ super(sender, link.getV());
+
+ addLink(link);
+ }
+
+ /**
+ * Default constructor of class Packet to create a terminal packet
* with no enclosed packet.
* @param sender Sender address of the packet
* @param receiver ReceiverId of the packet
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|