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.structural.ui.modelBrowser.nodes;
14 import org.simantics.db.Resource;
16 public class ConnectionNode {
18 public final Resource connection;
19 public final Resource composite;
21 public ConnectionNode(Resource connection, Resource composite) {
22 this.connection = connection;
23 this.composite = composite;
27 public int hashCode() {
30 result = prime * result
31 + ((composite == null) ? 0 : composite.hashCode());
32 result = prime * result
33 + ((connection == null) ? 0 : connection.hashCode());
38 public boolean equals(Object obj) {
43 if (getClass() != obj.getClass())
45 ConnectionNode other = (ConnectionNode) obj;
46 if (composite == null) {
47 if (other.composite != null)
49 } else if (!composite.equals(other.composite))
51 if (connection == null) {
52 if (other.connection != null)
54 } else if (!connection.equals(other.connection))