Package it.polito.appeal.traci.protocol
Class RequestMessage
- java.lang.Object
-
- it.polito.appeal.traci.protocol.RequestMessage
-
public class RequestMessage extends Object
Represents a TraCI messages used to sendCommand
s from the client to server (i.e. requests). After construction, the commands are appended one after one withappend(Command)
. The whole message, along with its length header, can be then retrieved in a serialized form via thewriteTo(DataOutputStream)
method.- Author:
- Enrico Gueli <enrico.gueli@polito.it>
- See Also:
- TraCI/Protocol#Messages
-
-
Constructor Summary
Constructors Constructor Description RequestMessage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(Command c)
Adds a command to the tail of this message.List<Command>
commands()
void
writeTo(DataOutputStream dos)
Writes the commands to the specifiedDataOutputStream
object, in the same order as the calls ofappend(Command)
.
-
-
-
Method Detail
-
append
public void append(Command c)
Adds a command to the tail of this message.- Parameters:
c
- c- Throws:
NullPointerException
- if the command isnull
.
-
writeTo
public void writeTo(DataOutputStream dos) throws IOException
Writes the commands to the specifiedDataOutputStream
object, in the same order as the calls ofappend(Command)
.- Parameters:
dos
- data output stream- Throws:
IOException
- Exception
-
-