Class ByteTraciWriter
java.lang.Object
org.eclipse.mosaic.fed.sumo.bridge.traci.writer.AbstractTraciParameterWriter<Integer>
org.eclipse.mosaic.fed.sumo.bridge.traci.writer.ByteTraciWriter
-
Field Summary
Fields inherited from class org.eclipse.mosaic.fed.sumo.bridge.traci.writer.AbstractTraciParameterWriter
value
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getVariableLength
(Integer argument) If the value of the parameter has a variable length depending on its actual value (e.g.void
write
(DataOutputStream out) Writes the predefined, constant command parameter value to the givenDataOutputStream
.void
writeVariableArgument
(DataOutputStream out, Integer argument) Writes the given variable command parameter value to the givenDataOutputStream
.Methods inherited from class org.eclipse.mosaic.fed.sumo.bridge.traci.writer.AbstractTraciParameterWriter
getLength, isVariable
-
Constructor Details
-
ByteTraciWriter
public ByteTraciWriter() -
ByteTraciWriter
public ByteTraciWriter(int value)
-
-
Method Details
-
getVariableLength
Description copied from class:AbstractTraciParameterWriter
If the value of the parameter has a variable length depending on its actual value (e.g. Strings), then this method must return the length in bytes based on the given argument.- Specified by:
getVariableLength
in classAbstractTraciParameterWriter<Integer>
- Parameters:
argument
- the argument to calculate the length in bytes from.- Returns:
- the length in bytes of this command parameter.
-
write
Description copied from class:AbstractTraciParameterWriter
Writes the predefined, constant command parameter value to the givenDataOutputStream
.- Specified by:
write
in classAbstractTraciParameterWriter<Integer>
- Parameters:
out
- theDataOutputStream
to write the actual bytes to- Throws:
IOException
- if something went wrong during writing
-
writeVariableArgument
Description copied from class:AbstractTraciParameterWriter
Writes the given variable command parameter value to the givenDataOutputStream
.- Specified by:
writeVariableArgument
in classAbstractTraciParameterWriter<Integer>
- Parameters:
out
- theDataOutputStream
to write the actual bytes toargument
- the actual value to write to theDataOutputStream
- Throws:
IOException
- if something went wrong during writing
-