1 /*******************************************************************************
\r
2 * Copyright (c) 2010 Association for Decentralized Information Management in
\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.databoard.type;
14 import org.simantics.databoard.util.ObjectUtils;
\r
16 public class Component {
20 public Component(String name, Datatype type) {
26 public int hashCode() {
27 return type.hashCode() + 13*ObjectUtils.hashCode(name);
31 public boolean equals(Object obj) {
32 if (this==obj) return true;
33 if (obj instanceof Component == false) return false;
34 Component other = (Component) obj;
35 return type.equals(other.type) && ObjectUtils.objectEquals(name, other.name);
39 public String toString() {
40 return name + " = " + type;