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.connection;
14 import org.simantics.g2d.diagram.handler.Topology.Terminal;
15 import org.simantics.g2d.element.IElement;
16 import org.simantics.utils.datastructures.Pair;
19 * @author Tuukka Lehtonen
21 public class TerminalReference {
23 private final Pair<IElement, Terminal> data;
25 public TerminalReference(IElement node, Terminal terminal) {
26 data = Pair.make(node, terminal);
29 public Object getNode() {
33 public Terminal getTerminal() {
38 public int hashCode() {
39 return data.hashCode();
43 public boolean equals(Object obj) {
48 if (!(obj instanceof TerminalReference))
50 TerminalReference other = (TerminalReference) obj;
51 return data.equals(other.data);
55 public String toString() {
56 return getClass().getSimpleName() + "[" + data + "]";