1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\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.debug.ui;
\r
14 import org.simantics.db.Resource;
\r
15 import org.simantics.utils.Container;
\r
17 public class LabeledResource implements Container<Resource> {
\r
22 public LabeledResource(String label, Resource resource) {
\r
23 assert(label!=null && resource!=null);
\r
25 this.resource = resource;
\r
29 public Resource get() {
\r
34 public String toString() {
\r
39 public int hashCode() {
\r
40 return resource.hashCode();
\r
44 public boolean equals(Object obj) {
\r
45 if (!(obj instanceof LabeledResource)) return false;
\r
46 LabeledResource other = (LabeledResource) obj;
\r
47 return resource.equals(other.get());
\r