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

public abstract class AbstractTransceiver extends Object implements TransceiverInterface
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 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 AbstractTransceiver
      addressFields - MetaData; description of the elements of an address that the get method of this AbstractTransceiver can handle
      resultFields - MetaData; description of the result of the get method
  • Method Details

    • getId

      public final String getId()
      Specified by:
      getId in interface org.djutils.base.Identifiable
    • getAddressFields

      public final org.djutils.metadata.MetaData getAddressFields()
      Specification of arguments needed in a request.
      Specified by:
      getAddressFields in interface TransceiverInterface
      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 interface TransceiverInterface
      Returns:
      MetaData; the specification of a result from the transceiver
    • verifyMetaData

      public static String verifyMetaData(org.djutils.metadata.MetaData metaData, Object[] address)
      Verify the composition of an Object[].
      Parameters:
      metaData - MetaData; the expected composition
      address - Object[]; the object array that must be verified
      Returns:
      String; null if metaData is OK; descriptive text on error
    • toString

      public String toString()
      Overrides:
      toString in class Object