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 -
Method Summary
Modifier and TypeMethodDescriptionprotected Position
constructResult
(Status status, Object... objects) This method is called during reading the command response when all readers have been executed.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 Details
-
JunctionGetPosition
public JunctionGetPosition()Creates a newJunctionGetPosition
object. Access needs to be public, because command is called using Reflection.
-
-
Method Details
-
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
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
-