Class AbstractTransceiver
- java.lang.Object
-
- org.opentrafficsim.sim0mq.publisher.AbstractTransceiver
-
- All Implemented Interfaces:
Identifiable,TransceiverInterface
- Direct Known Subclasses:
AbstractEventTransceiver,AbstractIdTransceiver,CrossSectionElementTransceiver,LaneGTUIdTransceiver,LinkGTUIdTransceiver,LinkTransceiver,NodeTransceiver,Publisher,SimulatorStateTransceiver
public abstract class AbstractTransceiver extends Object implements TransceiverInterface
Common code for most implementations of TranceiverInterface.Copyright (c) 2020-2020 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 AbstractTransceiver(String id, MetaData addressFields, MetaData resultFields)Construct a new AbstractTransceiver.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MetaDatagetAddressFields()Specification of arguments needed in a request.StringgetId()MetaDatagetResultFields()Report the specification of a result of the transceiver.StringtoString()static StringverifyMetaData(MetaData metaData, Object[] address)Verify the composition of an Object[].-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opentrafficsim.sim0mq.publisher.TransceiverInterface
get, getIdSource, hasIdSource
-
-
-
-
Constructor Detail
-
AbstractTransceiver
public AbstractTransceiver(String id, MetaData addressFields, MetaData resultFields)
Construct a new AbstractTransceiver.- Parameters:
id- String; the id of the new AbstractTransceiveraddressFields- MetaData; description of the elements of an address that thegetmethod of this AbstractTransceiver can handleresultFields- MetaData; description of the result of thegetmethod
-
-
Method Detail
-
getId
public final String getId()
- Specified by:
getIdin interfaceIdentifiable
-
getAddressFields
public final MetaData getAddressFields()
Specification of arguments needed in a request.- Specified by:
getAddressFieldsin interfaceTransceiverInterface- Returns:
- MetaData; the specification of arguments needed in a request
-
getResultFields
public final MetaData getResultFields()
Report the specification of a result of the transceiver.- Specified by:
getResultFieldsin interfaceTransceiverInterface- Returns:
- MetaData; the specification of a result from the transceiver
-
verifyMetaData
public static String verifyMetaData(MetaData metaData, Object[] address)
Verify the composition of an Object[].- Parameters:
metaData- MetaData; the expected compositionaddress- Object[]; the object array that must be verified- Returns:
- String; null if metaData is OK; descriptive text on error
-
-