View Javadoc
1   package org.opentrafficsim.sim0mq.publisher;
2   
3   import org.djutils.immutablecollections.Immutable;
4   import org.djutils.immutablecollections.ImmutableLinkedHashSet;
5   import org.djutils.immutablecollections.ImmutableSet;
6   import org.opentrafficsim.core.gtu.Gtu;
7   import org.opentrafficsim.core.network.Network;
8   
9   /**
10   * Transceiver for GTU ids.
11   * <p>
12   * Copyright (c) 2020-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
13   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
14   * </p>
15   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
16   * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
17   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
18   */
19  public class GtuIdTransceiver extends AbstractIdTransceiver
20  {
21      /**
22       * Construct a GtuIdTransceiver.
23       * @param network Network; the OTS network
24       */
25      public GtuIdTransceiver(final Network network)
26      {
27          super(network, "GTU id transceiver");
28      }
29  
30      /** {@inheritDoc} */
31      @Override
32      ImmutableSet<Gtu> getSet()
33      {
34          return new ImmutableLinkedHashSet<Gtu>(getNetwork().getGTUs(), Immutable.WRAP);
35      }
36  
37      /** {@inheritDoc} */
38      @Override
39      public String toString()
40      {
41          return "GtuIdTransceiver [network=" + getNetwork().getId() + ", super=" + super.toString() + "]";
42      }
43  
44  }