View Javadoc
1   package org.opentrafficsim.animation.data;
2   
3   import org.opentrafficsim.draw.road.TrafficLightDetectorAnimation.TrafficLightDetectorData;
4   import org.opentrafficsim.road.network.lane.object.detector.TrafficLightDetector;
5   
6   /**
7    * Animation data of a TrafficLightDetector.
8    * <p>
9    * Copyright (c) 2023-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
10   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
11   * </p>
12   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
13   */
14  public class AnimationTrafficLightDetectorData extends AnimationIdentifiableShape<TrafficLightDetector>
15          implements TrafficLightDetectorData
16  {
17  
18      /**
19       * Constructor.
20       * @param trafficLigthDetector traffic light detector.
21       */
22      public AnimationTrafficLightDetectorData(final TrafficLightDetector trafficLigthDetector)
23      {
24          super(trafficLigthDetector);
25      }
26  
27      @Override
28      public boolean getOccupancy()
29      {
30          return getObject().getOccupancy();
31      }
32  
33      @Override
34      public String toString()
35      {
36          return "Traffic light detector " + getId();
37      }
38  
39  }