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://github.com/peter-knoppers">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 name of the node
25       * @param position 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      // @Override
50      public String getId()
51      {
52          return this.nodeName;
53      }
54  
55      @Override
56      public int hashCode()
57      {
58          final int prime = 31;
59          int result = 1;
60          result = prime * result + ((this.nodeName == null) ? 0 : this.nodeName.hashCode());
61          return result;
62      }
63  
64      @Override
65      public boolean equals(final Object obj)
66      {
67          if (this == obj)
68              return true;
69          if (obj == null)
70              return false;
71          if (getClass() != obj.getClass())
72              return false;
73          NodeDataDeprecated other = (NodeDataDeprecated) obj;
74          if (this.nodeName == null)
75          {
76              if (other.nodeName != null)
77                  return false;
78          }
79          else if (!this.nodeName.equals(other.nodeName))
80              return false;
81          return true;
82      }
83  
84      @Override
85      public String toString()
86      {
87          return "NodeData [nodeName=" + this.nodeName + ", position=" + this.position + "]";
88      }
89  
90  }