public abstract class Proxy2RealAdapter extends Object
| Constructor and Description |
|---|
Proxy2RealAdapter() |
| Modifier and Type | Method and Description |
|---|---|
static DataOutputStream |
getDosWithHeader(ByteArrayOutputStream baos,
double currentTime,
UdpHeader.UdpMessageType type)
Builds a header for the type of this message, and writes it to a new
DataOutputStream wrapped around a given ByteArrayOutputStream
|
static DatagramPacket |
toDatagramPacket(Confirm msg,
SocketAddress sa,
double currentTime)
Construct a DatagramPacket of this confirm message
|
static DatagramPacket |
toDatagramPacket(double distToFrontVehicle,
SocketAddress sa,
double currentTime)
Construct a DatagramPacket of this confirm message
|
static DatagramPacket |
toDatagramPacket(Reject msg,
SocketAddress sa,
double currentTime)
Construct a DatagramPacket of this reject message
|
public static DatagramPacket toDatagramPacket(Confirm msg, SocketAddress sa, double currentTime) throws IOException
sa - SocketAddress of the intended destination of the
datagramcurrentTime - absolute time in secondsIOExceptionpublic static DatagramPacket toDatagramPacket(Reject msg, SocketAddress sa, double currentTime) throws IOException
sa - SocketAddress of the intended destination of the
datagramcurrentTime - absolute time in secondsIOExceptionpublic static DatagramPacket toDatagramPacket(double distToFrontVehicle, SocketAddress sa, double currentTime) throws IOException
distToFrontVehicle - the distance of the vehicles in frontsa - SocketAddress of the intended destination of the
datagramcurrentTime - absolute time in secondsIOExceptionpublic static DataOutputStream getDosWithHeader(ByteArrayOutputStream baos, double currentTime, UdpHeader.UdpMessageType type) throws IOException
baos - The ByteArrayOutputStreamcurrentTime - The current, absolute time in secondsIOExceptionCopyright © 2013. All rights reserved.