Class AbstractTransceiver
java.lang.Object
org.opentrafficsim.sim0mq.publisher.AbstractTransceiver
- All Implemented Interfaces:
org.djutils.base.Identifiable
,TransceiverInterface
- Direct Known Subclasses:
AbstractEventTransceiver
,AbstractIdTransceiver
,CrossSectionElementTransceiver
,LaneGtuIdTransceiver
,LinkGtuIdTransceiver
,LinkTransceiver
,NodeTransceiver
,Publisher
,SimulatorStateTransceiver
Common code for most implementations of TranceiverInterface.
Copyright (c) 2020-2024 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
ConstructorDescriptionAbstractTransceiver
(String id, org.djutils.metadata.MetaData addressFields, org.djutils.metadata.MetaData resultFields) Construct a new AbstractTransceiver. -
Method Summary
Modifier and TypeMethodDescriptionfinal org.djutils.metadata.MetaData
Specification of arguments needed in a request.final String
getId()
final org.djutils.metadata.MetaData
Report the specification of a result of the transceiver.toString()
static String
verifyMetaData
(org.djutils.metadata.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 Details
-
AbstractTransceiver
public AbstractTransceiver(String id, org.djutils.metadata.MetaData addressFields, org.djutils.metadata.MetaData resultFields) Construct a new AbstractTransceiver.- Parameters:
id
- String; the id of the new AbstractTransceiveraddressFields
- MetaData; description of the elements of an address that theget
method of this AbstractTransceiver can handleresultFields
- MetaData; description of the result of theget
method
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceorg.djutils.base.Identifiable
-
getAddressFields
public final org.djutils.metadata.MetaData getAddressFields()Specification of arguments needed in a request.- Specified by:
getAddressFields
in interfaceTransceiverInterface
- Returns:
- MetaData; the specification of arguments needed in a request
-
getResultFields
public final org.djutils.metadata.MetaData getResultFields()Report the specification of a result of the transceiver.- Specified by:
getResultFields
in interfaceTransceiverInterface
- Returns:
- MetaData; the specification of a result from the transceiver
-
verifyMetaData
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
-
toString
-