Class LinkTransceiver
- java.lang.Object
-
- org.opentrafficsim.sim0mq.publisher.AbstractTransceiver
-
- org.opentrafficsim.sim0mq.publisher.LinkTransceiver
-
- All Implemented Interfaces:
Identifiable,TransceiverInterface
public class LinkTransceiver extends AbstractTransceiver
Transceiver for Link data.Copyright (c) 2020-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description LinkTransceiver(OTSNetwork network, LinkIdTransceiver linkIdSource)Construct a new LinkTransceiver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]get(Object[] address, ReturnWrapper returnWrapper)Retrieve the data.TransceiverInterfacegetIdSource(int addressLevel, ReturnWrapper returnWrapper)Retrieve the TransceiverInterface that can be used to get detailed information about a single object.booleanhasIdSource()Report if this transceiver has an id source.StringtoString()-
Methods inherited from class org.opentrafficsim.sim0mq.publisher.AbstractTransceiver
getAddressFields, getId, getResultFields, verifyMetaData
-
-
-
-
Constructor Detail
-
LinkTransceiver
public LinkTransceiver(OTSNetwork network, LinkIdTransceiver linkIdSource)
Construct a new LinkTransceiver.- Parameters:
network- OTSNetwork; the networklinkIdSource- LinkIdTransceiver; the transceiver that can produce all Link ids in the Network
-
-
Method Detail
-
get
public Object[] get(Object[] address, ReturnWrapper returnWrapper) throws RemoteException, Sim0MQException, SerializationException
Retrieve the data.- Parameters:
address- Object[]; the address of the data to retrievereturnWrapper- ReturnWrapper; to be used to report problems- Returns:
- Object[]; the retrieved data, or null when no object with the address could be found
- Throws:
RemoteException- when communication needed to retrieve the data failedSim0MQException- when encoding an error message failsSerializationException- when encoding an error message fails
-
getIdSource
public TransceiverInterface getIdSource(int addressLevel, ReturnWrapper returnWrapper) throws Sim0MQException, SerializationException
Retrieve the TransceiverInterface that can be used to get detailed information about a single object.- Parameters:
addressLevel- int; index of the argument in the address fieldsreturnWrapper- ReturnWrapper; to be used to report problems- Returns:
- TransceiverInterface; to be used to get valid values for argument
addressLevel, or null if valid values for the argument at indexaddressLevelcan not be obtained through a TransceiverInterface object - Throws:
Sim0MQException- when the ReturnWrapper failsSerializationException- when the ReturnWrapper fails
-
hasIdSource
public boolean hasIdSource()
Report if this transceiver has an id source.- Returns:
- boolean; true if this transceiver has an id source; false if this transceiver does not have an id source
-
toString
public String toString()
- Overrides:
toStringin classAbstractTransceiver
-
-