1 /*******************************************************************************
2 * Copyright (c) 2010 Association for Decentralized Information Management in
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.databoard.accessor.reference;
18 * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
20 public class ComponentReference extends ChildReference {
22 public ComponentReference() {
25 public ComponentReference(ChildReference child) {
30 public String toString(boolean labelReference) {
35 public ChildReference clone() {
36 return new ComponentReference(childReference==null ? null : childReference.clone());
40 public boolean equals(Object obj) {
41 if (obj instanceof ComponentReference == false) return false;
42 ComponentReference other = (ComponentReference) obj;
43 if (other.hasChildReference() != hasChildReference()) return false;
44 if (hasChildReference() && !other.childReference.equals(childReference)) return false;
49 public int hashCode() {
51 if (hasChildReference()) hash = 31*hash + childReference.hashCode();