Class JunctionGetPosition
- java.lang.Object
-
- org.eclipse.mosaic.fed.sumo.bridge.traci.AbstractTraciCommand<Position>
-
- org.eclipse.mosaic.fed.sumo.bridge.traci.JunctionGetPosition
-
- All Implemented Interfaces:
JunctionGetPosition
public class JunctionGetPosition extends AbstractTraciCommand<Position> implements JunctionGetPosition
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.mosaic.fed.sumo.bridge.traci.AbstractTraciCommand
AbstractTraciCommand.TraciCommandResultReaderBuilder, AbstractTraciCommand.TraciCommandWriterBuilder
-
-
Constructor Summary
Constructors Constructor Description JunctionGetPosition()
Creates a newJunctionGetPosition
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Position
constructResult(Status status, Object... objects)
This method is called during reading the command response when all readers have been executed.Position
execute(Bridge bridge, String junctionId)
This method executes the command with the given arguments and returns the position of the junction.-
Methods inherited from class org.eclipse.mosaic.fed.sumo.bridge.traci.AbstractTraciCommand
execute, executeAndReturn, executeAndReturnList, read, write
-
-
-
-
Constructor Detail
-
JunctionGetPosition
public JunctionGetPosition()
Creates a newJunctionGetPosition
object. Access needs to be public, because command is called using Reflection.
-
-
Method Detail
-
execute
public Position execute(Bridge bridge, String junctionId) throws CommandException, InternalFederateException
This method executes the command with the given arguments and returns the position of the junction.- Specified by:
execute
in interfaceJunctionGetPosition
- Parameters:
bridge
- Connection to SUMO.junctionId
- Id of the junction- Returns:
- Position of the junction.
- Throws:
CommandException
- if the status code of the response is ERROR. The connection to SUMO is still available.InternalFederateException
- if some serious error occurs during writing or reading. The TraCI connection is shut down.
-
constructResult
protected Position constructResult(Status status, Object... objects)
Description copied from class:AbstractTraciCommand
This method is called during reading the command response when all readers have been executed. The results of the readers are passed to this method.- Specified by:
constructResult
in classAbstractTraciCommand<Position>
- Parameters:
status
- the status of the responseobjects
- the objects created by the configured readers- Returns:
- the final result constructed from the passed objects
-
-