View Javadoc
1   package org.opentrafficsim.sim0mq.kpi;
2   
3   import nl.tudelft.simulation.language.d3.CartesianPoint;
4   
5   /**
6    * <p>
7    * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
8    * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
9    * </p>
10   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
11   * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
12   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
13   */
14  public class NodeDataDeprecated // implements NodeDataInterface
15  {
16  
17      /** Node name. */
18      private final String nodeName;
19  
20      /** position. */
21      private final CartesianPoint position;
22  
23      /**
24       * @param nodeName String; name of the node
25       * @param position CartesianPoint; position of the node
26       */
27      public NodeDataDeprecated(final String nodeName, final CartesianPoint position)
28      {
29          this.nodeName = nodeName;
30          this.position = position;
31      }
32  
33      /**
34       * @return nodeName
35       */
36      public final String getNodeName()
37      {
38          return this.nodeName;
39      }
40  
41      /**
42       * @return position
43       */
44      public final CartesianPoint getPosition()
45      {
46          return this.position;
47      }
48  
49      /** {@inheritDoc} */
50      // @Override
51      public String getId()
52      {
53          return this.nodeName;
54      }
55  
56      /** {@inheritDoc} */
57      @Override
58      public int hashCode()
59      {
60          final int prime = 31;
61          int result = 1;
62          result = prime * result + ((this.nodeName == null) ? 0 : this.nodeName.hashCode());
63          return result;
64      }
65  
66      /** {@inheritDoc} */
67      @Override
68      public boolean equals(final Object obj)
69      {
70          if (this == obj)
71              return true;
72          if (obj == null)
73              return false;
74          if (getClass() != obj.getClass())
75              return false;
76          NodeDataDeprecated other = (NodeDataDeprecated) obj;
77          if (this.nodeName == null)
78          {
79              if (other.nodeName != null)
80                  return false;
81          }
82          else if (!this.nodeName.equals(other.nodeName))
83              return false;
84          return true;
85      }
86  
87      /** {@inheritDoc} */
88      @Override
89      public String toString()
90      {
91          return "NodeData [nodeName=" + this.nodeName + ", position=" + this.position + "]";
92      }
93  
94  }