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.browsing.ui.common.labelers;
\r
14 import java.util.Arrays;
\r
15 import java.util.Map;
\r
17 import org.simantics.browsing.ui.content.Labeler;
\r
19 public class LabelerContent {
\r
21 public static LabelerContent NO_CONTENT = new LabelerContent(0, Labeler.NO_LABELS);
\r
23 public final int category;
\r
24 public final Map<String, String> labels;
\r
26 public LabelerContent(int category, Map<String, String> labels) {
\r
27 this.category = category;
\r
28 this.labels = labels;
\r
32 public String toString() {
\r
33 return "LabelerContent[" + Arrays.toString(labels.values().toArray()) + "]";
\r
37 public int hashCode() {
\r
38 return category + 31 * labels.hashCode();
\r
42 public boolean equals(Object object) {
\r
46 else if (object == null)
\r
48 else if (!(object instanceof LabelerContent))
\r
51 LabelerContent lc = (LabelerContent)object;
\r
52 return category == lc.category && labels.equals(lc.labels);
\r