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