1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g2d.routing;
\r
14 import java.awt.geom.Rectangle2D;
\r
15 import java.util.Arrays;
\r
17 public class Terminal {
\r
18 public static final double[] ZEROS = new double[] { 0.0, 0.0, 0.0, 0.0 };
\r
22 public int directions;
\r
23 public double[] minDist;
\r
24 public Rectangle2D parentObstacle;
\r
26 public Terminal(double x, double y, int directions, double[] minDist,
\r
27 Rectangle2D parentObstacle) {
\r
30 this.directions = directions;
\r
31 this.minDist = minDist;
\r
32 this.parentObstacle = parentObstacle;
\r
36 public int hashCode() {
\r
37 final int prime = 31;
\r
39 result = prime * result + directions;
\r
40 result = prime * result + Arrays.hashCode(minDist);
\r
42 temp = Double.doubleToLongBits(x);
\r
43 result = prime * result + (int) (temp ^ (temp >>> 32));
\r
44 temp = Double.doubleToLongBits(y);
\r
45 result = prime * result + (int) (temp ^ (temp >>> 32));
\r
50 public boolean equals(Object obj) {
\r
55 if (getClass() != obj.getClass())
\r
57 Terminal other = (Terminal) obj;
\r
58 if (directions != other.directions)
\r
60 if (!Arrays.equals(minDist, other.minDist))
\r
62 if (Double.doubleToLongBits(x) != Double.doubleToLongBits(other.x))
\r
64 if (Double.doubleToLongBits(y) != Double.doubleToLongBits(other.y))
\r